|
|
@@ -36,7 +36,7 @@ class sms
|
|
|
const LIMIT = 15;
|
|
|
|
|
|
//商家发短信 ssh 2019.12.24
|
|
|
- public static function merchantSend($mobile, $msg, $merchant)
|
|
|
+ public static function merchantSend($params, $msg, $merchant)
|
|
|
{
|
|
|
$sjId = $merchant['id'];
|
|
|
$asset = MerchantAssetService::getBySjId($sjId, true);
|
|
|
@@ -47,11 +47,11 @@ class sms
|
|
|
}
|
|
|
$asset->remainSmsNum = --$remainSmsNum;
|
|
|
$asset->save();
|
|
|
- self::freeSend($mobile, $msg, $merchant);
|
|
|
+ self::freeSend($params, $msg, $merchant);
|
|
|
}
|
|
|
|
|
|
//自由发短,无ip和数量限制 ssh 2019.12.24
|
|
|
- public static function freeSend($mobile, $msg, $merchant = null)
|
|
|
+ public static function freeSend($params, $msg, $merchant = null)
|
|
|
{
|
|
|
$ptStyle = dict::getDict('ptStyle', 'hd');
|
|
|
if (isset(Yii::$app->params['ptStyle'])) {
|
|
|
@@ -62,21 +62,21 @@ class sms
|
|
|
$sign = isset($merchant) == true ? "【{$merchant['name']}】" : "【{$name}】";
|
|
|
$msg .= $sign;
|
|
|
$sms = new ChuanglanSmsApi();
|
|
|
- $result = $sms->sendVariableSMS($msg, $mobile);
|
|
|
+ $result = $sms->sendVariableSMS($msg, $params);
|
|
|
if (!is_null(json_decode($result))) {
|
|
|
$output = json_decode($result, true);
|
|
|
if (isset($output['code']) && $output['code'] == '0') {
|
|
|
- Yii::info("短信发送成功,手机号:{$mobile} 返回:" . $result);
|
|
|
+ Yii::info("短信发送成功,参数:{$params} 返回:" . $result);
|
|
|
} else {
|
|
|
- Yii::info("短信发送失败,手机号:{$mobile} 返回:" . $result);
|
|
|
+ Yii::info("短信发送失败,参数:{$params} 返回:" . $result);
|
|
|
}
|
|
|
} else {
|
|
|
- Yii::info("短信发送失败,手机号:{$mobile} 返回:" . $result);
|
|
|
+ Yii::info("短信发送失败,参数:{$params} 返回:" . $result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//发短信,有ip和用户数量限制 ssh 2020.2.27
|
|
|
- public static function send($mobile, $msg, $merchant = null)
|
|
|
+ public static function send($params, $msg, $merchant = null)
|
|
|
{
|
|
|
$ptStyle = Yii::$app->params['ptStyle'];
|
|
|
$open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => $ptStyle]);
|
|
|
@@ -107,7 +107,7 @@ class sms
|
|
|
Yii::$app->redis->executeCommand('SETEX', [$statusKey, 60, 'hasSend']);
|
|
|
Yii::$app->redis->executeCommand('SETEX', [$todayKey, 86400, ++$num]);
|
|
|
$sms = new ChuanglanSmsApi();
|
|
|
- $sms->sendVariableSMS($msg, $mobile);
|
|
|
+ $sms->sendVariableSMS($msg, $params);
|
|
|
}
|
|
|
|
|
|
}
|