PHPackages                             quansitech/easy-get-flower - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. quansitech/easy-get-flower

ActiveLibrary

quansitech/easy-get-flower
==========================

txgy xhh easygetflower

v1.2.0(5mo ago)1539↓100%MITPHPPHP &gt;=7.2.0

Since Jun 14Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/quansitech/easy-get-flower)[ Packagist](https://packagist.org/packages/quansitech/easy-get-flower)[ RSS](/packages/quansitech-easy-get-flower/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (7)Used By (0)

quansitech/easy-get-flower
==========================

[](#quansitecheasy-get-flower)

```
腾讯公益小红花API

```

#### 安装

[](#安装)

```
composer require quansitech/easy-get-flower
```

#### 实例化类

[](#实例化类)

```
// 参数说明
// array $config 腾讯公益小红花相关配置项
$config = [
    'appid' => 'xxx',
    'key' => 'xxx',
    'et' => 'xxx',
];
$get_flower = new \EasyGetFlower\Application($config);
```

#### getUserXhhNum

[](#getuserxhhnum)

```
查询用户累计获取小红花数量

```

```
// 参数说明
// $openid 用户微信openid
$openid = 'xxx';
$get_flower->getUserXhhNum($openid);

// 返回值说明
// 返回用户累计小红花数量
```

#### hasBillUsed

[](#hasbillused)

```
判断业务订单是否已使用

```

```
// 参数说明
// $openid 用户微信openid
// $trans_code 业务订单号，需要以YYYYMMDD开头，不能超过32位
$openid = 'xxx';
$trans_code = date('Ymd').'1';
$get_flower->hasBillUsed($openid,$trans_code);

// 返回值说明
// 0 未使用
// 1 已使用
```

#### buildLink

[](#buildlink)

```
生成领花页链接

```

```
// 参数说明
// $openid 用户微信openid
// $trans_code 业务订单号，需要以YYYYMMDD开头，不能超过32位
// $xhh_num 期望派发的小红花数量
// $time_expire 订单重试结束时间，格式为YYYY-MM-DD HH:mm:SS，不能超过10分钟，若为空则是当前时间加10分钟
// jump_type 跳转类型，目前支持H5和MP小程序，默认为H5
// wechat_status 设置微信状态，0 否 1 是，默认为 0
// pre_try_param 预发花接口额外参数，默认为空

$openid = 'xxx';
$trans_code = date('Ymd').'1';
$xhh_num = '1';
$time_expire = '';
$jump_type = 'H5';
$wechat_status = 0;
$pre_try_param = [
    'business_info' => [
        'key1' => 10,
        'key2' => 1
    ],
    'attach' => 'attach'
];

$get_flower->buildLink($openid,$trans_code,$xhh_num,$time_expire,$jump_type,$wechat_status,$pre_try_param);

// 返回值说明
// link 领花页链接
// exchange_id 业务的预发花id
```

#### buildSilenceWechatStatusLink

[](#buildsilencewechatstatuslink)

```
生成无感发花设置微信状态路径

```

```
$get_flower->buildSilenceWechatStatusLink();

// 返回值说明
// link 无感发花设置微信状态路径
```

#### 返回错误统一说明

[](#返回错误统一说明)

```
// 若接口返回false，说明是正常的业务错误
// 获取具体错误
$get_flower->getError();

// 其它非业务错误直接抛出异常
```

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance72

Regular maintenance activity

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~243 days

Recently: every ~304 days

Total

6

Last Release

160d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15a0610fee78753bdad92fd45c3506455c0fd45ae51924797b1841d260495a3f?d=identicon)[tiderjian](/maintainers/tiderjian)

![](https://www.gravatar.com/avatar/6c2b4bb10b346cb957c091d3273e3332276b5d09a29e255d387184f5dd4b5976?d=identicon)[xhiny](/maintainers/xhiny)

---

Top Contributors

[![Xhiny](https://avatars.githubusercontent.com/u/35066497?v=4)](https://github.com/Xhiny "Xhiny (12 commits)")

### Embed Badge

![Health badge](/badges/quansitech-easy-get-flower/health.svg)

```
[![Health](https://phpackages.com/badges/quansitech-easy-get-flower/health.svg)](https://phpackages.com/packages/quansitech-easy-get-flower)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
