UsersAgent.php 965 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\common\model;
  3. class UsersAgent extends BaseModel
  4. {
  5. /**
  6. * @var string
  7. */
  8. protected $name = 'users_agent';
  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. *
  24. * @author 许祖兴 < zuxing.xu@lettered.cn>
  25. * @date 2020/7/9 9:38
  26. *
  27. * @return \think\model\relation\BelongsTo
  28. */
  29. public function user()
  30. {
  31. return $this->belongsTo('Users','user_id','id');
  32. }
  33. /**
  34. * 关联 区域
  35. *
  36. * @author 许祖兴 < zuxing.xu@lettered.cn>
  37. * @date 2020/7/9 9:38
  38. *
  39. * @return \think\model\relation\BelongsTo
  40. */
  41. public function area()
  42. {
  43. return $this->belongsTo('China','area_id','id');
  44. }
  45. }