Browse Source

服务类型调整

zhangxiaobin 1 year ago
parent
commit
5f13208521
2 changed files with 11 additions and 5 deletions
  1. 5 4
      application/api/controller/Order.php
  2. 6 1
      application/api/controller/Servicetype.php

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

@@ -217,11 +217,12 @@ class Order extends Api
             if (!empty($serviceTypeId)) {
                 $where[$o.'.servicetype_id'] = $serviceTypeId;
             }
-            if (!empty($carId)) {
-                $where[$o.'.user_car_id'] = $carId;
-            }
-            if (empty($carNumber)) {
+            if (!empty($carNumber)) {
                 $where[$o.'.user_car_number'] = $carNumber;
+            } else {
+                if (!empty($carId)) {
+                    $where[$o.'.user_car_id'] = $carId;
+                }
             }
             $where[$o.'.user_id'] = $this->auth->id;
             $where[$o.'.status'] = ['in',[2,3]];//状态:2=待处理,3=已完成,4=已取消

+ 6 - 1
application/api/controller/Servicetype.php

@@ -24,8 +24,13 @@ class Servicetype extends Api
     public function getList()
     {
         try {
+            $isUpkeep = $this->request->param('is_upkeep',-1);
             $field = 'id,title';
-            $result = $this->model->field($field)->order('weigh asc createtime desc')->select();
+            $where = [];
+            if ($isUpkeep != -1) {
+                $where['is_upkeep'] = $isUpkeep;
+            }
+            $result = $this->model->field($field)->where($where)->order('weigh asc createtime desc')->select();
 
             $this->success('获取成功',$result);
         } catch (Exception $e) {