whitefang 1 rok pred
rodič
commit
89ab55d6c0

+ 1 - 1
app/api/lists/GoodsReviewsLists.php

@@ -49,7 +49,7 @@ class GoodsReviewsLists extends BaseApiDataLists implements ListsSearchInterface
         $lists = GoodsReviews::where($this->searchWhere)
             ->where($this->queryWhere())
             ->limit($this->limitOffset, $this->limitLength)
-            ->field(['id','rating','comment','review_image','create_time'])
+            ->field(['id','nickname','rating','comment','review_image','create_time'])
             ->order('create_time desc')
             ->select()
             ->toArray();

+ 5 - 12
app/api/lists/recharge/ServiceOrderLists.php

@@ -27,24 +27,17 @@ use app\common\model\works\ServiceWork;
 class ServiceOrderLists extends BaseApiDataLists
 {
     protected $count = 0;
-
-    public function setSearch(): array
-    {
-        return [
-            '=' => ['service_status'],
-        ];
-    }
-
     public function queryWhere()
     {
         $where = [];
         if (isset($this->params['service_status'])) {
-            $work_ids = ServiceWork::where(['user_id' => $this->userId])->where(function ($query) {
-                if($this->params['service_status'] != 'all'){
-                    $query->where(['service_status' => $this->params['service_status']]);
+            $service_status = $this->params['service_status'];
+            $work_ids = ServiceWork::where(['user_id' => $this->userId])->where(function ($query) use($service_status) {
+                if($service_status != 'all'){
+                    $query->where(['service_status' => $service_status]);
                 }
             })->column('id');
-            $where['work_id'] = ['in', $work_ids];
+            $where['work_id'] = ['in', !empty($work_ids)?$work_ids:5];
         }
         return $where;
     }