Zhouzhendong 5 年 前
コミット
c5cdf315a3
1 ファイル変更2 行追加2 行削除
  1. 2 2
      app/Events/DeliveryAppointmentEvent.php

+ 2 - 2
app/Events/DeliveryAppointmentEvent.php

@@ -29,8 +29,8 @@ class DeliveryAppointmentEvent implements ShouldBroadcast
         }]);
         $count = $delivery->deliveryAppointment->cars_count ?? 0;
         $delivery->warehouse = $delivery->deliveryAppointment->warehouse_id ?? "";
-        $delivery->cubic_meter = isset($delivery->deliveryAppointment->cubic_meter) ? ($count>1 ? $delivery->deliveryAppointment->cubic_meter."/".$count : $delivery->deliveryAppointment->cubic_meter) : "";
-        $delivery->tonne = isset($delivery->deliveryAppointment->tonne) ? ($count>1 ? $delivery->deliveryAppointment->tonne."/".$count : $delivery->deliveryAppointment->tonne) : "";
+        $delivery->cubic_meter = isset($delivery->deliveryAppointment->cubic_meter) && $delivery->deliveryAppointment->cubic_meter>0 ? ($count>1 ? $delivery->deliveryAppointment->cubic_meter."/".$count : $delivery->deliveryAppointment->cubic_meter) : "";
+        $delivery->tonne = isset($delivery->deliveryAppointment->tonne) && $delivery->deliveryAppointment->tonne>0 ? ($count>1 ? $delivery->deliveryAppointment->tonne."/".$count : $delivery->deliveryAppointment->tonne) : "";
         $this->delivery = $delivery->withoutRelations();
     }