|
|
@@ -15,6 +15,7 @@ class UserLogic
|
|
|
{
|
|
|
public function getList($page, $limit, $where, $sort, $userMap)
|
|
|
{
|
|
|
+ $where[] = ['status', '<>', 3];
|
|
|
$userDao = new User();
|
|
|
$count = $userDao->getCount($where, $userMap);
|
|
|
$list = $userDao->getPageList($page, $limit, $where, $sort, $userMap);
|
|
|
@@ -328,18 +329,18 @@ class UserLogic
|
|
|
* @return mixed
|
|
|
* @throws \think\db\exception\DbException
|
|
|
*/
|
|
|
- public static function getCountByTime($time='0')
|
|
|
+ public static function getCountByTime($time = '0')
|
|
|
{
|
|
|
$cacheKey = "caches:user:counts_{$time}";
|
|
|
- if(!Cache::has($cacheKey)){
|
|
|
- $data = UserModel::where(['status'=>1])
|
|
|
- ->where(function($query) use($time){
|
|
|
- if($time){
|
|
|
- $query->where('reg_time','>=', $time);
|
|
|
+ if (!Cache::has($cacheKey)) {
|
|
|
+ $data = UserModel::where(['status' => 1])
|
|
|
+ ->where(function ($query) use ($time) {
|
|
|
+ if ($time) {
|
|
|
+ $query->where('reg_time', '>=', $time);
|
|
|
}
|
|
|
})->count('id');
|
|
|
- if($data){
|
|
|
- Cache::set($cacheKey, $data, rand(3,5));
|
|
|
+ if ($data) {
|
|
|
+ Cache::set($cacheKey, $data, rand(3, 5));
|
|
|
}
|
|
|
|
|
|
return $data;
|