作者 郭盛
1 个管道 的构建 失败 耗费 6 秒

修改发短信

... ... @@ -5,6 +5,7 @@ namespace app\admin\controller;
use app\api\controller\Pay;
use app\common\controller\Backend;
use think\Db;
use app\nsms\nsms;
/**
* 苹果用户购买素材订单
... ... @@ -141,8 +142,7 @@ class Iphone extends Backend
$content = "【仁甲看见SHOP】,感谢您购买仁甲看见SHOP素材。图片标题:$pic[title],云盘地址:$pic[url]";
//发送短信
$send = new Pay();
$send->sms($mobile,$content);
$this->sms($mobile,$content);
}elseif (empty($data['pic_id'])){
$video_id = unserialize($data['video_id']);
... ... @@ -157,8 +157,7 @@ class Iphone extends Backend
$content = "【仁甲看见SHOP】,感谢您购买仁甲看见SHOP素材。视频标题:$video[title],云盘地址:$video[eight_url]";
}
//发送短信
$send = new Pay();
$send->sms($mobile,$content);
$this->sms($mobile,$content);
}
$update = $user_info['money'] - $data['total'];
Db::name('user')->where('id',$user_info['id'])->update(['money'=>$update]);
... ... @@ -190,4 +189,30 @@ class Iphone extends Backend
$this->view->assign("row", $row);
return $this->view->fetch();
}
//发送短信
public function sms($mobile,$content){
$note = array(
'content' => $content,//短信内容
'mobile' => $mobile,//手机号码
'productid' => '676767',//模板id
'xh' => ''//小号
);
$result = $this->send_sms($note);
return $result;
}
function send_sms($data){
//todo 短信账号密码
// require_once EXTEND_PATH . 'nsms/nsms.php';
$url = "http://www.ztsms.cn/sendNSms.do";
$username = 'hangpai';
$password = 'Cxz307312';
$sendAPI = new nsms($url, $username, $password);
$sendAPI->data = $data;/*初始化数据包*/
$return = $sendAPI->sendSMS('POST');
return $return;
}
}
... ...
... ... @@ -7962,7 +7962,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2020-08-12 14:29:05 </div>
Generated on 2020-08-12 17:28:57 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...