#0 [10501]PDOException in PDOConnection.php line 795

SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'cms_category'

  1. }
  2. } else {
  3. if ($this->reConnectTimes < 4 && $this->isBreak($e)) {
  4. ++$this->reConnectTimes;
  5. return $this->close()->getPDOStatement($sql, $bind, $master, $procedure);
  6. }
  7. }
  8. if ($e instanceof \PDOException) {
  9. throw new PDOException($e, $this->config, $this->getLastsql());
  10. } else {
  11. throw $e;
  12. }
  13. }
  14. }
  15. /**
  16. * 执行语句
  17. * @access protected

Call Stack

  1. in PDOConnection.php line 795
  2. at PDOConnection->getPDOStatement('SELECT COUNT(*) AS t...', ['ThinkBind_1_1498859383_' => ['gh', 2], 'ThinkBind_2_1786833440_' => ['gh', 2]], false) in PDOConnection.php line 1131
  3. at PDOConnection->value(object(Query), 'COUNT(*) AS think_co...', 0, false) in PDOConnection.php line 1161
  4. at PDOConnection->aggregate(object(Query), 'COUNT', 'COUNT(*) AS think_co...', false) in AggregateQuery.php line 32
  5. at BaseQuery->aggregate('COUNT', '*') in AggregateQuery.php line 55
  6. at BaseQuery->count() in BaseQuery.php line 623
  7. at BaseQuery->paginate(20) in BaseModel.php line 104
  8. at BaseModel->getList(false) in Article.php line 168
  9. at Article->postsList() in Article.php line 83
  10. at Article->category('gh', '')
  11. at ReflectionMethod->invokeArgs(object(Article), ['gh', '']) in Container.php line 343
  12. at Container->invokeReflectMethod(object(Article), object(ReflectionMethod), ['s' => '//category/gh.html', 'name' => 'gh']) in Controller.php line 110
  13. at Controller->think\route\dispatch\{closure}(object(Request)) in Pipeline.php line 59
  14. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  15. at Pipeline->then(object(Closure)) in Controller.php line 113
  16. at Controller->exec() in Dispatch.php line 89
  17. at Dispatch->run() in Route.php line 772
  18. at Route->think\{closure}(object(Request)) in Pipeline.php line 59
  19. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  20. at Pipeline->then(object(Closure)) in Route.php line 773
  21. at Route->dispatch(object(Request), object(Closure)) in Http.php line 216
  22. at Http->dispatchToRoute(object(Request)) in Http.php line 206
  23. at Http->think\{closure}(object(Request)) in Pipeline.php line 59
  24. at Pipeline->think\{closure}(object(Request)) in MultiApp.php line 71
  25. at MultiApp->think\app\{closure}(object(Request)) in Pipeline.php line 59
  26. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  27. at Pipeline->then(object(Closure)) in MultiApp.php line 72
  28. at MultiApp->handle(object(Request), object(Closure))
  29. at call_user_func([object(MultiApp), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  30. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 85
  31. at Pipeline->think\{closure}(object(Request)) in InitApp.php line 48
  32. at InitApp->handle(object(Request), object(Closure))
  33. at call_user_func([object(InitApp), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  34. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 85
  35. at Pipeline->think\{closure}(object(Request)) in SessionInit.php line 67
  36. at SessionInit->handle(object(Request), object(Closure))
  37. at call_user_func([object(SessionInit), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  38. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 85
  39. at Pipeline->think\{closure}(object(Request)) in TraceDebug.php line 71
  40. at TraceDebug->handle(object(Request), object(Closure))
  41. at call_user_func([object(TraceDebug), 'handle'], object(Request), object(Closure)) in Middleware.php line 142
  42. at Middleware->think\{closure}(object(Request), object(Closure)) in Pipeline.php line 85
  43. at Pipeline->think\{closure}(object(Request)) in Pipeline.php line 66
  44. at Pipeline->then(object(Closure)) in Http.php line 207
  45. at Http->runWithRequest(object(Request)) in Http.php line 170
  46. at Http->run() in index.php line 20

Exception Datas

PDO Error Info
SQLSTATE 42000
Driver Error Code 1066
Driver Error Message Not unique table/alias: 'cms_category'
Database Status
Error Code 10501
Error Message SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'cms_category'
Error SQL SELECT COUNT(*) AS think_count FROM `lay_cms_article` `cms_article` LEFT JOIN `lay_cms_category` `cms_category` ON `cms_article`.`cid`=`cms_category`.`id` LEFT JOIN `lay_cms_category` `cms_category` ON `cms_article`.`cid`=`cms_category`.`id` WHERE `alias` = 'gh' AND `alias` = 'gh'
Database Config
type mysql
hostname 127.0.0.1
database wwwlayinfo
hostport 3306
dsn
params []
charset utf8
prefix lay_
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
fields_cache false
trigger_sql 1
builder
query
break_reconnect false
break_match_str []

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST layinfo.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.layinfo.com
SERVER_PORT 443
SERVER_ADDR 172.31.32.204
REMOTE_PORT 48334
REMOTE_ADDR 18.232.169.110
SERVER_SOFTWARE nginx/1.19.3
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/www.layinfo.com
DOCUMENT_URI /index.php
REQUEST_URI /category/gh.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=//category/gh.html
SCRIPT_FILENAME /www/wwwroot/www.layinfo.com/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711621298.2431
REQUEST_TIME 1711621298
0.067849s