| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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',//作业名称
- 'model_id',//计费模型
- 'tax_fee',//税费
- ];
- 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;
- }
- public function model(): BelongsTo
- {
- return $this->belongsTo(OwnerPriceOperation::class, 'model_id', 'id');
- }
- }
|