hasOne(Unit::class,"id","unit_id"); } public function otherUnit() { //单位二 return $this->hasOne(Unit::class,"id","other_unit_id"); } public function owners() { //货主 return $this->belongsToMany(Owner::class,"owner_price_logistic_owner","owner_price_logistic_id","owner_id"); } public function logistics() { //物流 return $this->belongsToMany(Logistic::class,"owner_price_logistic_logistic","owner_price_logistic_id","logistic_id"); } }