OwnerFeeDetail.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. ];
  29. public $timestamps = false;
  30. public function owner()
  31. { //货主
  32. return $this->hasOne(Owner::class,"id","owner_id");
  33. }
  34. public function shop()
  35. { //店铺
  36. return $this->hasOne(Shop::class,"id","shop_id");
  37. }
  38. public function logistic()
  39. { //物流
  40. return $this->hasOne(Logistic::class,"id","logistic_id");
  41. }
  42. public function processMethod()
  43. { //作业类型
  44. return $this->hasOne(ProcessMethod::class,"id","process_method_id");
  45. }
  46. }