PHPackages                             chocoboxxf/yii2-alidayu-sdk - 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. [API Development](/categories/api)
4. /
5. chocoboxxf/yii2-alidayu-sdk

ActiveYii2-extension[API Development](/categories/api)

chocoboxxf/yii2-alidayu-sdk
===========================

Alidayu API for Yii 2.0

v0.0.1(9y ago)112585[2 issues](https://github.com/chocoboxxf/yii2-alidayu-sdk/issues)MITPHPPHP &gt;=5.4.0

Since Sep 9Pushed 9y ago2 watchersCompare

[ Source](https://github.com/chocoboxxf/yii2-alidayu-sdk)[ Packagist](https://packagist.org/packages/chocoboxxf/yii2-alidayu-sdk)[ Docs](https://github.com/chocoboxxf/yii2-alidayu-sdk)[ RSS](/packages/chocoboxxf-yii2-alidayu-sdk/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

yii2-alidayu-sdk
================

[](#yii2-alidayu-sdk)

基于Yii2实现的阿里大鱼API SDK（目前开发中）

环境条件
----

[](#环境条件)

- > = PHP 5.4
- > = Yii 2.0
- > = GuzzleHttp 6.0

安装
--

[](#安装)

添加下列代码在`composer.json`文件中并执行`composer update --no-dev`操作

```
{
    "require": {
       "chocoboxxf/yii2-alidayu-sdk": "dev-master"
    }
}
```

设置方法
----

[](#设置方法)

```
// 全局使用
// 在config/main.php配置文件中定义component配置信息
'components' => [
  .....
  'alidayu' => [
    'class' => 'chocoboxxf\Alidayu\Alidayu',
    'appKey' => '1234', // 淘宝开发平台App Key
    'appSecret' => '12345678', // 淘宝开发平台App Secret
    'partnerKey' => 'PARTNER_NAME_AXN', // 阿里大鱼提供的第三方合作伙伴使用的KEY
    'env' => 'sandbox', // 使用环境，分sandbox（测试环境）, production（生产环境）
  ]
  ....
]
// 代码中调用（调用短信发送接口示例）
$result = Yii::$app->alidayu->smsSend('13000000000', 'SMS_100000', '测试签名', 'normal', ['code' => '111111'], '100000');
....
```

```
// 局部调用
$alidayu = Yii::createObject([
    'class' => 'chocoboxxf\Alidayu\Alidayu',
    'appKey' => '1234', // 淘宝开发平台App Key
    'appSecret' => '12345678', // 淘宝开发平台App Secret
    'partnerKey' => 'PARTNER_NAME_AXN', // 阿里大鱼提供的第三方合作伙伴使用的KEY
    'env' => 'sandbox', // 使用环境，分sandbox（测试环境）, production（生产环境）
]);
// 调用短信发送接口示例
$result = $alidayu->smsSend('13000000000', 'SMS_100000', '测试签名', 'normal', ['code' => '111111'], '100000');
....
```

使用示例
----

[](#使用示例)

短信发送接口

```
$result = Yii::$app->alidayu->smsSend('13000000000', 'SMS_100000', '测试签名', 'normal', ['code' => '111111'], '100000');
if (isset($result['alibaba_aliqin_fc_sms_num_send_response'])) {
    // 正常情况
    // 返回数据格式
    // {
    //     "alibaba_aliqin_fc_sms_num_send_response":{
    //         "result":{
    //             "err_code":"0",
    //             "model":"100000000000^1000000000000",
    //             "success":true
    //         },
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} elseif (isset($result['error_response'])) {
    // 出错情况
    // 返回数据格式
    // {
    //     "error_response":{
    //         "code":15,
    //         "msg":"Remote service error",
    //         "sub_code":"isv.ACCOUNT_NOT_EXISTS",
    //         "sub_msg":"阿里大于账户不存在",
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} else {
    // 异常情况
    ....
}
....
```

短信发送记录查询接口

```
$result = Yii::$app->alidayu->smsQuery('13000000000', '20160909', 1, 50, '100000000000^1000000000000');
if (isset($result['alibaba_aliqin_fc_sms_num_query_response'])) {
    // 正常情况
    // 返回数据格式
    // {
    //     "alibaba_aliqin_fc_sms_num_query_response":{
    //         "current_page":1,
    //         "page_size":50,
    //         "total_count":1,
    //         "total_page":1,
    //         "values":{
    //             "fc_partner_sms_detail_dto":[
    //                 {
    //                     "extend":"100000",
    //                     "rec_num":"13000000000",
    //                     "result_code":"DELIVRD",
    //                     "sms_code":"SMS_100000",
    //                     "sms_content":"【测试*】您的验证码是******",
    //                     "sms_receiver_time":"2016-09-09 15:27:46",
    //                     "sms_send_time":"2016-09-09 15:27:42",
    //                     "sms_status":3
    //                 }
    //             ]
    //         }
    //     }
    // }
    ....
} elseif (isset($result['error_response'])) {
    // 出错情况
    // 返回数据格式
    // {
    //     "error_response":{
    //         "code":15,
    //         "msg":"Remote service error",
    //         "sub_code":"isv.ACCOUNT_NOT_EXISTS",
    //         "sub_msg":"阿里大于账户不存在",
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} else {
    // 异常情况
    ....
}
....
```

文本转语音通知接口

```
$result = Yii::$app->alidayu->ttsSingleCall('13000000000', 'TTS_14730399', '051482043260', ['code' => '111111'], '100000'));
if (isset($result['alibaba_aliqin_fc_tts_num_singlecall_response'])) {
    // 正常情况
    // 返回数据格式
    // {
    //     "alibaba_aliqin_fc_tts_num_singlecall_response":{
    //         "result":{
    //             "err_code":"0",
    //             "model":"100000000000^1000000000000",
    //             "success":true
    //         },
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} elseif (isset($result['error_response'])) {
    // 出错情况
    // 返回数据格式
    // {
    //     "error_response":{
    //         "code":15,
    //         "msg":"Remote service error",
    //         "sub_code":"isv.TTS_TEMPLATE_ILLEGAL",
    //         "sub_msg":"未找到审核通过的文本转语音模板,ttsCode=TTS_100000,partnerId=10000000000",
    //         "request_id":"zt9pqaglr3tk"
    // }
    ....
} else {
    // 异常情况
    ....
}
....
```

AXB(AXN)一次绑定接口

```
$result = Yii::$app->alidayu->AxbBind('13000000001', '13000000000', '2017-01-01 00:00:00');
if (isset($result['alibaba_aliqin_secret_axb_bind_response'])) {
    // 正常情况
    // 返回数据格式
    // {
    //     "alibaba_aliqin_secret_axb_bind_response":{
    //         "subs_id":12345,
    //         "secret_no_x":"13300000000"
    //     }
    // }
    ....
} elseif (isset($result['error_response'])) {
    // 出错情况
    // 返回数据格式
    // {
    //     "error_response":{
    //         "code":40,
    //         "msg":"Missing required arguments:phone_no_b",
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} else {
    // 异常情况
    ....
}
....
```

AXN二次绑定接口

```
$result = Yii::$app->alidayu->AxbBindSecond('123', '13000000000', '2017-01-01 00:00:00');
if (isset($result['alibaba_aliqin_secret_axb_bind_second_response'])) {
    // 正常情况
    // 返回数据格式
    // {
    //     "alibaba_aliqin_secret_axb_bind_second_response":{
    //         "bind_success":true
    //     }
    // }
    ....
} elseif (isset($result['error_response'])) {
    // 出错情况
    // 返回数据格式
    // {
    //     "error_response":{
    //         "code":40,
    //         "msg":"Missing required arguments:phone_no_b",
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} else {
    // 异常情况
    ....
}
....
```

AXB(AXN)关系解绑接口

```
$result = Yii::$app->alidayu->AxbUnbind('123');
if (isset($result['alibaba_aliqin_secret_axb_unbind_response'])) {
    // 正常情况
    // 返回数据格式
    // {
    //     "alibaba_aliqin_secret_axb_unbind_response":{
    //         "unbind_success":true,
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} elseif (isset($result['error_response'])) {
    // 出错情况
    // 返回数据格式
    // {
    //     "error_response":{
    //         "code":40,
    //         "msg":"Missing required arguments:subs_id",
    //         "request_id":"zt9pqaglr3tk"
    //     }
    // }
    ....
} else {
    // 异常情况
    ....
}
....
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

3585d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3401509?v=4)[许晓峰](/maintainers/chocoboxxf)[@chocoboxxf](https://github.com/chocoboxxf)

---

Top Contributors

[![chocoboxxf](https://avatars.githubusercontent.com/u/3401509?v=4)](https://github.com/chocoboxxf "chocoboxxf (9 commits)")

---

Tags

sdksmsyii2telephonealidayu

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chocoboxxf-yii2-alidayu-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/chocoboxxf-yii2-alidayu-sdk/health.svg)](https://phpackages.com/packages/chocoboxxf-yii2-alidayu-sdk)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[facebook/php-business-sdk

PHP SDK for Facebook Business

91624.2M37](/packages/facebook-php-business-sdk)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M45](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)

PHPackages © 2026

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