| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class OwnerStoreFeeDetail extends Model
- {
- use ModelLogChanging;
- public $fillable = [
- 'owner_fee_detail_id',
- 'unit_id',
- 'unit_price', //单价
- 'amount', //数量
- 'owner_id', //货主
- 'fee',//费用
- 'commodity_id',
- 'packing_material_fee',//包材费
- 'tax_fee',//税费
- 'sku',//sku
- 'barcode',//条码
- 'work_name',//作业名称
- 'asn_code',//asn号
- ];
- public function ownerFeeDetail(): BelongsTo
- {
- return $this->belongsTo(OwnerFeeDetail::class);
- }
- public function unit(): BelongsTo
- {
- return $this->belongsTo(Unit::class);
- }
- public function getPriceAttribute(): string
- {
- return $this->unit_price . '/' . $this->unit->name;
- }
- public function owner(): BelongsTo
- {
- return $this->belongsTo(Owner::class);
- }
- public function commodity(): BelongsTo
- {
- return $this->belongsTo(Commodity::class);
- }
- }
|