我遇到RBAC在ActiveRecord查询中添加额外“where”子句的问题。如何删除包含“Role ='admin'”
的Where语句FYI,
*
Database Exception – yii\db\Exception
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'role' in 'where clause'
The SQL being executed was: **SELECT * FROM `myrules` WHERE role NOT LIKE "admin" ORDER BY `seq_no` LIMIT 20**
Error Info: Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'role' in 'where clause
namespace app\models;
use Yii;
class MyRulesModel extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'myrules';
}
......
}
答案 0 :(得分:0)
只是为了更新。我发现了这个问题。有人更改了 /app/data/ActiveDataProvider.php 文件。恢复到原始代码修复了问题。感谢。