以下是我从数据库验证campaign_id的代码 但每次我收到错误天气这个记录都是db或不是
[campaign_id', 'exist', 'targetClass' => '\common\models\Campaign', 'filter' => ['campaign_id' => Campaign::className()], 'message' => 'There is no record with this id.' ]]
答案 0 :(得分:0)
我得到了解决方案,只是删除了这个过滤器并且它可以正常工作
['campaign_id', 'exist',
'targetClass' => '\common\models\Campaign',
'message' => 'There is no user with this email address.'
]