| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class OwnerLogisticFeeReport extends Model
- {
- use ModelLogChanging;
- public $fillable = [
- 'owner_logistic_sum_fee_report_id',//
- 'logistic_id',//承运商
- 'province_id', //省份
- 'counted_date',//统计月份
- 'initial_weight',//首重
- 'initial_weight_price',//首重价格
- 'initial_amount', //数量
- 'additional_weight', //续重
- 'additional_price', //续重价格
- 'additional_amount',//续重数量
- 'fee',//费用
- 'tax_fee',//税费
- 'owner_id'//货主
- ];
- protected $appends = [
- 'initial_weight_fee',
- 'additional_weight_fee'
- ];
- public $timestamps = false;
- public function logistic(): BelongsTo
- {
- return $this->belongsTo(Logistic::class);
- }
- public function province(): BelongsTo
- {
- return $this->belongsTo(Province::class);
- }
- public function getInitialWeightFeeAttribute(): string
- {
- return number_format($this->initial_weight * $this->initial_weight_price * $this->initial_amount, 2);
- }
- public function getAdditionalWeightFeeAttribute(): string
- {
- return number_format($this->additional_weight * $this->additional_price * $this->additional_amount, 2);
- }
- }
|