作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

添加发短信功能

@@ -1706,6 +1706,7 @@ class User extends Api @@ -1706,6 +1706,7 @@ class User extends Api
1706 public function iphone_order() 1706 public function iphone_order()
1707 { 1707 {
1708 $param['user_id'] = $this->uid; 1708 $param['user_id'] = $this->uid;
  1709 + $user = Db::name('user')->where('id',$param['user_id'])->field('mobile,id,type')->find();
1709 1710
1710 //接收视频ID加视频属性 1711 //接收视频ID加视频属性
1711 $video['id'] = $this->request->post('video_id'); 1712 $video['id'] = $this->request->post('video_id');
@@ -1765,8 +1766,18 @@ class User extends Api @@ -1765,8 +1766,18 @@ class User extends Api
1765 ->insertGetId($param); 1766 ->insertGetId($param);
1766 if(empty($data)){ 1767 if(empty($data)){
1767 $this->error(['code'=>2,'msg'=>'sql执行失败']); 1768 $this->error(['code'=>2,'msg'=>'sql执行失败']);
  1769 + }else{
  1770 + //发送短信,通知客户
  1771 + $mobile = 13780608990;
  1772 + $content = "【仁甲看见SHOP】提醒您,您有新苹果客户下了订单,客户电话为:$user[mobile] ,请您及时回复!";
  1773 + //发送短信
  1774 +
  1775 + $send = new Pay();
  1776 + $send->sms($mobile,$content);
  1777 +
  1778 + $this->success('SUCCESS',['order_id'=>$data]);
1768 } 1779 }
1769 - $this->success('SUCCESS',['order_id'=>$data]); 1780 +
1770 } 1781 }
1771 1782
1772 1783