CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1023 idle . The SQL statement executed was: SELECT * FROM `dtk_lingquan_goods` `t` WHERE (((((((start_time<=:ycp4) AND (is_delete=:ycp5)) AND (is_online=:ycp6)) AND (cid=:ycp7)) AND (jipin=:ycp8)) AND (quan_num>:ycp9)) AND (quan_time>=:ycp10)) AND (id<=:ycp11) ORDER BY updatetime desc LIMIT 100 OFFSET 500

/data/home/www/dtk_php_cms_server/framework/db/CDbCommand.php(543)

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

Stack Trace

#3
+
 /data/home/www/dtk_php_cms_server/protected/util/PaoLiangHelper.php(195): CActiveRecord->findAll(CDbCriteria)
190         $c = intval($cid);
191         $countArray = Yii::app()->db->createCommand($sql)->queryRow(true, [':cid' => $c > 0 ? $c : 101]);
192         $count = $countArray['count_total'];
193         $is99 && $count = $countArray['count_cap10'];
194         $is20 && $count = $countArray['count_cap20'];
195         $goodsList = LingquanGoods::model()->findAll($criteria);
196         $ret = ['count' => $count, 'goodsList' => $goodsList];
197 
198         $this->setCache($keyStr, serialize($ret), 60);
199 
200         return $ret;
#4
+
 /data/home/www/dtk_php_cms_server/protected/controllers/LController.php(67): PaoLiangHelper->getLingQuan(null, "1844029", "4", 0, ...)
62             $result = $paoLiangHelper->getLingQuanES($kw, $cid, $is99, $is20, $isBoutique, $sort, $page - 1, $limit);
63         } else {
64             if(!$maxId){
65                 $maxId = $paoLiangHelper->getMaxId();
66             }
67             $result = $paoLiangHelper->getLingQuan($kw,$maxId, $cid, $is99, $is20, $isBoutique, $sort, ($page - 1) * $limit, $limit);
68         }
69         $gidArray = [];
70         foreach ($result['goodsList'] as $goods) {
71             $gidArray[] = $goods->id;
72         }
#12
+
 /data/home/www/dtk_php_cms_server/index.php(97): CApplication->run()
92 defined('YII_DEBUG') or define('YII_DEBUG', true);
93 // specify how many levels of call stack should be shown in each log message
94 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
95 
96 require_once($yii);
97 Yii::createWebApplication($config)->run();
2017-01-17 16:52:26 nginx/1.6.2 Yii Framework/1.1.16