diff --git a/app/controller/admin/system/financial/Subsidy.php b/app/controller/admin/system/financial/Subsidy.php index ecf76507..bd1bb58a 100644 --- a/app/controller/admin/system/financial/Subsidy.php +++ b/app/controller/admin/system/financial/Subsidy.php @@ -29,6 +29,7 @@ class Subsidy extends BaseController }]) ->where('status', StoreCouponDetail::STATUS_INVALID) ->where('type', StoreCouponDetail::TYPE_INCOME); + $couponIds = StoreCoupon::whereIn('type', [StoreCouponRepository::TYPE_STORE_COUPON, StoreCouponRepository::TYPE_SALE_SUBSIDY])->column('coupon_id'); if (!empty($type)) { if ($type == 1) { $couponWhere = ['type' => StoreCouponRepository::TYPE_STORE_COUPON]; @@ -37,6 +38,8 @@ class Subsidy extends BaseController } $couponId = StoreCoupon::where($couponWhere)->value('coupon_id'); $query->where('coupon_id', $couponId); + } else { + $query->whereIn('coupon_id', $couponIds); } if ($status !== '') { $query->where('send_status', $status);