DeliveryAppointmentCar.php 732 B

12345678910111213141516171819202122232425262728293031323334353637
  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. "status",
  16. ];
  17. public $timestamps=false;
  18. const STATUS=[
  19. 0 => "待送",
  20. 1 => "已送"
  21. ];
  22. public function deliveryAppointment()
  23. { //预约信息
  24. return $this->belongsTo(DeliveryAppointment::class);
  25. }
  26. public function car()
  27. { //车辆
  28. return $this->belongsTo(CarType::class,"car_id","id");
  29. }
  30. }