Ver código fonte

维保流程

lizhen_gitee 7 meses atrás
pai
commit
eea51923b6
1 arquivos alterados com 18 adições e 13 exclusões
  1. 18 13
      application/api/controller/Maintain.php

+ 18 - 13
application/api/controller/Maintain.php

@@ -35,13 +35,14 @@ class Maintain extends Api
         }
         $filedata = json_encode($filedata);
 
+        $nowtime = time();
         //写入
         $data = [
             'orderno' => createUniqueNo('',''),
             'user_id' => $this->auth->id,
             'company_id' => $this->auth->company_id,
-            'createtime' => time(),
-            'updatetime' => time(),
+            'createtime' => $nowtime,
+            'updatetime' => $nowtime,
             'info' => $info,
             'filedata' => $filedata,
             'mobile' => $mobile,
@@ -178,18 +179,20 @@ class Maintain extends Api
         //找出最新报价日志
         $baojia_log = Db::name('maintain_baojia')->where('order_id',$id)->where('status',30)->order('id desc')->find();
 
+        $nowtime = time();
+
         //更新订单
         //更新报价记录
         if($status == 2){
             $update = [
                 'status' => 32,  // '用户审核驳回',//等待再次报价
-                'updatetime' => time(),
+                'updatetime' => $nowtime,
             ];
             $update_baojia = [
                 'status' => 32,  // '用户审核驳回',//等待再次报价
-                'updatetime' => time(),
+                'updatetime' => $nowtime,
 
-                'baojia_useraudit_time' => time(),
+                'baojia_useraudit_time' => $nowtime,
                 'baojia_useraudit_reason' => $reason,
             ];
 
@@ -197,14 +200,14 @@ class Maintain extends Api
         }else{
             $update = [
                 'status' => 40,
-                'updatetime' => time(),
-                'baojia_lasttime' => time(),  //报价终审时间
+                'updatetime' => $nowtime,
+                'baojia_lasttime' => $nowtime,  //报价终审时间
             ];
             $update_baojia = [
                 'status' => 40,
-                'updatetime' => time(),
+                'updatetime' => $nowtime,
 
-                'baojia_useraudit_time' => time(),
+                'baojia_useraudit_time' => $nowtime,
             ];
 
             $remark = '报价已通过,即将指派师傅';
@@ -251,19 +254,21 @@ class Maintain extends Api
         //找出最新报价日志
         $baojia_log = Db::name('maintain_baojia')->where('order_id',$id)->where('status',30)->order('id desc')->find();
 
+        $nowtime = time();
+
         //更新订单
         $update = [
             'status' => 40,
-            'updatetime' => time(),
-            'baojia_confirmtime' => time(),  //报价确认时间
+            'updatetime' => $nowtime,
+            'baojia_confirmtime' => $nowtime,  //报价确认时间
         ];
 
         //更新报价记录
         $update_baojia = [
             'status' => 40,
-            'updatetime' => time(),
+            'updatetime' => $nowtime,
 
-            'baojia_useraudit_time' => time(),
+            'baojia_useraudit_time' => $nowtime,
         ];
 
         $rs1 = Db::name('maintain')->where('id',$id)->update($update);