[8] ErrorException in Chapters.php line 30

Indirect modification of overloaded property app\model\Chapter::$book has no effect

  1. {
  2. parent::initialize();
  3. $this->photoService = new PhotoService();
  4. }
  5. public function index($id)
  6. {
  7. $chapter = Chapter::with('book')->cache('chapter:' . $id, 600, 'redis')->find($id);
  8. if (empty($chapter->book->cover_url)) {
  9. $chapter->book->cover_url = $this->img_site.'/static/upload/book/'.$chapter->book_id.'/cover.jpg';
  10. }
  11. $flag = true;
  12. if ($chapter->book->start_pay >= 0) {
  13. if ($chapter->chapter_order >= $chapter->book->start_pay) { //如果本章序大于起始付费章节,则是付费章节
  14. $flag = false;
  15. }
  16. } else { //如果是倒序付费设置
  17. $abs = abs($chapter->book->start_pay) - 1; //取得倒序的绝对值,比如-2,则是倒数第2章开始付费
  18. $max_chapter_order = cache('maxChapterOrder:' . $chapter->book_id);

Call Stack

  1. in Chapters.php line 30
  2. at Error::appError(8, 'Indirect modificatio...', '/home/hhggm/htdocs/w...', 30, ['id' => '544325', 'chapter' => object(Chapter)]) in Chapters.php line 30
  3. at Chapters->index('544325')
  4. at ReflectionMethod->invokeArgs(object(Chapters), ['544325']) in Container.php line 395
  5. at Container->invokeReflectMethod(object(Chapters), object(ReflectionMethod), ['id' => '544325', 'convert' => false]) in Module.php line 132
  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 137
  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 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER hhggm
HOME /home/hhggm
HTTP_X_VARNISH 37281104
HTTP_ACCEPT_ENCODING gzip
HTTP_GRACE none
HTTP_X_FORWARDED_FOR 44.205.5.65, 172.70.38.82, 127.0.0.1
HTTP_CF_IPCOUNTRY US
HTTP_CDN_LOOP cloudflare
HTTP_CF_CONNECTING_IP 44.205.5.65
HTTP_REFERER http://shudm.com/chapter/544325
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_CF_VISITOR {"scheme":"https"}
HTTP_X_FORWARDED_PROTO https
HTTP_CF_RAY 86bb13079f5a39af-IAD
HTTP_X_REAL_IP 172.70.38.82
HTTP_X_FORWARDED_HOST llmmh.com
HTTP_HOST llmmh.com
PHP_VALUE error_log=/home/hhggm/logs/php/error.log; memory_limit=1G; max_execution_time=60; max_input_time=60; max_input_vars=10000; post_max_size=64M; upload_max_filesize=64M; auto_prepend_file=/home/hhggm/.varnish-cache/controller.php; date.timezone=UTC; display_errors=off;
HTTPS on
MGT 1
GEOIP_LONGITUDE
GEOIP_LATITUDE
GEOIP_CITY_CONTINENT_CODE
GEOIP_POSTAL_CODE
GEOIP_CITY
GEOIP_REGION
GEOIP_CITY_COUNTRY_NAME
GEOIP_CITY_COUNTRY_CODE3
GEOIP_CITY_COUNTRY_CODE
GEOIP_COUNTRY_NAME United States
GEOIP_COUNTRY_CODE3 USA
GEOIP_COUNTRY_CODE US
REDIRECT_STATUS 200
SERVER_NAME www.hhggm.com
SERVER_PORT 443
SERVER_ADDR 127.0.0.1
REMOTE_PORT
REMOTE_ADDR 172.70.38.82
SERVER_SOFTWARE nginx/1.21.4
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /home/hhggm/htdocs/www.hhggm.com/public
DOCUMENT_URI /index.php
REQUEST_URI /index.php?s=//chapter/544325
SCRIPT_NAME /index.php
SCRIPT_FILENAME /home/hhggm/htdocs/www.hhggm.com/public/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=//chapter/544325
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711665127.7548
REQUEST_TIME 1711665127
Environment Variablesempty
ThinkPHP Constants
VARNISH_DEVELOPER_MODE false
VARNISH_GENERIC_CONTROLLER_VERSION 0.0.1
BOOKCTRL book
CHAPTERCTRL chapter
TAGCTRL tag
BOOKLISTACT booklist
SEARCHCTRL search
RANKCTRL rank
UPDATEACT update
AUTHORCTRL author
spider_db_conn xxx