增加类型筛选
This commit is contained in:
@@ -35,6 +35,8 @@ class IndexController extends Controller
|
|||||||
$end = $request->end;
|
$end = $request->end;
|
||||||
$thirdPartyGoodsId = $request->thirdPartyGoodsId;
|
$thirdPartyGoodsId = $request->thirdPartyGoodsId;
|
||||||
$pa_order_id = $request->pa_order_id;
|
$pa_order_id = $request->pa_order_id;
|
||||||
|
$type = $request->type;
|
||||||
|
|
||||||
|
|
||||||
$this->query = Coupon::where('user_id', $user->id)
|
$this->query = Coupon::where('user_id', $user->id)
|
||||||
->when($outlet, function ($q) use ($outlet) {
|
->when($outlet, function ($q) use ($outlet) {
|
||||||
@@ -47,6 +49,9 @@ class IndexController extends Controller
|
|||||||
->when($redemptionCode, function ($q) use ($redemptionCode) {
|
->when($redemptionCode, function ($q) use ($redemptionCode) {
|
||||||
$q->where('redemptionCode', $redemptionCode);
|
$q->where('redemptionCode', $redemptionCode);
|
||||||
})
|
})
|
||||||
|
->when($type == 'pingan', function ($q) {
|
||||||
|
$q->where('type', 1);
|
||||||
|
})
|
||||||
->when($thirdPartyGoodsId, function ($q) use ($thirdPartyGoodsId) {
|
->when($thirdPartyGoodsId, function ($q) use ($thirdPartyGoodsId) {
|
||||||
$q->where('thirdPartyGoodsId', $thirdPartyGoodsId);
|
$q->where('thirdPartyGoodsId', $thirdPartyGoodsId);
|
||||||
})
|
})
|
||||||
@@ -54,12 +59,7 @@ class IndexController extends Controller
|
|||||||
$q->where('pa_order_id', $pa_order_id);
|
$q->where('pa_order_id', $pa_order_id);
|
||||||
})
|
})
|
||||||
->when(is_numeric($status), function ($query) use ($status) {
|
->when(is_numeric($status), function ($query) use ($status) {
|
||||||
if ($status == 4) {
|
$query->where('status', $status);
|
||||||
$query->where('is_profit', 1);
|
|
||||||
} else {
|
|
||||||
$query->where('status', $status);
|
|
||||||
}
|
|
||||||
|
|
||||||
}, function ($query) {
|
}, function ($query) {
|
||||||
$query->whereIn('status', [2, 3]);
|
$query->whereIn('status', [2, 3]);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
<input type="text" placeholder="平安券编号" name="redemptionCode"
|
<input type="text" placeholder="平安券编号" name="redemptionCode"
|
||||||
class="input-sm form-control" value="{{ Request::input('redemptionCode') }}">
|
class="input-sm form-control" value="{{ Request::input('redemptionCode') }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" placeholder="平安主订单号" name="pa_order_id"
|
<input type="text" placeholder="平安主订单号" name="pa_order_id"
|
||||||
class="input-sm form-control" value="{{ Request::input('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> --}}
|
{{-- <option value="4" @if(request()->status==4) selected="" @endif >已分润</option> --}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</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">
|
<div class="form-group">
|
||||||
<select class="form-control m-b" name="thirdPartyGoodsId">
|
<select class="form-control m-b" name="thirdPartyGoodsId">
|
||||||
<option value="">政策</option>
|
<option value="">政策</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user