| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\admin\model\dao;
- use app\common\model\UserModel;
- use think\facade\Db;
- class User extends BaseDao
- {
- protected $model;
- public static $table = "db_user";
- public function __construct()
- {
- $this->model = new UserModel();
- }
- public static function getUids(array $uids)
- {
- return Db::table(self::$table)->whereIn('pid', $uids)->column('id');
- }
- public static function countScore(array $uids)
- {
- return Db::table(self::$table)->whereIn('id', $uids)->sum('score');
- }
- public static function countMoney(array $uids)
- {
- return Db::table(self::$table)->whereIn('id', $uids)->sum('money');
- }
- public function getCount($where, $userMap)
- {
- return $this->model
- ->withJoin('userData', 'INNER')
- ->where($where)
- ->where($userMap)
- ->count();
- }
- public function getPageList($page, $limit, $where, $sort, $userMap)
- {
- return $this->model
- ->withJoin('userData', 'INNER')
- ->where($where)
- ->where($userMap)
- ->page($page, $limit)
- ->order($sort)
- ->select();
- }
- }
|