Sfoglia il codice sorgente

保养和订单字段调整

zhangxiaobin 1 anno fa
parent
commit
38a1192f26

+ 8 - 4
application/api/controller/Order.php

@@ -28,8 +28,9 @@ class Order extends Api
 
             $o = 'order';
             $st = 'servicetype';
-            $field = $o.'.id,check_code,orderno,server_time,server_info,server_images,status,user_mobile,'.$o.'.user_car_number,'.
-                $o.'.createtime,cancel_time,cancel_reason,pay_fee,appen_fee,finish_time,'.$st.'.title as `service_title`,paytype';
+            $p = 'package';
+            $field = $o.'.id,check_code,orderno,server_time,server_info,server_images,'.$o.'.status,user_mobile,'.$o.'.user_car_number,'.
+                $o.'.createtime,cancel_time,cancel_reason,pay_fee,appen_fee,finish_time,'.$st.'.title as `service_title`,paytype,'.$p.'.title as `service_title`';
             $where[$o.'.user_id'] = $this->auth->id;
             $where[$o.'.company_id'] = $this->auth->company_id;
             if (!empty($status)) {
@@ -37,6 +38,7 @@ class Order extends Api
             }
             $result = $this->model->alias($o)->field($field)
                 ->join($st,$st.'.id = '.$o.'.servicetype_id','LEFT')
+                ->join($p,$p.'.id = '.$o.'.package_id','LEFT')
                 ->where($where)->order($o.'.createtime desc')->autopage()->select();
             if (!empty($result)) {
                 $statusArr  = [2=>'待处理',3=>'已完成',4=>'已取消'];
@@ -119,12 +121,14 @@ class Order extends Api
             }
             $o = 'order';
             $st = 'servicetype';
+            $p = 'package';
             $where[$o.'.user_id'] = $this->auth->id;
             $where[$o.'.id'] = $id;
-            $field = $o.'.id,check_code,orderno,server_time,server_info,server_images,status,user_mobile,'.$o.'.user_car_number,'.
-                $o.'.createtime,cancel_time,cancel_reason,pay_fee,appen_fee,finish_time,'.$st.'.title as `service_title`,paytype';
+            $field = $o.'.id,check_code,orderno,server_time,server_info,server_images,'.$o.'.status,user_mobile,'.$o.'.user_car_number,'.
+                $o.'.createtime,cancel_time,cancel_reason,pay_fee,appen_fee,finish_time,'.$st.'.title as `service_title`,paytype,'.$p.'.title as `service_title`';
             $result = $this->model->alias($o)->field($field)
                 ->join($st,$st.'.id = '.$o.'.servicetype_id','LEFT')
+                ->join($p,$p.'.id = '.$o.'.package_id','LEFT')
                 ->where($where)->find();
             if (!empty($result)) {
                 $statusArr  = [2=>'待处理',3=>'已完成',4=>'已取消'];

+ 4 - 4
application/common/service/SmsService.php

@@ -91,15 +91,15 @@ class SmsService
                     if ($upkeepTime != $userCarRemind['upkeep_time']) {
                         $data['is_remind']  = 0;
                         $data['updatetime'] = $time;
-                        $result = Db::name('user_car_remind')->where($remindWhere)->update($data);
-                        if (!$result) {
+                        $res = Db::name('user_car_remind')->where($remindWhere)->update($data);
+                        if (!$res) {
                             throw new Exception('更新保养提醒失败');
                         }
                     }
                 } else {
                     $data['createtime'] = $time;
-                    $result = Db::name('user_car_remind')->insertGetId($data);
-                    if (!$result) {
+                    $res = Db::name('user_car_remind')->insertGetId($data);
+                    if (!$res) {
                         throw new Exception('记录保养提醒失败');
                     }
                 }