hasOne(Owner::class,"id","owner_id"); } public function userOwnerGroup() { //项目组 return $this->hasOne(UserOwnerGroup::class,"id","user_owner_group_id"); } public function ownerStoragePriceModel() { //仓储计费 return $this->hasOne(OwnerStoragePriceModel::class,"id","owner_storage_price_model_id"); } /* 结算月格式转换,仅截取至月 * 引用:CreateOwnerReport */ public function getCountingMonthAttribute($value) { return substr($value,0,7); } }