Copied! Copy Stacktrace Search Stackoverflow Search Google Exception

bet9九州官方网页登录|首页-欢迎您访问!!

Call to a member function updateCounters() on null

  • 1. in /home/wwwroot/www.gxjt.net/models/model_data/AdminContentNewsMain_Data.php at line 47
    38394041424344454647484950515253545556
            return $rdata;
        }
     
    	/**
         * 修改阅读数
         */
        public static function Set_Readnum($content_id)
        {
    		$post = AdminContentNewsMain_Data::find()->where(['content_id' => $content_id])->one();
    		$post->updateCounters(['readnum' => 1]);
        }
     
    	/**
         * 写入数据
         */
        public function InsertData($data,$id)
        {
    		$rid=0;
    		if(!empty($data)&&!empty($id)){
    
  • 2. in /home/wwwroot/www.gxjt.net/controllers/SiteController.php at line 358 – app\models\model_data\AdminContentNewsMain_Data::Set_Readnum(19842)
    352353354355356357358359360361362363364
    		}else{
    			$id=19842;
    		}
     
    		$model=AdminContentNews_Data::find()->where(['id' => $id])->one();
            $model_data=AdminContentNewsMain_Data::find()->where(['content_id' => $id])->one();
    		AdminContentNewsMain_Data::Set_Readnum($id);
    		return $this->render('jtbusiness', [
    			'cid' => $columnid,
    			'mroute' => $mroute,
    			'model' => $model,
                'model_data' => $model_data,
             ]);
    
  • 3. app\controllers\SiteController::actionJtbusiness()
  • 4. in /home/wwwroot/www.gxjt.net/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array([app\controllers\SiteController, 'actionJtbusiness'], [])
    515253545556575859
            $args = $this->controller->bindActionParams($this, $params);
            Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__);
            if (Yii::$app->requestedParams === null) {
                Yii::$app->requestedParams = $args;
            }
     
            return call_user_func_array([$this->controller, $this->actionMethod], $args);
        }
    }
    
  • 5. in /home/wwwroot/www.gxjt.net/vendor/yiisoft/yii2/base/Controller.php at line 157 yii\base\InlineAction::runWithParams(['r' => 'site/jtbusiness', 'cid' => '17'])
    151152153154155156157158159160161162163
            }
     
            $result = null;
     
            if ($runAction && $this->beforeAction($action)) {
                // run the action
                $result = $action->runWithParams($params);
     
                $result = $this->afterAction($action, $result);
     
                // call afterAction on modules
                foreach ($modules as $module) {
                    /* @var $module Module */
    
  • 6. in /home/wwwroot/www.gxjt.net/vendor/yiisoft/yii2/base/Module.php at line 528 yii\base\Controller::runAction('jtbusiness', ['r' => 'site/jtbusiness', 'cid' => '17'])
    522523524525526527528529530531532533534
            $parts = $this->createController($route);
            if (is_array($parts)) {
                /* @var $controller Controller */
                list($controller, $actionID) = $parts;
                $oldController = Yii::$app->controller;
                Yii::$app->controller = $controller;
                $result = $controller->runAction($actionID, $params);
                if ($oldController !== null) {
                    Yii::$app->controller = $oldController;
                }
     
                return $result;
            }
    
  • 7. in /home/wwwroot/www.gxjt.net/vendor/yiisoft/yii2/web/Application.php at line 103 yii\base\Module::runAction('site/jtbusiness', ['r' => 'site/jtbusiness', 'cid' => '17'])
    979899100101102103104105106107108109
                $params = $this->catchAll;
                unset($params[0]);
            }
            try {
                Yii::debug("Route requested: '$route'", __METHOD__);
                $this->requestedRoute = $route;
                $result = $this->runAction($route, $params);
                if ($result instanceof Response) {
                    return $result;
                }
     
                $response = $this->getResponse();
                if ($result !== null) {
    
  • 8. in /home/wwwroot/www.gxjt.net/vendor/yiisoft/yii2/base/Application.php at line 386 yii\web\Application::handleRequest(yii\web\Request)
    380381382383384385386387388389390391392
        {
            try {
                $this->state = self::STATE_BEFORE_REQUEST;
                $this->trigger(self::EVENT_BEFORE_REQUEST);
     
                $this->state = self::STATE_HANDLING_REQUEST;
                $response = $this->handleRequest($this->getRequest());
     
                $this->state = self::STATE_AFTER_REQUEST;
                $this->trigger(self::EVENT_AFTER_REQUEST);
     
                $this->state = self::STATE_SENDING_RESPONSE;
                $response->send();
    
  • 9. in /home/wwwroot/www.gxjt.net/web/index.php at line 12 yii\base\Application::run()
    6789101112
     
    require __DIR__ . '../../vendor/autoload.php';
    require __DIR__ . '../../vendor/yiisoft/yii2/Yii.php';
     
    $config = require __DIR__ . '/../config/web.php';
     
    (new yii\web\Application($config))->run();
    
  • $_GET = [
        'r' => 'site/jtbusiness',
        'cid' => '17',
    ];