0
我創建了一個croncommand和函數中使用SQL語句,但是當我通過命令php protected/yiic cron
運行它,它會拋出錯誤:警予createcommand不工作的cron
exception 'CException' with message 'CConsoleApplication and its behaviors do not have a method or closure named "createCommand".' in /home/sbl13/public_html/atp/yii/framework/base/CComponent.php:266
我的功能是
public function actionSendFeedbackReminder()
{
$sql = "SELECT training.id,session.trainingid,
group_concat(session.id),min(c_startdate) AS start,
max(c_enddate) AS end,training.programid,catalog.title
FROM training JOIN session ON
session.trainingid=training.id
JOIN catalog ON catalog.id=training.catalogueid
WHERE training.active=1 and session.active=1
GROUP BY trainingid"; // query to get data from databse
$data = Yii::app()->createCommand($sql)->queryAll(); //throws error here
}
我沒有從谷歌