zhangguidong 2 éve
szülő
commit
792d9f62cd

+ 6 - 3
application/api/controller/Index.php

@@ -48,10 +48,13 @@ class Index extends Api
     }
     public function ceshi()
     {
-        $v = input();
-        $sms_model =new Sms();
-        $sms_model->order_sta($v['phone'], 17, $v['t_user_id']);
+        $out_trade_no = 'SMS167817045828';
+        $smslog_model= new Smsorder();
+        $user_model = new \app\admin\model\User();
+        $number = $smslog_model->where('order_no',$out_trade_no)->field('number,user_id')->find();
+        $user_number = $user_model->where('id',$number['user_id'])->value('sms_number');
 
+        $smslog_model->isUpdate('true',['order_no'=>$out_trade_no])->save(['status'=>1]);
 
     }
 

+ 2 - 1
application/api/controller/Notify.php

@@ -90,7 +90,8 @@ class Notify extends Api
             $user_model = new \app\admin\model\User();
             $number = $smslog_model->where('order_no',$out_trade_no)->field('number,user_id')->find();
             $user_number = $user_model->where('id',$number['user_id'])->value('sms_number');
-            $user_model->isUpdate('true',['id'=>$number['user_id']])->save(['sms_number'=>$number['number']+$user_number]);
+            $num = $number['number']+$user_number;
+            $user_model->isUpdate('true',['id'=>$number['user_id']])->save(['sms_number'=>$num]);
             $smslog_model->isUpdate('true',['order_no'=>$out_trade_no])->save(['status'=>1]);
 
             //你可以在此编写订单逻辑