Error Info: Array
(
[0] => 42000
[1] => 1064
[2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by id asc limit 1' at line 1
)
in C:\wwwroot\sztarena.com\framework\db\Command.php at line 825
$exceptionClass = '\yii\db\Exception';
foreach ($this->exceptionMap as $error => $class) {
if (strpos($e->getMessage(), $error) !== false) {
$exceptionClass = $class;
}
}
$message = $e->getMessage() . "\nThe SQL being executed was: $rawSql";
$errorInfo = $e instanceof \PDOException ? $e->errorInfo : null;
return new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e);
}
/**
* Returns a value indicating whether a SQL statement is for read purpose.
* @param string $sql the SQL statement
* @return boolean whether a SQL statement is for read purpose.
*/
public function isReadQuery($sql)
{
$this->pdoStatement->closeCursor();
}
Yii::endProfile($token, 'yii\db\Command::query');
} catch (\Exception $e) {
Yii::endProfile($token, 'yii\db\Command::query');
throw $this->db->getSchema()->convertException($e, $rawSql);
}
if (isset($cache, $cacheKey, $info)) {
$cache->set($cacheKey, [$result], $info[1], $info[2]);
Yii::trace('Saved query result in cache', 'yii\db\Command::query');
}
* @return array|boolean the first row (in terms of an array) of the query result. False is returned if the query
* results in nothing.
* @throws Exception execution failed
*/
public function queryOne($fetchMode = null)
{
return $this->queryInternal('fetch', $fetchMode);
}
/**
* Executes the SQL statement and returns the value of the first column in the first row of data.
* This method is best used when only a single value is needed for a query.
* @return string|null|boolean the value of the first column in the first row of the query result.
/**
* 單个(gè)
* @param type $sql
*/
protected function queryOne($sql) {
return \Yii::$app->db->createCommand($sql)->queryOne();
}
/**
* 统計(jì)总數
* @param type $sql
*/
* @param not null $classid 分(fēn)類(lèi)id
* @param not null $id 當前(qián)id
* @return string
*/
public function _page($table,$classid,$id){
$sql = "select ID,ClassID,title from " . TABLE_FIX .$table. " where Checked=1 and id > $id and classid= $classid order by id asc limit 1";
$up = $this->queryOne($sql);
$sql = "select ID,ClassID,title from " . TABLE_FIX .$table. " where Checked=1 and id < $id and classid= $classid order by id desc limit 1";
$down = $this->queryOne($sql);
$arrUp = empty($up) ? null : [$up['ID'],$up['title']];
$arrDown = empty($down) ? null : [$down['ID'],$down['title']];
$html = ['down'=>$arrUp,'up'=>$arrDown];
return $html;
->andFilterWhere(['h_cn_u_case.Checked' => 1, 'h_cn_u_case.ID' => $id])
->one();
$productId = $this->_data['u_case_detail']->ClassID;
$this->_data['product_id'] = Comment::getParentIds($productId, $this->_data['caseList']);
$this->_data['page'] = $this->_page('u_case', $productId, $id);
$this->_data['page'] = $this->_page('u_case', $productId, $id);
$this->_data['gallery'] = HCnDAttribute::find()->where(['ChannelID' => '10010', 'type' => 'file', 'ClassID' => $id])->orderBy(['Orderid' => "asc", 'ID' => 'asc'])->all();
// print_r($this->_data['gallery']);exit;
return $this->autoview();
}
$args = $this->controller->bindActionParams($this, $params);
Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__);
if (Yii::$app->requestedParams === null) {
Yii::$app->requestedParams = $args;
}
return call_user_func_array([$this->controller, $this->actionMethod], $args);
}
}
}
$result = null;
if ($runAction && $this->beforeAction($action)) {
// run the action
$result = $action->runWithParams($params);
$result = $this->afterAction($action, $result);
// call afterAction on modules
foreach ($modules as $module) {
/* @var $module Module */
$parts = $this->createController($route);
if (is_array($parts)) {
/* @var $controller Controller */
list($controller, $actionID) = $parts;
$oldController = Yii::$app->controller;
Yii::$app->controller = $controller;
$result = $controller->runAction($actionID, $params);
Yii::$app->controller = $oldController;
return $result;
} else {
$id = $this->getUniqueId();
throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll;
unset($params[0]);
}
try {
Yii::trace("Route requested: '$route'", __METHOD__);
$this->requestedRoute = $route;
$result = $this->runAction($route, $params);
if ($result instanceof Response) {
return $result;
} else {
$response = $this->getResponse();
if ($result !== null) {
$response->data = $result;
try {
$this->state = self::STATE_BEFORE_REQUEST;
$this->trigger(self::EVENT_BEFORE_REQUEST);
$this->state = self::STATE_HANDLING_REQUEST;
$response = $this->handleRequest($this->getRequest());
$this->state = self::STATE_AFTER_REQUEST;
$this->trigger(self::EVENT_AFTER_REQUEST);
$this->state = self::STATE_SENDING_RESPONSE;
$response->send();
defined('YII_ENV') or define('YII_ENV', 'dev');
define('IN_PHPWeb', true);
require_once($yii);
$config = require_once($main);
(new yii\web\Application($config))->run();
$_GET = [
'id' => '5',
];
$_SERVER = [
'_FCGI_X_PIPE_' => '\\\\.\\pipe\\IISFCGI-d2f04811-8cff-4fef-b095-a31659110e71',
'PHP_FCGI_MAX_REQUESTS' => '10000',
'ALLUSERSPROFILE' => 'C:\\ProgramData',
'APPDATA' => 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming',
'APP_POOL_CONFIG' => 'C:\\inetpub\\temp\\apppools\\sztarena.com\\sztarena.com.config',
'APP_POOL_ID' => 'sztarena.com',
'BT_PANEL' => 'c:\\BtSoft\\panel',
'BT_PYTHON' => 'C:\\Program Files\\python',
'BT_SETUP' => 'c:\\BtSoft',
'CommonProgramFiles' => 'C:\\Program Files\\Common Files',
'CommonProgramFiles(x86)' => 'C:\\Program Files (x86)\\Common Files',
'CommonProgramW6432' => 'C:\\Program Files\\Common Files',
'COMPUTERNAME' => 'i-c7up7upm',
'ComSpec' => 'C:\\Windows\\system32\\cmd.exe',
'FP_NO_HOST_CHECK' => 'NO',
'LOCALAPPDATA' => 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local',
'NUMBER_OF_PROCESSORS' => '1',
'OS' => 'Windows_NT',
'Path' => 'C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;;C:\\Program Files\\python;C:\\Program Files\\python\\Scripts;;D:\\BtSoft\\panel\\script;;C:\\Program Files\\python;C:\\Program Files\\python\\Scripts;;c:\\BtSoft\\panel\\script;',
'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',
'PROCESSOR_ARCHITECTURE' => 'AMD64',
'PROCESSOR_IDENTIFIER' => 'Intel64 Family 6 Model 6 Stepping 3, GenuineIntel',
'PROCESSOR_LEVEL' => '6',
'PROCESSOR_REVISION' => '0603',
'ProgramData' => 'C:\\ProgramData',
'ProgramFiles' => 'C:\\Program Files',
'ProgramFiles(x86)' => 'C:\\Program Files (x86)',
'ProgramW6432' => 'C:\\Program Files',
'PSModulePath' => 'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\',
'PUBLIC' => 'C:\\Users\\Public',
'SystemDrive' => 'C:',
'SystemRoot' => 'C:\\Windows',
'TEMP' => 'C:\\Windows\\TEMP',
'TMP' => 'C:\\Windows\\TEMP',
'UNRAR_LIB_PATH' => 'C:\\Program Files\\python\\Lib\\site-packages\\unrar\\UnRAR.dll',
'USERDOMAIN' => 'WORKGROUP',
'USERNAME' => 'i-c7up7upm$',
'USERPROFILE' => 'C:\\Windows\\system32\\config\\systemprofile',
'windir' => 'C:\\Windows',
'ORIG_PATH_INFO' => '/index.php/product-detail/5.html',
'URL' => '/index.php',
'SERVER_SOFTWARE' => 'Microsoft-IIS/8.5',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'SERVER_PORT_SECURE' => '0',
'SERVER_PORT' => '80',
'SERVER_NAME' => 'www.sztarena.com',
'SCRIPT_NAME' => '/index.php',
'SCRIPT_FILENAME' => 'c:\\wwwroot\\sztarena.com\\index.php',
'REQUEST_URI' => '/product-detail/5.html',
'REQUEST_METHOD' => 'GET',
'REMOTE_USER' => '',
'REMOTE_PORT' => '46532',
'REMOTE_HOST' => '198.2.231.215',
'REMOTE_ADDR' => '198.2.231.215',
'QUERY_STRING' => '',
'PATH_TRANSLATED' => 'c:\\wwwroot\\sztarena.com\\index.php\\product-detail\\5.html',
'PATH_INFO' => '/product-detail/5.html',
'LOGON_USER' => '',
'LOCAL_ADDR' => '10.110.0.4',
'INSTANCE_META_PATH' => '/LM/W3SVC/5',
'INSTANCE_NAME' => 'sztarena.com',
'INSTANCE_ID' => '5',
'HTTPS_SERVER_SUBJECT' => '',
'HTTPS_SERVER_ISSUER' => '',
'HTTPS_SECRETKEYSIZE' => '',
'HTTPS_KEYSIZE' => '',
'HTTPS' => 'off',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'DOCUMENT_ROOT' => 'c:\\wwwroot\\sztarena.com',
'CONTENT_TYPE' => '',
'CONTENT_LENGTH' => '0',
'CERT_SUBJECT' => '',
'CERT_SERIALNUMBER' => '',
'CERT_ISSUER' => '',
'CERT_FLAGS' => '',
'CERT_COOKIE' => '',
'AUTH_USER' => '',
'AUTH_PASSWORD' => '',
'AUTH_TYPE' => '',
'APPL_PHYSICAL_PATH' => 'c:\\wwwroot\\sztarena.com\\',
'APPL_MD_PATH' => '/LM/W3SVC/5/ROOT',
'IIS_UrlRewriteModule' => '7.1.0871.0',
'UNENCODED_URL' => '/product-detail/5.html',
'IIS_WasUrlRewritten' => '1',
'HTTP_X_ORIGINAL_URL' => '/product-detail/5.html',
'HTTP_CLIENT_IP' => '216.73.216.109',
'HTTP_X_REAL_IP' => '216.73.216.109',
'HTTP_X_FORWARDED_FOR' => '216.73.216.109',
'HTTP_USER_AGENT' => 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)',
'HTTP_REFERER' => 'http://www.sztarena.com',
'HTTP_HOST' => 'www.sztarena.com',
'HTTP_ACCEPT_LANGUAGE' => 'zh-CN,zh;q=0.9,en;q=0.8',
'HTTP_ACCEPT_ENCODING' => 'deflate, gzip',
'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'HTTP_CONTENT_LENGTH' => '0',
'HTTP_PRAGMA' => 'no-cache',
'HTTP_CONNECTION' => 'keep-alive',
'HTTP_CACHE_CONTROL' => 'no-cache',
'FCGI_ROLE' => 'RESPONDER',
'PHP_SELF' => '/index.php/product-detail/5.html',
'REQUEST_TIME_FLOAT' => 1776228976.3431051,
'REQUEST_TIME' => 1776228976,
];