|
|
@@ -33,7 +33,7 @@ class WaybillService
|
|
|
$ownerIds = explode(",",$param["owner_id"]);
|
|
|
$waybills->where(function ($query)use($ownerIds){
|
|
|
/** @var Builder $query */
|
|
|
- $query->whereIn("owner_id",$ownerIds)->orWhereHas("order",function ($query)use($ownerIds){
|
|
|
+ $query->whereIn("waybills.owner_id",$ownerIds)->orWhereHas("order",function ($query)use($ownerIds){
|
|
|
/** @var Builder $query */
|
|
|
$query->whereIn("owner_id",$ownerIds);
|
|
|
});
|
|
|
@@ -44,7 +44,7 @@ class WaybillService
|
|
|
$destination = $param["destination"];
|
|
|
$waybills->where(function ($query)use($destination){
|
|
|
/** @var Builder $query */
|
|
|
- $query->where("destination","like",$destination."%")->orWhereHas("order",function ($query)use($destination){
|
|
|
+ $query->where("waybills.destination","like",$destination."%")->orWhereHas("order",function ($query)use($destination){
|
|
|
/** @var Builder $query */
|
|
|
$query->where("address",'like',$destination."%");
|
|
|
});
|
|
|
@@ -55,7 +55,7 @@ class WaybillService
|
|
|
$recipient = $param["recipient"];
|
|
|
$waybills->where(function ($query)use($recipient){
|
|
|
/** @var Builder $query */
|
|
|
- $query->where("recipient","like",$recipient."%")->orWhereHas("order",function ($query)use($recipient){
|
|
|
+ $query->where("waybills.recipient","like",$recipient."%")->orWhereHas("order",function ($query)use($recipient){
|
|
|
/** @var Builder $query */
|
|
|
$query->where("consignee_name",'like',$recipient."%");
|
|
|
});
|
|
|
@@ -66,24 +66,13 @@ class WaybillService
|
|
|
$recipientMobile = $param["recipient_mobile"];
|
|
|
$waybills->where(function ($query)use($recipientMobile){
|
|
|
/** @var Builder $query */
|
|
|
- $query->where("recipient_mobile","like",$recipientMobile."%")->orWhereHas("order",function ($query)use($recipientMobile){
|
|
|
+ $query->where("waybills.recipient_mobile","like",$recipientMobile."%")->orWhereHas("order",function ($query)use($recipientMobile){
|
|
|
/** @var Builder $query */
|
|
|
$query->where("consignee_phone",'like',$recipientMobile."%");
|
|
|
});
|
|
|
});
|
|
|
unset($param["recipient_mobile"]);
|
|
|
}
|
|
|
- if ($param["logistic_id"] ?? false){
|
|
|
- $logisticId = $param["logistic_id"];
|
|
|
- $waybills->where(function ($query)use($logisticId){
|
|
|
- /** @var Builder $query */
|
|
|
- $query->where("logistic_id",$logisticId)->orWhereHas("order",function ($query)use($logisticId){
|
|
|
- /** @var Builder $query */
|
|
|
- $query->where("logistic_id",$logisticId);
|
|
|
- });
|
|
|
- });
|
|
|
- unset($param["logistic_id"]);
|
|
|
- }
|
|
|
$columnQueryRules=[
|
|
|
'waybill_number' => ['like' => ''],
|
|
|
'carrier_bill' => ['like' => ''],
|