产品中心

Product

新闻中心

NEWS

解决方案

SOLUTION

系统发生错误

[0] ThrowableError in Index.php line 21

致命错误: Call to undefined function app\home\controller\toDate()

  1. public function index(){
  2. $order = input('order','createtime');
  3. $list=Db::name('article')->alias('a')
  4. ->join(config('database.prefix').'category c','a.catid = c.id','left')
  5. ->field('a.*,c.catdir,c.catname')
  6. ->order($order.' desc')
  7. ->limit('15')
  8. ->select();
  9. foreach ($list as $k=>$v){
  10. $list[$k]['time'] = toDate($v['createtime']);
  11. $list[$k]['url'] = url('home/'.$v['catdir'].'/info',array('id'=>$v['id'],'catId'=>$v['catid']));
  12. }
  13. $this->assign('list', $list);
  14. //广告
  15. $adList = cache('adList');
  16. if(!$adList){
  17. $adList = Db::name('ad')->where([['open','=',1],['as_id','eq',1]])->order('sort asc')->select();
  18. cache('adList', $adList, 3600);
  19. }

Call Stack

  1. in Index.php line 21
  2. at Index->index()
  3. at ReflectionMethod->invokeArgs(object(Index), []) in Container.php line 395
  4. at Container->invokeReflectMethod(object(Index), object(ReflectionMethod), ['convert' => false]) in Module.php line 132
  5. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  6. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  7. at Middleware->think\{closure}(object(Request))
  8. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  9. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  10. at Module->exec() in Dispatch.php line 168
  11. at Dispatch->run() in App.php line 432
  12. at App->think\{closure}(object(Request), object(Closure), null)
  13. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  14. at Middleware->think\{closure}(object(Request))
  15. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  16. at Middleware->dispatch(object(Request)) in App.php line 435
  17. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
PATH C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
SYSTEMROOT C:\Windows
COMSPEC C:\Windows\system32\cmd.exe
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR C:\Windows
_FCGI_SHUTDOWN_EVENT_ 4592
SCRIPT_NAME /index.php
REQUEST_URI /
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REMOTE_PORT 34076
SCRIPT_FILENAME D:/wwwroot/ptcqbc.com/public/index.php
SERVER_ADMIN admin@example.com
CONTEXT_DOCUMENT_ROOT D:/wwwroot/ptcqbc.com/public
CONTEXT_PREFIX
REQUEST_SCHEME http
DOCUMENT_ROOT D:/wwwroot/ptcqbc.com/public
REMOTE_ADDR 3.235.181.103
SERVER_PORT 80
SERVER_ADDR 122.14.219.138
SERVER_NAME ptcqbc.com
SERVER_SOFTWARE Apache/2.4.27 (Win32) OpenSSL/1.0.2l mod_fcgid/2.3.9
SERVER_SIGNATURE
SystemRoot C:\Windows
HTTP_CONNECTION close
HTTP_HOST ptcqbc.com
HTTP_ACCEPT_ENCODING br,gzip
HTTP_IF_MODIFIED_SINCE Thu, 04 Jun 2020 21:43:30 GMT
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1594116451.1676
REQUEST_TIME 1594116451
Environment Variablesempty
ThinkPHP Constants
MAX_MENU_LENGTH 3
MAX_SUB_MENU_LENGTH 5
MODULE_NAME index
ACTION_NAME index
DBNAME
ISPAGE 1