WaybillFinancialExceptedController.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\WaybillPriceModel;
  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('created_at_start')){
  16. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','>',$request->input('created_at_start'));
  17. }
  18. if ($request->input('created_at_end')){
  19. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','<',$request->input('created_at_end'));
  20. }
  21. $waybillFinancialSnapshots=$waybillFinancialSnapshots->paginate(50);
  22. return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'','excepted'=>true]);
  23. }
  24. public function indexZF(Request $request)
  25. {
  26. if(!Gate::allows('财务报表-查询')){ return redirect(url('/')); }
  27. $waybillFinancialSnapshots=WaybillFinancialExcepted::orderBy('id', 'DESC')->where('json_content','like','%直发车%');
  28. if ($request->input('created_at_start')){
  29. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','>',$request->input('created_at_start'));
  30. }
  31. if ($request->input('created_at_end')){
  32. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','<',$request->input('created_at_end'));
  33. }
  34. $waybillFinancialSnapshots=$waybillFinancialSnapshots->paginate(50);
  35. return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'ZF','excepted'=>true]);
  36. }
  37. public function indexZX(Request $request)
  38. {
  39. if(!Gate::allows('财务报表-查询')){ return redirect(url('/')); }
  40. $waybillFinancialSnapshots=WaybillFinancialExcepted::orderBy('id', 'DESC')->where('json_content','like','%专线%');
  41. if ($request->input('created_at_start')){
  42. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','>',$request->input('created_at_start'));
  43. }
  44. if ($request->input('created_at_end')){
  45. $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('created_at','<',$request->input('created_at_end'));
  46. }
  47. $waybillFinancialSnapshots=$waybillFinancialSnapshots->paginate(50);
  48. return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'ZX','excepted'=>true]);
  49. }
  50. }