|
|
@@ -61,6 +61,15 @@ class CouponRulesLists extends BaseAdminDataLists implements ListsSearchInterfac
|
|
|
if(isset($this->params['min_voucher_count']) && is_numeric($this->params['min_voucher_count'])){
|
|
|
$where[] = ['voucher_count', '>=', $this->params['min_voucher_count']];
|
|
|
}
|
|
|
+ if (isset($this->params['labels']) && !empty($this->params['labels'])) {
|
|
|
+ $sqls = [];
|
|
|
+ foreach ($this->params['labels'] as $item) {
|
|
|
+ $sqls[] = "FIND_IN_SET({$item}, labels) > 0";
|
|
|
+ }
|
|
|
+ $query_sql = implode(' OR ', $sqls);
|
|
|
+ $period_ids = CouponRules::where('labels','<>', '')->whereRaw($query_sql)->column('id');
|
|
|
+ $where[] = [ 'id','IN',$period_ids?:[0]];
|
|
|
+ }
|
|
|
if(isset($this->params['max_voucher_count']) && is_numeric($this->params['max_voucher_count'])){
|
|
|
$where[] = ['voucher_count', '<=', $this->params['max_voucher_count']];
|
|
|
}
|
|
|
@@ -107,7 +116,6 @@ class CouponRulesLists extends BaseAdminDataLists implements ListsSearchInterfac
|
|
|
$query->field('id,goods_name');
|
|
|
}])->where($this->searchWhere)
|
|
|
->where($this->queryWhere())
|
|
|
- ->field(['id','code', 'amount', 'coupon_target', 'coupon_type','amount_require', 'discount_ratio', 'event_name', 'expire_time', 'max_deductible_price', 'mold_type', 'server_category_name', 'voucher_status', 'voucher_count','remaining_count','property_activity_id'])
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->order(['id' => 'desc'])
|
|
|
->select()
|