更新查询条件
This commit is contained in:
parent
9522cece8b
commit
b3565d0a76
@ -151,6 +151,9 @@ class ProductDao extends BaseDao
|
||||
});
|
||||
}
|
||||
})
|
||||
->when(isset($where['keyword']) && $where['keyword'] !== '', function ($query) use ($where) {
|
||||
$query->whereLike('Product.keyword', "%{$where['keyword']}%");
|
||||
})
|
||||
->when(isset($where['mer_labels']) && $where['mer_labels'] !== '', function ($query) use ($where) {
|
||||
$query->whereLike('U.mer_labels', "%,{$where['mer_labels']},%");
|
||||
})
|
||||
|
@ -2447,6 +2447,9 @@ class ProductRepository extends BaseRepository
|
||||
unset($where['uid']);
|
||||
$where['status'] = 1;
|
||||
$where['is_show'] = 1;
|
||||
if (!empty($keyword)) {
|
||||
$where['keyword'] = $keyword;
|
||||
}
|
||||
$query = $this->dao->search($merId, $where)->with(['merCateId.category', 'storeCategory', 'brand', 'attrValue']);
|
||||
$count = $query->count();
|
||||
$data = $query->page($page, $limit)->setOption('field', [])->field($this->filed)->select();
|
||||
|
Loading…
x
Reference in New Issue
Block a user