|
|
@@ -562,10 +562,39 @@ class WaybillsController extends Controller
|
|
|
return ['exception'=>'请勿重复审核!'];
|
|
|
}
|
|
|
|
|
|
- public function waybillExport($id){
|
|
|
+ public function waybillExport($id,Request $request){
|
|
|
+ if(!Gate::allows('运输管理-查询')){ return '没有权限'; }
|
|
|
if ($id==-1){
|
|
|
$id=[];
|
|
|
- $waybills = Waybill::select('id')->get();
|
|
|
+ $today=Carbon::now()->subDays(15);
|
|
|
+ ini_set('max_execution_time',2500);
|
|
|
+ ini_set('memory_limit','1526M');
|
|
|
+ $waybills=Waybill::select('id');
|
|
|
+ if ($request->input('waybill_number')){
|
|
|
+ $waybills =$waybills->where('waybill_number','like','%'.$request->input('waybill_number').'%')->where('created_at','>',$today->format('Y-m-d'));
|
|
|
+ }
|
|
|
+ if ($request->input('carrier_bill')){
|
|
|
+ $waybills=$waybills->where('carrier_bill','like','%'.$request->input('carrier_bill').'%')->where('created_at','>',$today->format('Y-m-d'));
|
|
|
+ }
|
|
|
+ if ($request->input('carrier_id')){
|
|
|
+ $waybills=$waybills->where('carrier_id','=',$request->input('carrier_id'));
|
|
|
+ }
|
|
|
+ if ($request->input('owner_id')){
|
|
|
+ $waybills=$waybills->where('owner_id','=',$request->input('owner_id'));
|
|
|
+ }
|
|
|
+ if ($request->input('wms_bill_number')){
|
|
|
+ $waybills=$waybills->where('wms_bill_number','like','$'.$request->input('wms_bill_number').'%')->where('created_at','>',$today->format('Y-m-d'));
|
|
|
+ }
|
|
|
+ if ($request->input('created_at_start')){
|
|
|
+ $waybills=$waybills->where('created_at','>',$request->input('created_at_start'));
|
|
|
+ }
|
|
|
+ if ($request->input('created_at_end')){
|
|
|
+ $waybills=$waybills->where('created_at','<',$request->input('created_at_end'));
|
|
|
+ }
|
|
|
+ if ($request->input('status')){
|
|
|
+ $waybills=$waybills->where('status',$request->input('status'));
|
|
|
+ }
|
|
|
+ $waybills=$waybills->get();
|
|
|
foreach ($waybills as $waybill){
|
|
|
array_push($id,$waybill->id);
|
|
|
}
|