| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class OwnerStoreOutFeeDetail extends Model
- {
- use ModelLogChanging;
- public $fillable = [
- 'owner_fee_detail_id',//
- 'commodity_id',//
- 'owner_id',//
- 'source_bill', // 上游单号
- 'unit_price', //价格
- 'unit_id', //
- 'amount',//数量
- 'step',//阶梯
- 'price_remark',//价格描述
- 'tax_fee',//税费
- 'sku',//商家编码
- 'packingMaterialFee',//耗材费
- 'barcode',//商品条码
- 'work_name',//作业名称
- 'fee',//费用
- ];
- public function ownerFeeDetail(): BelongsTo
- {
- return $this->belongsTo(OwnerFeeDetail::class);
- }
- public function commodity(): BelongsTo
- {
- return $this->belongsTo(Commodity::class);
- }
- public function owner(): BelongsTo
- {
- return $this->belongsTo(Owner::class);
- }
- public function unit(): BelongsTo
- {
- return $this->belongsTo(Unit::class);
- }
- /**
- * 根据参数条件删除
- * @param $data
- */
- public static function uDelete($data)
- {
- self::query()
- ->where('owner_fee_detail_id',$data['owner_fee_detail_id'])
- ->where('commodity_id',$data['commodity_id'])
- ->where('owner_id',$data['owner_id'])
- ->where('source_bill',$data['source_bill'])
- ->where('unit_id',$data['unit_id'])
- ->where('sku',$data['sku'])
- ->where('barcode',$data['barcode'])
- ->where('work_name',$data['work_name'])
- ->delete();
- }
- }
|