| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- class DeliveryAppointment extends Model
- {
- use ModelLogChanging;
- protected $fillable=[
- "user_id",
- "owner_id",
- "procurement_number",
- "asn_number",
- "warehouse_id",
- "tonne",
- "cubic_meter",
- "box_amount",
- "capacity",
- "appointment_date",
- "date_period",
- "status",
- ];
- public function cars()
- { //车辆
- return $this->hasMany(DeliveryAppointmentCar::class,"delivery_appointment_id","id");
- }
- public function details()
- { //明细
- return $this->hasMany(DeliveryAppointmentDetail::class);
- }
- public function user()
- { //用户
- return $this->belongsTo(User::class);
- }
- public function owner()
- { //货主
- return $this->belongsTo(Owner::class);
- }
- public function warehouse()
- { //仓库
- return $this->belongsTo(Warehouse::class);
- }
- }
|