UserGroupDao.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\common\dao\user;
  12. use app\common\dao\BaseDao;
  13. use app\common\model\BaseModel;
  14. use app\common\model\user\UserGroup;
  15. use think\db\BaseQuery;
  16. /**
  17. * Class UserGroupDao
  18. * @package app\common\dao\user
  19. * @author xaboy
  20. * @day 2020-05-07
  21. */
  22. class UserGroupDao extends BaseDao
  23. {
  24. /**
  25. * @return BaseModel
  26. * @author xaboy
  27. * @day 2020-03-30
  28. */
  29. protected function getModel(): string
  30. {
  31. return UserGroup::class;
  32. }
  33. /**
  34. * @param array $where
  35. * @return BaseQuery
  36. * @author xaboy
  37. * @day 2020-05-06
  38. */
  39. public function search(array $where = [])
  40. {
  41. return UserGroup::getDB();
  42. }
  43. /**
  44. * @return array
  45. * @author xaboy
  46. * @day 2020-05-07
  47. */
  48. public function allOptions()
  49. {
  50. return UserGroup::getDB()->column('group_name', 'group_id');
  51. }
  52. }