WaybillFinancialExceptedController.php 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\BillingModel;
  4. use App\Events\WaybillPriceModelEvent;
  5. use App\WaybillFinancialExcepted;
  6. use Illuminate\Http\Request;
  7. use Illuminate\Support\Facades\Event;
  8. use Illuminate\Support\Facades\Gate;
  9. class WaybillFinancialExceptedController extends Controller
  10. {
  11. public function index(Request $request)
  12. {
  13. if(!Gate::allows('财务报表-查询')){ return redirect(url('/')); }
  14. $waybillFinancialSnapshots=WaybillFinancialExcepted::orderBy('id', 'DESC');
  15. if ($request->input('type')=='直发'){
  16. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('json_content','like','%直发%');
  17. }
  18. if($request->input('type')=='专线'){
  19. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('json_content','like','%专线%');
  20. }
  21. if ($request->input('created_at_start')){
  22. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','>',$request->input('created_at_start'));
  23. }
  24. if ($request->input('created_at_end')){
  25. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','<',$request->input('created_at_end'));
  26. }
  27. $waybillFinancialSnapshots=$waybillFinancialSnapshots->paginate(50);
  28. return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>$request->input('type'),'excepted'=>true]);
  29. }
  30. }