登录记录查询强制索引

master
liuweiwen 5 years ago
parent 5b1a4db378
commit 0d088037da

@ -1087,7 +1087,7 @@ class MemberController extends ThinkController
// $map['login_time'] = ['exp', 'login_time<>0'];
$extend = array();
$extend['map'] = $map;
$count = M('UserLoginRecord','tab_')->field('user_id')->where($extend['map'])->group('user_id')->select(false);
$count = M('UserLoginRecord','tab_')->table('tab_user_login_record FORCE INDEX(user_id_promote_idx)')->field('user_id')->where($extend['map'])->group('user_id')->select(false);
$sql = "select count(user_id) as count from ({$count})t";
$count = M('UserLoginRecord','tab_')->query($sql);

Loading…
Cancel
Save