|
|
@@ -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;
|