增加类型筛选
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}, function ($query) {
|
||||
$query->whereIn('status', [2, 3]);
|
||||
})
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<input type="text" placeholder="平安券编号" name="redemptionCode"
|
||||
class="input-sm form-control" value="{{ Request::input('redemptionCode') }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" placeholder="平安主订单号" name="pa_order_id"
|
||||
class="input-sm form-control" value="{{ Request::input('pa_order_id') }}">
|
||||
@@ -57,6 +58,16 @@
|
||||
{{-- <option value="4" @if(request()->status==4) selected="" @endif >已分润</option> --}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control m-b" name="type">
|
||||
<option value="">类型</option>
|
||||
<option value="all" @if(request()->type=='all') selected="" @endif >全部</option>
|
||||
<option value="pingan" @if(request()->type=='pingan') selected="" @endif >平安
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control m-b" name="thirdPartyGoodsId">
|
||||
<option value="">政策</option>
|
||||
|
||||
Reference in New Issue
Block a user