feat(StoreOrderCartInfoTwoLists): 添加根据店铺名称搜索商品功能
This commit is contained in:
parent
219c372ca8
commit
2742da2640
@ -23,6 +23,7 @@ use app\common\model\system_store\SystemStore;
|
||||
class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
public $ids;
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
@ -49,6 +50,16 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
if ($this->request->get('store_name')) {
|
||||
$store_name = $this->request->get('store_name');
|
||||
$ids = StoreProduct::where('store_name', 'like', '%' . $store_name . '%')->column('id');
|
||||
if ($ids) {
|
||||
$this->searchWhere[] = ['product_id', 'in', $ids];
|
||||
$this->ids = $ids;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
if ($this->request->get('start_time') == '') {
|
||||
$this->searchWhere[] = ['create_time', 'between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user