|
|
@@ -566,7 +566,7 @@ html;
|
|
|
$this->gate("入库管理-入库预约-预约管理-卸货完成");
|
|
|
if (!request("id"))$this->error("非法参数");
|
|
|
/** @var DeliveryAppointmentCar|\stdClass $car */
|
|
|
- $car = DeliveryAppointmentCar::query()->find(request("id"));
|
|
|
+ $car = DeliveryAppointmentCar::query()->where("status",1)->find(request("id"));
|
|
|
if (!$car || !$car->deliveryAppointment)$this->error("单据不存在");
|
|
|
$car->update(["status"=>2]);
|
|
|
app("DeliveryAppointmentService")->checkFull($car->delivery_appointment_id);
|
|
|
@@ -582,9 +582,11 @@ html;
|
|
|
$this->gate("入库管理-入库预约-预约管理-签到");
|
|
|
if (!request("id"))$this->error("非法参数");
|
|
|
/** @var DeliveryAppointmentCar|\stdClass $car */
|
|
|
- $car = DeliveryAppointmentCar::query()->find(request("id"));
|
|
|
+ $car = DeliveryAppointmentCar::query()->whereHas("deliveryAppointment",function (Builder $query){
|
|
|
+ $query->where("appointment_date",date("Y-m-d"));
|
|
|
+ })->find(request("id"));
|
|
|
if (!$car || !$car->deliveryAppointment)$this->error("单据不存在");
|
|
|
- $car->update(["status"=>1]);
|
|
|
+ $car->update(["status"=>1,"delivery_time"=>date("Y-m-d H:i:s")]);
|
|
|
event(new DeliveryAppointmentEvent($car));
|
|
|
$this->success();
|
|
|
}
|