where('store_name', 'like', '%' . trim($postData['store_name']) . '%'); } if(!empty($postData["category_id"])){ $model = $model->where('supplier.category_id', '=', $postData["category_id"]); } $postData["list_rows"] = 100; // 获取列表数据 $list = $model->alias("s") ->with(['logo', 'supplier']) ->join('good_store goodstore', 'goodstore.store_id=s.store_id') ->join('supplier supplier', 's.shop_supplier_id = supplier.shop_supplier_id', 'left') ->where('s.is_delete', '=', 0) ->where('s.status', '=', 1) ->where('s.is_good', '=', 1) ->where('supplier.is_delete', '=', 0) ->order('goodstore.store_sort asc') ->paginate($postData); return $list; } }