OwnerFeeDetail.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace App;
  3. use App\Services\ProcessMethodService;
  4. use Illuminate\Database\Eloquent\Model;
  5. use App\Traits\ModelLogChanging;
  6. class OwnerFeeDetail extends Model
  7. {
  8. // use ModelLogChanging;
  9. protected $fillable = [
  10. "owner_id", //货主ID
  11. "worked_at", //作业时间
  12. "type", //类型
  13. "shop_id", //店铺ID
  14. "operation_bill", //发/收/退/提货单号
  15. "consignee_name", //收件人
  16. "consignee_phone", //收件人电话
  17. "commodity_amount", //商品数量
  18. "logistic_bill", //快递单号
  19. "volume", //体积
  20. "weight", //重量
  21. "logistic_id", //物流ID
  22. "process_method_id",//加工类型ID
  23. "work_fee", //作业费
  24. "logistic_fee", //物流费
  25. "created_at", //创建时间
  26. "outer_id", //关联表ID
  27. "outer_table_name", //关联表名
  28. "work_tax_fee", //作业税费
  29. "logistic_tax_fee", //物流税费
  30. ];
  31. public $timestamps = false;
  32. public function owner()
  33. { //货主
  34. return $this->hasOne(Owner::class,"id","owner_id");
  35. }
  36. public function shop()
  37. { //店铺
  38. return $this->hasOne(Shop::class,"id","shop_id");
  39. }
  40. public function logistic()
  41. { //物流
  42. return $this->hasOne(Logistic::class,"id","logistic_id");
  43. }
  44. public function processMethod()
  45. { //作业类型
  46. return $this->hasOne(ProcessMethod::class,"id","process_method_id");
  47. }
  48. public function order()
  49. { //出库单
  50. return $this->belongsTo(Order::class,"outer_id","id");
  51. }
  52. public function items()
  53. { //快递费子项
  54. return $this->hasMany(OwnerFeeDetailLogistic::class,"owner_fee_detail_id","id");
  55. }
  56. }