|
@@ -83,15 +83,15 @@ class SpuDao extends BaseDao
|
|
|
->when(isset($where['product_ids']) && $where['product_ids'] !== '',function($query)use($where){
|
|
->when(isset($where['product_ids']) && $where['product_ids'] !== '',function($query)use($where){
|
|
|
$query->whereIn('P.product_id',$where['product_ids']);
|
|
$query->whereIn('P.product_id',$where['product_ids']);
|
|
|
})
|
|
})
|
|
|
- ->when(isset($where['type']), function($query) use($where) {
|
|
|
|
|
- if ($where['type'] === '') {
|
|
|
|
|
|
|
+// ->when(isset($where['type']), function($query) use($where) {
|
|
|
|
|
+// if ($where['type'] === '') {
|
|
|
// $query->whereIn('P.type', [0,1,2,3,4]);
|
|
// $query->whereIn('P.type', [0,1,2,3,4]);
|
|
|
- } else {
|
|
|
|
|
- $query->where('P.type', (int)$where['type']);
|
|
|
|
|
- }
|
|
|
|
|
- }, function($query) {
|
|
|
|
|
|
|
+// } else {
|
|
|
|
|
+// $query->where('P.type', (int)$where['type']);
|
|
|
|
|
+// }
|
|
|
|
|
+// }, function($query) {
|
|
|
// $query->whereIn('P.type', [0,1,2,3,4]);
|
|
// $query->whereIn('P.type', [0,1,2,3,4]);
|
|
|
- })
|
|
|
|
|
|
|
+// })
|
|
|
->when(isset($where['keyword']) && $where['keyword'] !== '',function($query)use($where){
|
|
->when(isset($where['keyword']) && $where['keyword'] !== '',function($query)use($where){
|
|
|
if (is_numeric($where['keyword'])) {
|
|
if (is_numeric($where['keyword'])) {
|
|
|
$query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%");
|
|
$query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%");
|