OwnerFeeDetail.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. "province", //省份
  31. ];
  32. public $timestamps = false;
  33. public function owner()
  34. { //货主
  35. return $this->hasOne(Owner::class,"id","owner_id");
  36. }
  37. public function shop()
  38. { //店铺
  39. return $this->hasOne(Shop::class,"id","shop_id");
  40. }
  41. public function logistic()
  42. { //物流
  43. return $this->hasOne(Logistic::class,"id","logistic_id");
  44. }
  45. public function processMethod()
  46. { //作业类型
  47. return $this->hasOne(ProcessMethod::class,"id","process_method_id");
  48. }
  49. public function order()
  50. { //出库单
  51. return $this->belongsTo(Order::class,"outer_id","id");
  52. }
  53. public function items()
  54. { //快递费子项
  55. return $this->hasMany(OwnerFeeDetailLogistic::class,"owner_fee_detail_id","id");
  56. }
  57. }