如何将此sql转换为活动记录查询
SELECT * FROM `base_twitter` WHERE id NOT IN (SELECT base_id from base_followers)
Run Code Online (Sandbox Code Playgroud) 在我的sitecontroller中,我这样写
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['login', 'error'],
'allow' => true,
],
[
'actions' => ['logout', 'index' ,'call-back'], // add all actions to take guest to login page
'allow' => true,
'roles' => ['@'],
],
],
],
Run Code Online (Sandbox Code Playgroud)
所以,如果我进行索引或回拨操作,我将重定向到登录页面.但我必须为每个控制器的所有动作做这件事.你能告诉我最好的办法吗?