ADD:添加后台管理端接口;
DEL:删除不必要的头部注释; FIX:修正若干已知错误;
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
<?php
|
||||
|
||||
# @Author: 嗨噜客(三亚) <fm453>
|
||||
# @Date: 2022-05-22T07:38:52+08:00
|
||||
# @Email: fm453@lukegzs.com
|
||||
# @Last modified by: fm453
|
||||
# @Last modified time: 2024-08-09T09:13:59+08:00
|
||||
# @Copyright: www.hiluker.cn
|
||||
|
||||
namespace api\controllers\gm\v1;
|
||||
namespace api\controllers\gm\v1;
|
||||
|
||||
use Yii;
|
||||
use vendor\aliyun\dysms\Sms;
|
||||
@@ -28,9 +21,11 @@
|
||||
public function actionIndex()
|
||||
{
|
||||
$apis = [
|
||||
'vcode' => '获取短信验证码'
|
||||
'vcode' => '获取短信验证码',
|
||||
'send' => '批量发送营销短信(50条)',
|
||||
'caiwu' => '给财务发送短信'
|
||||
];
|
||||
$this->result('您正使用CMTS-CLIENT系统短信管理接口!', $apis, 200);
|
||||
$this->result('您正使用CMTS-GM系统短信管理接口!', $apis, 200);
|
||||
}
|
||||
|
||||
public function actionSend()
|
||||
@@ -57,21 +52,21 @@
|
||||
$option = array();
|
||||
$sms = new Sms($option, $config);
|
||||
|
||||
$address = isset($dataPost['address']) ? $dataPost['address'] : '';
|
||||
$address = $dataPost['address'] ?? '';
|
||||
if ($address) {
|
||||
$session->set('sms::address', $address);
|
||||
} else {
|
||||
$address = $session->get('sms::address');
|
||||
}
|
||||
|
||||
$tmpl = isset($dataPost['tmpl']) ? $dataPost['tmpl'] : '';
|
||||
$tmpl = $dataPost['tmpl'] ?? '';
|
||||
if ($tmpl) {
|
||||
$session->set('sms::tmpl', $tmpl);
|
||||
} else {
|
||||
$tmpl = $session->get('sms::tmpl');
|
||||
}
|
||||
|
||||
$_guests = isset($dataPost['guests']) ? $dataPost['guests'] : '';
|
||||
$_guests = $dataPost['guests'] ?? '';
|
||||
if (!$_guests) {
|
||||
$guests = $session->get('sms::guests');
|
||||
} else {
|
||||
@@ -108,7 +103,7 @@
|
||||
|
||||
foreach ($guests as $p => $username) {
|
||||
$j--;
|
||||
$content['name'] = !empty($username) ? $username . '安诚托车' : '安诚捷顺运车';
|
||||
$content['name'] = !empty($username) ? $username . '安邮车联' : '安邮运车';
|
||||
$result = $sms->send($p, $tmpl, $content);
|
||||
$results[$p] = $result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user