OrderExpress.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 模型
  6. */
  7. class OrderExpress extends Model
  8. {
  9. protected $name = 'shop_order_express';
  10. protected $type = [
  11. 'ext' => 'json'
  12. ];
  13. // 追加属性
  14. protected $append = [
  15. 'status_text'
  16. ];
  17. public function statusList()
  18. {
  19. return [
  20. 'noinfo' => '暂无信息',
  21. 'collect' => '已揽件',
  22. 'transport' => '运输中',
  23. 'delivery' => '派送中',
  24. 'signfor' => '已签收',
  25. 'refuse' => '用户拒收',
  26. 'difficulty' => '问题件',
  27. 'invalid' => '无效件',
  28. 'timeout' => '超时单',
  29. 'fail' => '签收失败',
  30. 'back' => '退回',
  31. ];
  32. }
  33. public function items()
  34. {
  35. return $this->hasMany(OrderGoods::class, 'order_express_id', 'id');
  36. }
  37. public function logs()
  38. {
  39. return $this->hasMany(OrderExpressLog::class, 'order_express_id', 'id')->order('id', 'desc');
  40. }
  41. }