UserGroup.php 786 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\models\user;
  3. use crmeb\basic\BaseModel;
  4. use crmeb\traits\ModelTrait;
  5. /**
  6. * TODO 会员等级Model
  7. * Class UserLevel
  8. * @package app\models\user
  9. */
  10. class UserGroup extends BaseModel
  11. {
  12. /**
  13. * 数据表主键
  14. * @var string
  15. */
  16. protected $pk = 'id';
  17. /**
  18. * 模型名称
  19. * @var string
  20. */
  21. protected $name = 'user_group';
  22. use ModelTrait;
  23. /**
  24. * 会员分组列表
  25. * @param $where
  26. * @return array
  27. */
  28. public static function getList($where)
  29. {
  30. $model = new self();
  31. $count = $model->count();
  32. if ($where['limit'] != '') $model = $model->page((int)$where['page'], (int)$where['limit']);
  33. $list = $model->select();
  34. return compact('count', 'list');
  35. }
  36. }