[8] ErrorException in Contact.php line 15

Trying to access array offset on value of type null

  1. public function index($id='1'){
  2. $model = model('Recruit');
  3. $cateList = $model->getRecruitCateList();
  4. foreach($cateList as $k=>$v){
  5. $cateList[$k]['child'] = $model->getRecruitList(['cate_id'=>$v['id']],'id,post_name');
  6. }
  7. $info = $model->getRecruitInfo(['id'=>$id]);
  8. $info['requirement'] = htmlspecialchars_decode($info['requirement']);
  9. $info['job_content'] = htmlspecialchars_decode($info['job_content']);
  10. $this->assign('cateList', $cateList);
  11. $this->assign('info', $info);
  12. $this->assign('id', $id);
  13. if($this->phoneType == 'mobile'){
  14. return $this->fetch('m_index');
  15. }
  16. return $this->fetch();
  17. }

Call Stack

  1. in Contact.php line 15
  2. at Error::appError(8, 'Trying to access arr...', '/www/spcentry/websit...', 15, ['id' => 'index', 'model' => object(Recruit), 'cateList' => [['id' => 1, 'name' => '市场类', 'child' => [['id' => 1, 'post_name' => '市场总监'], ['id' => 4, 'post_name' => '销售助理']]], ['id' => 2, 'name' => '采购类', 'child' => [['id' => 2, 'post_name' => '采购专员'], ['id' => 5, 'post_name' => '采购助理']]], ['id' => 3, 'name' => '其他', 'child' => [['id' => 3, 'post_name' => '保洁'], ['id' => 6, 'post_name' => '电商运营']]]], ...]) in Contact.php line 15
  3. at Contact->index('index')
  4. at ReflectionMethod->invokeArgs(object(Contact), ['index']) in App.php line 197
  5. at App::invokeMethod([object(Contact), 'index'], []) in App.php line 416
  6. at App::module(['index', 'contact', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 296
  7. at App::exec(['type' => 'module', 'module' => ['index', 'contact', 'index']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 124
  8. at App::run() in start.php line 18
  9. at require('/www/spcentry/websit...') in index.php line 17

Exception Datas

Error Context
id index
model []
cateList [ { "id": 1, "name": "\u5e02\u573a\u7c7b", "child": [ { "id": 1, "post_name": "\u5e02\u573a\u603b\u76d1" }, { "id": 4, "post_name": "\u9500\u552e\u52a9\u7406" } ] }, { "id": 2, "name": "\u91c7\u8d2d\u7c7b", "child": [ { "id": 2, "post_name": "\u91c7\u8d2d\u4e13\u5458" }, { "id": 5, "post_name": "\u91c7\u8d2d\u52a9\u7406" } ] }, { "id": 3, "name": "\u5176\u4ed6", "child": [ { "id": 3, "post_name": "\u4fdd\u6d01" }, { "id": 6, "post_name": "\u7535\u5546\u8fd0\u8425" } ] } ]
v { "id": 3, "name": "\u5176\u4ed6" }
k 2
info Resource

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

HOSTNAME
3000273968bd
PHP_INI_DIR
/usr/local/etc/php
SHLVL
1
HOME
/home/www-data
PHP_LDFLAGS
-Wl,-O1 -pie
PHP_CFLAGS
-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_VERSION
7.4.27
COMPOSER_HOME
/tmp/composer
GPG_KEYS
42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
PHP_CPPFLAGS
-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_ASC_URL
https://www.php.net/distributions/php-7.4.27.tar.xz.asc
PHP_URL
https://www.php.net/distributions/php-7.4.27.tar.xz
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LD_PRELOAD
/usr/lib/preloadable_libiconv.so php
PHPIZE_DEPS
autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
PWD
/www
PHP_SHA256
3f8b937310f155822752229c2c2feb8cc2621e25a728e7b94d0d74c128c43d0c
USER
www-data
HTTP_ACCEPT_ENCODING
gzip, deflate
HTTP_REFERER
http://www.spcentury.com/index/contact/index/id/1.html
HTTP_ACCEPT_LANGUAGE
zh-cn
HTTP_USER_AGENT
SiteSucker for macOS/3.0
HTTP_ACCEPT
text/html,*/*;q=0.8
HTTP_CONNECTION
keep-alive
HTTP_HOST
www.spcentury.com
REDIRECT_STATUS
200
SERVER_NAME
spcentury.com
SERVER_PORT
80
SERVER_ADDR
172.18.0.3
REMOTE_PORT
50657
REMOTE_ADDR
42.7.220.79
SERVER_SOFTWARE
nginx
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/spcentry/website/public
DOCUMENT_URI
/index.php
REQUEST_URI
/index/contact/index/id/index.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/index/contact/index/id/index.html
SCRIPT_FILENAME
/www/spcentry/website/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1704027119.1721
REQUEST_TIME
1704027119
PATH_INFO
/index/contact/index/id/index.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/spcentry/website/public/../application/
THINK_VERSION
5.0.11
THINK_START_TIME
1704027119.1722
THINK_START_MEM
358200
EXT
.php
DS
/
THINK_PATH
/www/spcentry/website/thinkphp/
LIB_PATH
/www/spcentry/website/thinkphp/library/
CORE_PATH
/www/spcentry/website/thinkphp/library/think/
TRAIT_PATH
/www/spcentry/website/thinkphp/library/traits/
ROOT_PATH
/www/spcentry/website/
EXTEND_PATH
/www/spcentry/website/extend/
VENDOR_PATH
/www/spcentry/website/vendor/
RUNTIME_PATH
/www/spcentry/website/runtime/
LOG_PATH
/www/spcentry/website/runtime/log/
CACHE_PATH
/www/spcentry/website/runtime/cache/
TEMP_PATH
/www/spcentry/website/runtime/temp/
CONF_PATH
/www/spcentry/website/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false