1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- declare (strict_types=1);
- namespace app\dao\user;
- use app\dao\BaseDao;
- use app\model\user\UserIntegral;
- class UserIntegralDao extends BaseDao
- {
-
- protected function setModel(): string
- {
- return UserIntegral::class;
- }
-
- public function getList(array $where, string $filed = "*", int $page = 0, int $limit = 0, array $with = [])
- {
- return $this->search($where)->field($filed)->with($with)->when($page && $limit, function ($query) use ($page, $limit) {
- $query->page($page, $limit);
- })->order('id desc')->select()->toArray();
- }
- public function search(array $where = [])
- {
- if ($where) {
- return $this->withSearchSelect(array_keys($where), $where);
- } else {
- return $this->getModel();
- }
- }
- }
|