|
@@ -593,7 +593,7 @@ class CustomerDepositController extends Controller
|
593
|
593
|
*/
|
594
|
594
|
public function monthGiftList(Request $request) {
|
595
|
595
|
$page = $request->input('page',1);
|
596
|
|
- $type = $request->input('type');
|
|
596
|
+ $type = $request->input('type','-1');
|
597
|
597
|
$pageSize = 20;
|
598
|
598
|
if($page<=0){
|
599
|
599
|
$page = 1;
|
|
@@ -601,7 +601,7 @@ class CustomerDepositController extends Controller
|
601
|
601
|
|
602
|
602
|
$offset = ($page-1) * $pageSize;
|
603
|
603
|
$count = CustomerMonthGift::where(function($query) use ($type) {
|
604
|
|
- if($type && ($type != '-1')) $query->where('type',$type);
|
|
604
|
+ if($type != '-1') $query->where('type',$type);
|
605
|
605
|
})->count();
|
606
|
606
|
if ($count > 1) {
|
607
|
607
|
// 总页数
|
|
@@ -611,7 +611,7 @@ class CustomerDepositController extends Controller
|
611
|
611
|
$pages = 1;
|
612
|
612
|
}
|
613
|
613
|
$result = CustomerMonthGift::where(function($query) use ($type) {
|
614
|
|
- if($type && ($type != '-1')) $query->where('type',$type);
|
|
614
|
+ if($type != '-1') $query->where('type',$type);
|
615
|
615
|
})->orderBy('id','desc')->offset($offset)->limit($pageSize)->get();
|
616
|
616
|
$result = json_decode(json_encode($result),true);
|
617
|
617
|
$result = array_map(function($value){
|