|
|
|
@ -25,7 +25,12 @@ class SelectAgentProduct extends LazyRenderable |
|
|
|
$grid->disableBatchActions(); |
|
|
|
|
|
|
|
$grid->model()->where('stock', '>', 0) |
|
|
|
->where(['agent_id' => Admin::user()->id, 'status' => ProductStatus::ON_SALE]); |
|
|
|
->where(['agent_id' => Admin::user()->id, 'status' => ProductStatus::ON_SALE]) |
|
|
|
->whereDoesntHave('agentProductItem', function ($query) { |
|
|
|
return $query->whereHas('product', function ($query) { |
|
|
|
return $query->where('stock', '<=', 0)->orWhere('status', '<>', ProductStatus::ON_SALE); |
|
|
|
}); |
|
|
|
}); |
|
|
|
$grid->quickSearch(['title'])->placeholder('搜索产品名称'); |
|
|
|
|
|
|
|
$grid->column('id'); |
|
|
|
|