OrderRefund.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\common\model;
  13. /**
  14. * 售后单模型
  15. * Class OrderRefund
  16. * @package app\common\model\wxapp
  17. */
  18. class OrderRefund extends BaseModel
  19. {
  20. // 定义表名
  21. protected $name = 'order_refund';
  22. // 定义主键
  23. protected $pk = 'order_refund_id';
  24. /**
  25. * 关联用户表
  26. * @return \think\model\relation\BelongsTo
  27. */
  28. public function user()
  29. {
  30. return $this->belongsTo('User');
  31. }
  32. /**
  33. * 关联订单主表
  34. * @return \think\model\relation\BelongsTo
  35. */
  36. public function orderData()
  37. {
  38. return $this->belongsTo('Order');
  39. }
  40. /**
  41. * 关联订单商品表
  42. * @return \think\model\relation\BelongsTo
  43. */
  44. public function orderGoods()
  45. {
  46. return $this->belongsTo('OrderGoods')->withoutField(['content']);
  47. }
  48. /**
  49. * 关联图片记录表
  50. * @return \think\model\relation\HasMany
  51. */
  52. public function images()
  53. {
  54. return $this->hasMany('OrderRefundImage');
  55. }
  56. /**
  57. * 关联物流公司表
  58. * @return \think\model\relation\BelongsTo
  59. */
  60. public function express()
  61. {
  62. return $this->belongsTo('Express');
  63. }
  64. /**
  65. * 关联用户表
  66. * @return \think\model\relation\HasOne
  67. */
  68. public function address()
  69. {
  70. return $this->hasOne('OrderRefundAddress');
  71. }
  72. /**
  73. * 售后单详情
  74. * @param array|int $where
  75. * @param array $with
  76. * @return null|static
  77. */
  78. public static function detail($where, array $with = [])
  79. {
  80. return static::get($where, $with);
  81. }
  82. }