master
ELF 5 years ago
parent ff6af3dbbc
commit 77b58eeb52

@ -32,7 +32,7 @@ class UserService
}
$user = $result['data']['user'];
$noticeCount = $this->getNoticeCount($user);
$noticeCount = $this->getNoticeCount($user, $game);
$this->addUserPlay($user, $game, $clientIp);
$response = [
@ -343,12 +343,12 @@ class UserService
}
}
protected function getNoticeCount($user)
protected function getNoticeCount($user, $game)
{
$noticeCount = 0;
$time = time();
$noticeIds = M('notice', 'tab_')
->where('start_time < ' . $time . ' AND game_id = ' . $user['game_id']. ' AND (end_time = 0 OR end_time >' . $time . ')')
->where('start_time < ' . $time . ' AND game_id = ' . $game['id']. ' AND (end_time = 0 OR end_time >' . $time . ')')
->getField('id',true);
if(!empty($noticeIds))
{

Loading…
Cancel
Save