diff --git a/app/Merchant/Controllers/Coupon/IndexController.php b/app/Merchant/Controllers/Coupon/IndexController.php index d11803c..0466f95 100644 --- a/app/Merchant/Controllers/Coupon/IndexController.php +++ b/app/Merchant/Controllers/Coupon/IndexController.php @@ -35,6 +35,8 @@ class IndexController extends Controller $end = $request->end; $thirdPartyGoodsId = $request->thirdPartyGoodsId; $pa_order_id = $request->pa_order_id; + $type = $request->type; + $this->query = Coupon::where('user_id', $user->id) ->when($outlet, function ($q) use ($outlet) { @@ -47,6 +49,9 @@ class IndexController extends Controller ->when($redemptionCode, function ($q) use ($redemptionCode) { $q->where('redemptionCode', $redemptionCode); }) + ->when($type == 'pingan', function ($q) { + $q->where('type', 1); + }) ->when($thirdPartyGoodsId, function ($q) use ($thirdPartyGoodsId) { $q->where('thirdPartyGoodsId', $thirdPartyGoodsId); }) @@ -54,12 +59,7 @@ class IndexController extends Controller $q->where('pa_order_id', $pa_order_id); }) ->when(is_numeric($status), function ($query) use ($status) { - if ($status == 4) { - $query->where('is_profit', 1); - } else { - $query->where('status', $status); - } - + $query->where('status', $status); }, function ($query) { $query->whereIn('status', [2, 3]); }) diff --git a/app/Merchant/Resources/views/coupon/index.blade.php b/app/Merchant/Resources/views/coupon/index.blade.php index 91b153f..ba87cb5 100644 --- a/app/Merchant/Resources/views/coupon/index.blade.php +++ b/app/Merchant/Resources/views/coupon/index.blade.php @@ -44,6 +44,7 @@ +
@@ -57,6 +58,16 @@ {{-- --}}
+ +
+ +
+