GoodsOrder.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace app\common\model;
  3. class GoodsOrder extends BaseModel
  4. {
  5. /**
  6. * @var string
  7. */
  8. protected $name = 'goods_order';
  9. /**
  10. * @var array
  11. */
  12. protected $auto = [];
  13. /**
  14. * @var array
  15. */
  16. protected $insert = ['created_at','updated_at'];
  17. /**
  18. * @var array
  19. */
  20. protected $update = ['updated_at'];
  21. /**
  22. *
  23. * @author 许祖兴 < zuxing.xu@lettered.cn>
  24. * @date 2020/7/3 9:14
  25. *
  26. * @return \think\model\relation\BelongsTo
  27. */
  28. public function user()
  29. {
  30. return $this->belongsTo('Users','user_id','id');
  31. }
  32. /**
  33. *
  34. * @author 许祖兴 < zuxing.xu@lettered.cn>
  35. * @date 2020/7/3 9:14
  36. *
  37. * @return \think\model\relation\BelongsTo
  38. */
  39. public function seller()
  40. {
  41. return $this->belongsTo('Seller','seller_id','id');
  42. }
  43. /**
  44. *
  45. * @author 许祖兴 < zuxing.xu@lettered.cn>
  46. * @date 2020/7/3 9:14
  47. *
  48. * @return \think\model\relation\BelongsTo
  49. */
  50. public function addr()
  51. {
  52. return $this->belongsTo('UsersAddr','addr_id','id');
  53. }
  54. public function goods(){
  55. return $this->hasMany('','','id');
  56. }
  57. /**
  58. *
  59. * @author 许祖兴 < zuxing.xu@lettered.cn>
  60. * @date 2020/7/3 9:13
  61. *
  62. * @return \think\model\relation\belongsTo
  63. */
  64. public function detail()
  65. {
  66. return $this->belongsTo('GoodsOrderDetail','id', 'order_id');
  67. }
  68. }