芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/app/Http/Controllers/Admin/CustomerLoyaltyController.php
when(($request->from && $request->to),function($query)use($request){ $query->whereBetween('created_at', [$request->from.' 00:00:00', $request->to.' 23:59:59']); }) ->when($request->transaction_type, function($query)use($request){ $query->where('transaction_type',$request->transaction_type); }) ->when($request->customer_id, function($query)use($request){ $query->where('user_id',$request->customer_id); }) ->get(); $transactions = LoyaltyPointTransaction:: when(($request->from && $request->to),function($query)use($request){ $query->whereBetween('created_at', [$request->from.' 00:00:00', $request->to.' 23:59:59']); }) ->when($request->transaction_type, function($query)use($request){ $query->where('transaction_type',$request->transaction_type); }) ->when($request->customer_id, function($query)use($request){ $query->where('user_id',$request->customer_id); }) ->latest() ->paginate(Helpers::pagination_limit()); return view('admin-views.customer.loyalty.report', compact('data','transactions')); } }