| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- class OwnerBillReport extends Model
- {
- use ModelLogChanging;
- protected $fillable = [
- "owner_id", //项目ID
- "counting_month", //结算月
- "initial_fee", //原始账单金额
- "confirm_fee", //确认账单金额
- "difference", //差额
- "confirmed", //确认状态
- ];
- public $timestamps=false;
- public function owner()
- { //货主
- return $this->hasOne(Owner::class,"id","owner_id");
- }
- /* 结算月格式转换,仅截取至月
- * 引用:CreateOwnerReport
- */
- public function getCountingMonthAttribute($value)
- {
- return substr($value,0,7);
- }
- }
|