OrderRefund.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. use cores\BaseModel;
  14. /**
  15. * 售后单模型
  16. * Class OrderRefund
  17. * @package app\common\model\wxapp
  18. */
  19. class OrderRefund extends BaseModel
  20. {
  21. // 定义表名
  22. protected $name = 'order_refund';
  23. // 定义主键
  24. protected $pk = 'order_refund_id';
  25. /**
  26. * 关联用户表
  27. * @return \think\model\relation\BelongsTo
  28. */
  29. public function user()
  30. {
  31. return $this->belongsTo('User');
  32. }
  33. /**
  34. * 关联订单主表
  35. * @return \think\model\relation\BelongsTo
  36. */
  37. public function orderData()
  38. {
  39. return $this->belongsTo('Order');
  40. }
  41. /**
  42. * 关联订单商品表
  43. * @return \think\model\relation\BelongsTo
  44. */
  45. public function orderGoods()
  46. {
  47. return $this->belongsTo('OrderGoods')->withoutField(['content']);
  48. }
  49. /**
  50. * 关联图片记录表
  51. * @return \think\model\relation\HasMany
  52. */
  53. public function images()
  54. {
  55. return $this->hasMany('OrderRefundImage');
  56. }
  57. /**
  58. * 关联物流公司表
  59. * @return \think\model\relation\BelongsTo
  60. */
  61. public function express()
  62. {
  63. return $this->belongsTo('Express');
  64. }
  65. /**
  66. * 关联用户表
  67. * @return \think\model\relation\HasOne
  68. */
  69. public function address()
  70. {
  71. return $this->hasOne('OrderRefundAddress');
  72. }
  73. /**
  74. * 售后单详情
  75. * @param array|int $where
  76. * @param array $with
  77. * @return null|static
  78. */
  79. public static function detail($where, array $with = [])
  80. {
  81. return static::get($where, $with);
  82. }
  83. }