DeliveryAppointmentCar.php 791 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. ];
  18. const STATUS = [
  19. 0 => "未送达",
  20. 1 => "作业中",
  21. 2 => "已完成",
  22. ];
  23. public $timestamps=false;
  24. public function deliveryAppointment()
  25. { //预约信息
  26. return $this->belongsTo(DeliveryAppointment::class);
  27. }
  28. public function car()
  29. { //车辆
  30. return $this->belongsTo(CarType::class,"car_id","id");
  31. }
  32. }