|
@@ -15,6 +15,7 @@ use App\Services\UnitService;
|
|
|
use App\Services\WaybillPayoffService;
|
|
use App\Services\WaybillPayoffService;
|
|
|
use App\Services\WaybillPriceModelService;
|
|
use App\Services\WaybillPriceModelService;
|
|
|
use App\Services\WaybillService;
|
|
use App\Services\WaybillService;
|
|
|
|
|
+use App\Traits\ModelLogChanging;
|
|
|
use App\UploadFile;
|
|
use App\UploadFile;
|
|
|
use App\WaybillAuditLog;
|
|
use App\WaybillAuditLog;
|
|
|
use App\WaybillOnTop;
|
|
use App\WaybillOnTop;
|
|
@@ -831,10 +832,16 @@ SQL;
|
|
|
if (count($errors)>0)return ["errors"=>$errors];
|
|
if (count($errors)>0)return ["errors"=>$errors];
|
|
|
$waybill=Waybill::query()->find($request->input('id'));
|
|
$waybill=Waybill::query()->find($request->input('id'));
|
|
|
if (!$waybill)return ["error"=>"未找到该运单!"];
|
|
if (!$waybill)return ["error"=>"未找到该运单!"];
|
|
|
- $request->offsetSet("carrier_weight_unit_id",$unit2);
|
|
|
|
|
- $request->offsetSet("carrier_weight_unit_id_other",$unit);
|
|
|
|
|
- $request->offsetSet("amount_unit_id",$unit1);
|
|
|
|
|
|
|
+ $request->offsetSet("carrier_weight_unit_id",$unit2->id);
|
|
|
|
|
+ $request->offsetSet("carrier_weight_unit_id_other",$unit->id);
|
|
|
|
|
+ $request->offsetSet("amount_unit_id",$unit1->id);
|
|
|
|
|
+ $request->offsetSet("status","待终审");
|
|
|
$waybill->fill($request->input());
|
|
$waybill->fill($request->input());
|
|
|
|
|
+ WaybillAuditLog::query()->create([
|
|
|
|
|
+ 'waybill_id'=>$waybill->id,
|
|
|
|
|
+ 'audit_stage'=>'调度阶段',
|
|
|
|
|
+ 'user_id'=>Auth::id(),
|
|
|
|
|
+ ]);
|
|
|
$waybill->update();
|
|
$waybill->update();
|
|
|
return $waybill;
|
|
return $waybill;
|
|
|
}
|
|
}
|
|
@@ -1114,8 +1121,7 @@ SQL;
|
|
|
|| $waybills[$i]->order->consignee_phone!=$waybill->order->consignee_phone
|
|
|| $waybills[$i]->order->consignee_phone!=$waybill->order->consignee_phone
|
|
|
|| $waybills[$i]->order->address!=$waybill->order->address)) ||
|
|
|| $waybills[$i]->order->address!=$waybill->order->address)) ||
|
|
|
(!$waybill->order && ($waybills[$i]->recipient!=$waybill->recipient
|
|
(!$waybill->order && ($waybills[$i]->recipient!=$waybill->recipient
|
|
|
- || $waybills[$i]->recipient_mobile!=$waybill->recipient_mobile
|
|
|
|
|
- || $waybills[$i]->destination!=$waybill->destination));
|
|
|
|
|
|
|
+ || $waybills[$i]->recipient_mobile!=$waybill->recipient_mobile));
|
|
|
if (array_search($waybills[$i]->status,["未审核","已审核"])===false
|
|
if (array_search($waybills[$i]->status,["未审核","已审核"])===false
|
|
|
|| $identical)$this->error("信息不一致,无法进行合并");
|
|
|| $identical)$this->error("信息不一致,无法进行合并");
|
|
|
$destroys[] = $waybills[$i]->id;
|
|
$destroys[] = $waybills[$i]->id;
|
|
@@ -1268,8 +1274,7 @@ SQL;
|
|
|
|| $item->order->consignee_phone!=$waybill->order->consignee_phone
|
|
|| $item->order->consignee_phone!=$waybill->order->consignee_phone
|
|
|
|| $item->order->address!=$waybill->order->address)) ||
|
|
|| $item->order->address!=$waybill->order->address)) ||
|
|
|
(!$waybill->order && ($item->recipient!=$waybill->recipient
|
|
(!$waybill->order && ($item->recipient!=$waybill->recipient
|
|
|
- || $item->recipient_mobile!=$waybill->recipient_mobile
|
|
|
|
|
- || $item->destination!=$waybill->destination));
|
|
|
|
|
|
|
+ || $item->recipient_mobile!=$waybill->recipient_mobile));
|
|
|
if ($identical)$this->error("订单信息不一致,无法统一发货");
|
|
if ($identical)$this->error("订单信息不一致,无法统一发货");
|
|
|
$destroys[] = $item->id;
|
|
$destroys[] = $item->id;
|
|
|
$waybill->source_bill .= $item->source_bill ? ",".$item->source_bill : '';
|
|
$waybill->source_bill .= $item->source_bill ? ",".$item->source_bill : '';
|
|
@@ -1286,6 +1291,7 @@ SQL;
|
|
|
$owner = array_unique($owner);
|
|
$owner = array_unique($owner);
|
|
|
if (count($owner)>1)$waybill->merge_owner = implode(',',$owner);
|
|
if (count($owner)>1)$waybill->merge_owner = implode(',',$owner);
|
|
|
$waybill->deliver_at = date("Y-m-d H:i:s");
|
|
$waybill->deliver_at = date("Y-m-d H:i:s");
|
|
|
|
|
+ $waybill->logistic_id = \request("logistic");
|
|
|
if ($waybill->status=='未审核')$waybill->status = '已审核';
|
|
if ($waybill->status=='未审核')$waybill->status = '已审核';
|
|
|
$waybill->update();
|
|
$waybill->update();
|
|
|
Waybill::destroy($destroys);
|
|
Waybill::destroy($destroys);
|