Browse Source

up - 列表字段

liugc 1 year ago
parent
commit
b04a2368dd

+ 9 - 10
app/adminapi/lists/master_worker/MasterWorkerLists.php

@@ -88,10 +88,9 @@ class MasterWorkerLists extends BaseAdminDataLists implements ListsSearchInterfa
         // 无人在0,0坐标上
         if($customer_lon && $customer_lat){
             // 查出所有的师傅 -> 计算距离 -> 按距离排序 -> 分页
-            $allList = MasterWorker::alias('mw')
-                ->join('master_worker_register mwr', 'mwr.worker_id = mw.id')
-                ->whereFindInSet('mw.category_ids',$goods_category_id)
-                ->where($this->searchWhere)
+            $allList = MasterWorker::alias('mw')->join('master_worker_register mwr', 'mwr.worker_id = mw.id');
+            if($goods_category_id) $allList->whereFindInSet('mw.category_ids',$goods_category_id);
+            $allList = $allList->where($this->searchWhere)
                 ->where($this->queryWhere())
                 ->field([
                     'mw.*',
@@ -108,10 +107,9 @@ class MasterWorkerLists extends BaseAdminDataLists implements ListsSearchInterfa
             $list = $this->limitPage($allList,$mastersDistances,$this->params['page_no']??1,$this->params['page_size']??10);
             $this->count = count($allList);
         }else{
-            $list = MasterWorker::alias('mw')
-                ->join('master_worker_register mwr', 'mwr.worker_id = mw.id')
-                ->whereFindInSet('mw.category_ids',$goods_category_id)
-                ->where($this->searchWhere)
+            $list = MasterWorker::alias('mw')->join('master_worker_register mwr', 'mwr.worker_id = mw.id');
+            if($goods_category_id) $list->whereFindInSet('mw.category_ids',$goods_category_id);
+            $list = $list->where($this->searchWhere)
                 ->where($this->queryWhere())
                 ->field([
                     'mw.*',
@@ -123,8 +121,9 @@ class MasterWorkerLists extends BaseAdminDataLists implements ListsSearchInterfa
                 ->select()
                 ->toArray();
             $this->count = MasterWorker::alias('mw')
-                ->join('master_worker_register mwr', 'mwr.worker_id = mw.id')
-                ->field([
+                ->join('master_worker_register mwr', 'mwr.worker_id = mw.id');
+            if($goods_category_id) $this->count->whereFindInSet('mw.category_ids',$goods_category_id);
+            $this->count = $this->count->field([
                     'mw.*'])
                 ->where($this->searchWhere)->where($this->queryWhere())
                 ->count();

+ 0 - 1
app/api/lists/property/PropertyCommissionLists.php

@@ -42,7 +42,6 @@ class PropertyCommissionLists extends BaseApiDataLists implements ListsSearchInt
                 ['payment_type', 'IN', [0,1]]
             ])->find())['orderGoods'][0];
         }
-        $lists = array_merge($lists,$lists['propertyHead'],$lists['propertyUser'],$lists['propertyWork']);
         return $lists;
     }
 

+ 0 - 1
app/api/lists/property/PropertyOrderLists.php

@@ -36,7 +36,6 @@ class PropertyOrderLists extends BaseApiDataLists implements ListsSearchInterfac
             ->order('create_time desc')
             ->select()
             ->toArray();
-        $lists = array_merge($lists,$lists['propertyHead'],$lists['propertyUser'],$lists['propertyWork']);
         return $lists;
     }
 

+ 0 - 1
app/api/lists/property/PropertySurplusLogLists.php

@@ -53,7 +53,6 @@ class PropertySurplusLogLists extends BaseApiDataLists implements ListsSearchInt
             }
             $item['surplus_sn'] = date('YmdHis',strtotime($item['create_time']));
         }
-        $lists = array_merge($lists,$lists['propertyHead']);
         return $lists;
     }