zxhxx 3 gadi atpakaļ
vecāks
revīzija
942c0637ec
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4 2
      application/api/controller/Rescue.php

+ 4 - 2
application/api/controller/Rescue.php

@@ -119,7 +119,7 @@ class Rescue extends Api
         $where['processtime'] = time();
         SosBill::where('id',input('id',0))->update($where);
         $info = SosBill::find(input('id',0));
-        switch ($where['status'])
+        switch (intval($where['status']))
         {
             case  1:
                 $temp = WechatTempleService::SUPPAORTER_REPLY;
@@ -129,6 +129,7 @@ class Rescue extends Api
                 $data['keyword2'] = $res_user['address'];
                 $data['keyword3'] = date("Y-m-d H:i:s");
                 $data['remark'] =$where['process_remark'];
+                WechatTempleService::sendTemplate($this->cid,UserRelation::userIdToOpenId($info['user_id']),$temp,$data,$where['re_url']);
                 break;
             case 2:
                 $temp = WechatTempleService::REQUEXST_REFUSE;
@@ -137,9 +138,10 @@ class Rescue extends Api
                 $data['keyword2'] = date("Y-m-d H:i:s");
                 $data['keyword3'] = "求救";
                 $data['remark'] ="";
+                WechatTempleService::sendTemplate($this->cid,UserRelation::userIdToOpenId($info['user_id']),$temp,$data,$where['re_url']);
                 break;
         }
-        WechatTempleService::sendTemplate($this->cid,UserRelation::userIdToOpenId($info['user_id']),$temp,$data,$where['re_url']);
+
         $this->success('处理完成');
     }
     public function sos_del(Request $request)