|
@@ -245,8 +245,10 @@ class StoreProductDao extends BaseDao
|
|
|
$query->where('price', $where['use_min_price'][0] ?? '=', $where['use_min_price'][1] ?? 0);
|
|
|
}
|
|
|
})->when(isset($where['award']) && $where['award'] >= 0, function ($query) use ($where) {
|
|
|
- if ($where['award']) $query->where('award_price', '>', 0);
|
|
|
- if (!$where['award']) $query->where('award_price', 0);
|
|
|
+ if ($where['award'])
|
|
|
+ $query->where('award_price', '>', 0);
|
|
|
+ else
|
|
|
+ $query->where('award_price', 0);
|
|
|
})->when(!$page && $limit, function ($query) use ($limit) {
|
|
|
$query->limit($limit);
|
|
|
})->field($field)->select()->toArray();
|