EquityOrder.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\common\model\equity;
  15. use app\common\model\BaseModel;
  16. use app\common\model\property\PropertyHead;
  17. use app\common\model\user\User;
  18. use app\common\model\works\ServiceWork;
  19. /**
  20. * EquityOrder模型
  21. * Class EquityOrder
  22. * @package app\common\model
  23. */
  24. class EquityOrder extends BaseModel
  25. {
  26. protected $name = 'equity_order';
  27. public function equityConfig()
  28. {
  29. return $this->hasOne(EquityConfig::class, 'id', 'equity_id');
  30. }
  31. public function user()
  32. {
  33. return $this->hasOne(User::class, 'id', 'user_id');
  34. }
  35. public function propertyHead()
  36. {
  37. return $this->hasOne(PropertyHead::class, 'id', 'property_head_id')
  38. ->field('id,property_name,village_name,head_name');
  39. }
  40. public function serviceWork()
  41. {
  42. return $this->hasOne(ServiceWork::class, 'id', 'service_work_id')
  43. ->field('*');
  44. }
  45. }