CDbException

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens. The SQL statement executed was: SELECT * FROM `bk_bonus_service` `t` WHERE `t`.`id` IN (16, 17)

/var/www/hosts/framework/db/CDbCommand.php(548)

536         {
537             if($this->_connection->enableProfiling)
538                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
539 
540             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
541             $message=$e->getMessage();
542             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
543                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
544 
545             if(YII_DEBUG)
546                 $message.='. The SQL statement executed was: '.$this->getText().$par;
547 
548             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
549                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
550         }
551     }
552 
553     /**
554      * Builds a SQL SELECT statement from the given query specification.
555      * @param array $query the query specification in name-value pairs. The following
556      * query options are supported: {@link select}, {@link distinct}, {@link from},
557      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
558      * {@link limit}, {@link offset} and {@link union}.
559      * @throws CDbException if "from" key is not present in given query parameter
560      * @return string the SQL statement

Stack Trace

#3
+
–
 /var/www/hosts/lk.usoft.ru/protected/modules/attendance/views/sertificate/index.php(10): CActiveRecord->findAllByPk()
05 
06 /**
07  * @var $bonus_services BkBonusService[]
08  *  @var array $refresherCourses
09  */
10 $bonus_services = BkBonusService::model()->findAllByPk(array(16, 17), '', array('group_id' => 9));
11 $bonusless = (!Yii::app()->user->checkAccess('Cabinet:Bonus'));
12 $clients = Yii::app()->user->checkAccess('contract', array('access' => array('sbis', 'veda', 'kplus')));
13 $isViewFormOrderIPBR = true;
14 $datetime = date('Y-m-d H:i:s', time());
15 
#8
+
–
 /var/www/hosts/lk.usoft.ru/protected/fcomponents/Controller.php(390): CController->render()
385                 echo $this->externalTemplate($content);
386                 return true;
387             }
388         } else {
389 
390             return parent::render($view, $data, $return); // TODO: Change the autogenerated stub
391         }
392     }
393 
394 }
#9
+
–
 /var/www/hosts/lk.usoft.ru/protected/modules/attendance/controllers/SertificateController.php(11): Controller->render()
06     public $layout = '//frontend//x-style/main';
07     public $externalLayout = false;
08 
09     public function actionIndex()
10     {
11         $this->render('index', ['refresherCourses' => $this->getRefresherCourses()]);
12     }
13 
14     protected function getRefresherCourses(): array
15     {
16         $list = (array)Yii::app()->db->createCommand()
2026-11-08 19:07:59 nginx/1.18.0 Yii Framework/1.1.15