| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class OwnerStoreFeeReport extends Model
- {
- use ModelLogChanging;
- public $fillable = [
- 'owner_bill_report_id',
- 'owner_id',
- 'counting_month', //统计月份
- 'unit_id', //单位
- 'unit_price', //单价
- 'amount', //数量
- 'fee',//费用
- 'work_name',//作业名称
- ];
- public $timestamps = false;
- public function ownerBillReport(): BelongsTo
- {
- return $this->belongsTo(OwnerBillReport::class);
- }
- public function owner(): BelongsTo
- {
- return $this->belongsTo(Owner::class);
- }
- public function unit(): BelongsTo
- {
- return $this->belongsTo(Unit::class);
- }
- public function getPriceAttribute(): string
- {
- return $this->unit_price . '/' . $this->unit->name;
- }
- }
|