[0] ThrowableError in Mpacc.php line 29

类型错误: Argument 1 passed to app\index\controller\Mpacc::read() must be of the type int, string given

  1. public function index(){
  2. $assign[] ='';
  3. return view("index@$this->tpl/mpacc/index",$assign);
  4. }
  5. // 显示
  6. public function read(int $id){
  7. if($this->isAdmin){
  8. $data = InformationModel::where("id",$id)
  9. ->with("college")
  10. ->find();
  11. }else{

Call Stack

  1. in Mpacc.php line 29
  2. at Mpacc->read('suda')
  3. at ReflectionMethod->invokeArgs(object(Mpacc), ['suda']) in Container.php line 373
  4. at Container->invokeMethod([object(Mpacc), 'read'], ['id' => 'suda']) in App.php line 791
  5. at App->action('index/Mpacc/read', ['id' => 'suda'], 'controller', false) in Controller.php line 26
  6. at Controller->exec() in Dispatch.php line 168
  7. at Dispatch->run() in App.php line 432
  8. at App->think\{closure}(object(Request), object(Closure), null)
  9. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  10. at Middleware->think\{closure}(object(Request))
  11. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  12. at Middleware->dispatch(object(Request)) in App.php line 435
  13. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Session
guest { "User": { "sn": 0, "agent": 0, "ip": "54.226.25.246", "referer": null, "sessid": "6fa68kqqtp9g4j5l8tnj2usupb", "datetime": "2024-03-19 17:45;22", "isfirst": 1 } }
Server/Request Data
USER zkedu
HOME /var/www
HTTP_HOST www.mpacc.net
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
REDIRECT_STATUS 200
SERVER_NAME www.mpacc.net
SERVER_PORT 80
SERVER_ADDR 172.19.238.79
REMOTE_PORT 35028
REMOTE_ADDR 54.226.25.246
SERVER_SOFTWARE nginx/1.12.2
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /var/www/www.mpacc.net/public
DOCUMENT_URI /index.php
REQUEST_URI /mpacc/suda.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=//mpacc/suda.html
SCRIPT_FILENAME /var/www/www.mpacc.net/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710841522.0039
REQUEST_TIME 1710841522
Environment Variablesempty
ThinkPHP Constantsempty