请问这条sql语句:select count(*) from token
where 'user_id'=$tokenInfo['user_id'] and create_time > $tokenInfo['create_time'];
用yii2框架的查询方法,应该怎么写?我像下面这样写是错误的:
$newCount = Token::find()->where(
[
'user_id' => $tokenInfo['user_id'],
['>', 'create_time', $tokenInfo['create_time']]
])->count();
请知道的指教下我,先谢谢了!!!
或者
更多参考 http://www.getyii.com/topic/47