DeliveryAppointmentCar.php 814 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. class DeliveryAppointmentCar extends Model
  6. {
  7. use ModelLogChanging;
  8. protected $fillable=[
  9. "delivery_appointment_id",
  10. "license_plate_number",
  11. "car_id",
  12. "driver_name",
  13. "driver_phone",
  14. "appointment_number",
  15. "delivery_time",
  16. "status",
  17. "unloaded_at",
  18. ];
  19. const STATUS = [
  20. 0 => "未送达",
  21. 1 => "作业中",
  22. 2 => "已完成",
  23. ];
  24. public $timestamps=false;
  25. public function deliveryAppointment()
  26. { //预约信息
  27. return $this->belongsTo(DeliveryAppointment::class);
  28. }
  29. public function car()
  30. { //车辆
  31. return $this->belongsTo(CarType::class,"car_id","id");
  32. }
  33. }