wesmiler hai 1 mes
pai
achega
7df9da9d91
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      app/Services/Api/GoodsService.php

+ 4 - 0
app/Services/Api/GoodsService.php

@@ -101,7 +101,11 @@ class GoodsService extends BaseService
 
         $model = $this->model->with(['store','category'])
             ->from('goods as a')
+            ->leftJoin('stores as b','b.id','=','a.store_id')
             ->where($where)
+            ->where(function($query){
+                $query->where('a.store_id',0)->orWhere('b.id','>',0);
+            })
             ->where(function ($query) use ($params) {
                 // 分类
                 $categoryId = isset($params['category_id'])? intval($params['category_id']) : 0;