|
|
|
@ -13,7 +13,7 @@ class CategoryController extends Controller |
|
|
|
$list = Category::query() |
|
|
|
->where('agent_id', $this->agent_id) |
|
|
|
->orderBy('sort') |
|
|
|
->get(['id', 'name']); |
|
|
|
->get(['id', 'name', 'pid']); |
|
|
|
if ($list->isEmpty()) { //如果是新入驻商户,显示默认数据
|
|
|
|
if (AgentProduct::where('agent_id', $this->agent_id)->withTrashed()->count() === 0 && request('page', 1) <= 2) { //只获取2页数据
|
|
|
|
$list = AgentProduct::list($this->agent_id)->orWhere([['status', '=', ProductStatus::ON_SALE], ['price', '>', 500]])->orderBy('id')->simplePaginate(); |
|
|
|
|