[0] ThrowableError in Sck.php line 414

致命错误: Call to a member function toArray() on null

  1. /**
  2. * 样式素材详情
  3. */
  4. public function styleDetail()
  5. {
  6. $style_id = $this->request->param('id');
  7. if ($style_id < 1) {
  8. return $this->error('参数错误', '/home/sck/index');
  9. }
  10. $style = Style::getInstance()->where('old_id', '=', $style_id)->find()->toArray();
  11. if (empty($style)) {
  12. return $this->error('暂无此素材', '/home/sck/index');
  13. }
  14. $style['tags'] = explode(' ', trim($style['tags']));
  15. $arr = [];
  16. $time = $style['hits_time'];
  17. if (date("Y") > date("Y", strtotime($time))) {
  18. $arr['hits_year'] = 1;
  19. } else if (date("Y") == date("Y", strtotime($time))) {

Call Stack

  1. in Sck.php line 414
  2. at Sck->styleDetail()
  3. at ReflectionMethod->invokeArgs() in Container.php line 395
  4. at Container->invokeReflectMethod() in Module.php line 131
  5. at Module->think\route\dispatch\{closure}()
  6. at call_user_func_array() in Middleware.php line 185
  7. at Middleware->think\{closure}()
  8. at call_user_func() in Middleware.php line 130
  9. at Middleware->dispatch() in Module.php line 136
  10. at Module->exec() in Dispatch.php line 168
  11. at Dispatch->run() in App.php line 432
  12. at App->think\{closure}()
  13. at call_user_func_array() in Middleware.php line 185
  14. at Middleware->think\{closure}()
  15. at call_user_func() in Middleware.php line 130
  16. at Middleware->dispatch() in App.php line 435
  17. at App->run() in index.php line 16

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_REFERER http://www.xmyeditor.com/sck/8028.html
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.xmyeditor.com
PATH_INFO /sck/8028.html
REDIRECT_STATUS 200
SERVER_NAME www.xmyeditor.com
SERVER_PORT 443
SERVER_ADDR 172.17.16.15
REMOTE_PORT 59932
REMOTE_ADDR 3.238.228.191
SERVER_SOFTWARE nginx/1.18.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /data/editor.com/public
DOCUMENT_URI /index.php/sck/8028.html
REQUEST_URI /sck/8028.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /data/editor.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php/sck/8028.html
REQUEST_TIME_FLOAT 1711669041.1668
REQUEST_TIME 1711669041
Environment Variablesempty
ThinkPHP Constants
SITE_PATH /data/editor.com/public/
SITE_URL https://www.xmyeditor.com
APP_NAMESPACE zzcms
SEO_TIT 速排小蚂蚁
FILTER_VALIDATE_BOOL 258
QINIU_FUNCTIONS_VERSION 7.9.0