hasOne(Owner::class,"id","owner_id"); } /* 结算月格式转换,仅截取至月 * 引用:CreateOwnerReport */ public function getCountingMonthAttribute($value) { return substr($value,0,7); } public function getInitialFeeAttribute() { //初始账单金额 return $this->work_fee + $this->logistic_fee + $this->storage_fee + $this->other_fee; } }