| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- use Illuminate\Database\Eloquent\Relations\HasOne;
- class OwnerLogisticFeeDetail extends Model
- {
- use ModelLogChanging;
- public $fillable = [
- 'owner_fee_detail_id', //
- 'logistic_bill',//快递单号
- 'initial_weight',//首重
- 'initial_weight_price',//首重价格
- 'additional_weight',//续重
- 'additional_price',//续重价格
- 'logistic_id',//承运商
- 'owner_id',//货主
- 'additional_weigh_weight',//续重重量
- 'tax_fee',//税费
- 'fee'//费用
- ];
- public function ownerFeeDetail(): BelongsTo
- {
- return $this->belongsTo(OwnerFeeDetail::class);
- }
- public function ownerFeeDetailLogistic(): BelongsTo
- {
- return $this->belongsTo(OwnerFeeDetailLogistic::class, 'logistic_bill', 'logistic_bill');
- }
- public function logistic(): BelongsTo
- {
- return $this->belongsTo(Logistic::class);
- }
- /**
- * 根据参数条件删除
- * @param $data
- */
- public static function uDelete($data)
- {
- self::query()
- ->where('owner_fee_detail_id', $data['owner_fee_detail_id'])
- ->where('logistic_bill', $data['logistic_bill'])
- ->where('initial_weight', $data['initial_weight'])
- ->where('additional_weight', $data['additional_weight'])
- ->where('logistic_id', $data['logistic_id'])
- ->where('owner_id', $data['owner_id'])
- ->where('additional_weigh_weight', $data['additional_weigh_weight'])
- ->delete();
- }
- }
|