UserLevelLogService.php 987 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\extra\service\user;
  3. use app\extra\basic\Service;
  4. use app\extra\dao\user\UserLevelLogDao;
  5. class UserLevelLogService extends Service
  6. {
  7. /**
  8. * 设置模型
  9. * @return string
  10. */
  11. public function __construct()
  12. {
  13. $this->dao = new UserLevelLogDao();
  14. }
  15. /**
  16. * 列表
  17. * @param array $param
  18. */
  19. public function getList(array $param = [],string $field = '*', int $page = 0,int $limit = 0,string $order = 'id desc')
  20. {
  21. $list = $this->dao->getList($this->searchFilter($param),$field,$page,$limit,$order);
  22. $count = $this->dao->count($this->searchFilter($param));
  23. return compact('list','count');
  24. }
  25. protected function searchFilter(array $param = []): array
  26. {
  27. $filter = [];
  28. !empty($param['status']) && $filter[] = ["status", '=', $param['status']];
  29. !empty($param['is_del']) && $filter[] = ["is_del", '=', $param['is_del']];
  30. return $filter;
  31. }
  32. }