[8] ErrorException in Index.php line 32

未定义数组索引: aqi

  1. * 城市首页
  2. * @return mixed
  3. * @throws \think\db\exception\DataNotFoundException
  4. * @throws \think\db\exception\ModelNotFoundException
  5. * @throws \think\exception\DbException
  6. */
  7. public function index() {
  8. //获取香港竞博AQI信息
  9. $currentAQI = InkWeather::aqi($this->_loginLocation["city_id"]);
  10. $this->addData("AQI", $currentAQI["data"]["aqi"]);
  11. //天气实况
  12. $currentWeather = InkWeather::currentWeather($this->_loginLocation["city_id"]);
  13. $this->addData("currentWeather", $currentWeather["data"]["condition"]);
  14. //生活指数
  15. $liveIndex = InkWeather::liveIndex($this->_loginLocation["city_id"]);
  16. $this->addData("liveIndex", $liveIndex["data"]["liveIndex"]["" . date("Y-m-d") . ""]);
  17. //天气预报15日
  18. $weather15Day = InkWeather::weatherBy15Day($this->_loginLocation["city_id"]);
  19. $this->addData("weather15Day", array_slice($weather15Day["data"]["forecast"], 0, 7));

Call Stack

  1. in Index.php line 32
  2. at Error::appError(8, 'Undefined index: aqi', '/data/ebd120_website...', 32, ['currentAQI' => ['code' => 0, 'data' => ['city' => ['cityId' => 1041, 'counname' => '中国', 'ianatimezone' => 'Asia/Shanghai', ...]], 'msg' => 'success', ...]]) in Index.php line 32
  3. at Index->index()
  4. at ReflectionMethod->invokeArgs(object(Index), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(Index), object(ReflectionMethod), ['city' => '0902']) in Module.php line 131
  6. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  7. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  8. at Middleware->think\{closure}(object(Request))
  9. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  10. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 432
  13. at App->think\{closure}(object(Request), object(Closure), null)
  14. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  15. at Middleware->think\{closure}(object(Request))
  16. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  17. at Middleware->dispatch(object(Request)) in App.php line 435
  18. at App->run() in index.php line 22

Environment Variables

GET Data
city
0902
POST Dataempty
Filesempty
Cookiesempty
Session
www
{ "login": { "location": { "city": "\u4e09\u6c99", "code": "0902", "city_id": 1041 } } }
Server/Request Data
UNIQUE_ID
XaRPKLChrTFatko90dufHwAAABc
HTTP_REMOTEIP
23.80.135.210
HTTP_HOST
www.ebd120.com
HTTP_X_FORWARDED_FOR
23.80.135.210
HTTP_CONNECTION
close
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_ACCEPT
*/*
HTTP_ACCEPT_ENCODING
deflate, gzip
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache/2.4.6 (CentOS) PHP/7.2.21
SERVER_NAME
www.ebd120.com
SERVER_ADDR
10.90.14.218
SERVER_PORT
80
REMOTE_ADDR
100.97.135.154
DOCUMENT_ROOT
/data/ebd120_website/public
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/data/ebd120_website/public
SERVER_ADMIN
tim@shuijingping.com
SCRIPT_FILENAME
/data/ebd120_website/public/index.php
REMOTE_PORT
34942
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
city=0902
REQUEST_URI
/?city=0902
SCRIPT_NAME
/index.php
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1571049256.844
REQUEST_TIME
1571049256
Environment Variablesempty
ThinkPHP Constants
SERVER_IP_ADDR
10.90.14.218
AOP_SDK_WORK_DIR
/data/ebd120_website/runtime/temp/
AOP_SDK_DEV_MODE
true