OwnerFeeDetail.php 1.4 KB

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