UserLabel.php 867 B

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