|
|
@@ -125,9 +125,10 @@ class UserCouponLogic extends BaseLogic
|
|
|
public static function categoryCouponLists($params)
|
|
|
{
|
|
|
try{
|
|
|
- $data = CouponRules::with(['couponCategory'=>function ($query) use ($params) {
|
|
|
- $query->where('goods_category_id',$params['goods_category_id']);
|
|
|
- }])->where('remaining_count','>',0)
|
|
|
+ $coupon_ids = CouponCategory::where('goods_category_id',$params['goods_category_id'])->column('coupon_id');
|
|
|
+
|
|
|
+ $data = CouponRules::where('remaining_count','>',0)
|
|
|
+ ->whereIn('id',$coupon_ids)
|
|
|
->where('voucher_status',1)
|
|
|
->append(['discount_ratio_text'])
|
|
|
->order(['id' => 'desc'])
|