CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't.rely_org' in 'where clause'. The SQL statement executed was: SELECT COUNT(DISTINCT `t`.`ID`) FROM `tinstrument` `t` LEFT OUTER JOIN `tuser` `rInsManagerUser` ON (`t`.`ManagerMasterID`=`rInsManagerUser`.`ID`) LEFT OUTER JOIN `tinstrumenttype` `rCategory` ON (`t`.`InstrumentTypeID`=`rCategory`.`ID`) LEFT OUTER JOIN `torganization` `rOrg` ON (`t`.`OrganizationID`=`rOrg`.`ID`) WHERE ((t.DeletedID IS NULL AND t.InstrumentStatusID IN (231,232)) AND ((t.InstrumentTypeID=:ycp0) AND (t.rely_org IS NULL)))

/www/wwwroot/framework/db/CDbCommand.php(543)

531         {
532             if($this->_connection->enableProfiling)
533                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534 
535             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536             $message=$e->getMessage();
537             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539 
540             if(YII_DEBUG)
541                 $message.='. The SQL statement executed was: '.$this->getText().$par;
542 
543             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545         }
546     }
547 
548     /**
549      * Builds a SQL SELECT statement from the given query specification.
550      * @param array $query the query specification in name-value pairs. The following
551      * query options are supported: {@link select}, {@link distinct}, {@link from},
552      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553      * {@link limit}, {@link offset} and {@link union}.
554      * @throws CDbException if "from" key is not present in given query parameter
555      * @return string the SQL statement

Stack Trace

#4
+
 /www/wwwroot/lims/protected/modules/portal/controllers/InstrumentController.php(74): CActiveRecord->count(CDbCriteria)
69         //所属单位查询 orgnum
70         $num=trim(Yii::app()->request->getQuery('num'));
71         if($num)
72             $cri->compare('t.OrgNum', $num);
73 
74         $count=CAR_Tinstrument::model()->portalshow()->count($cri);
75         $pager=new CPagination($count);
76         $pager->pageSize=6;
77         $pager->applyLimit($cri);
78         $lists=CAR_Tinstrument::model()->portalshow()->findAll($cri);
79 
#12
+
 /www/wwwroot/lims/index.php(27): CApplication->run()
22 define('WWWPATH', str_replace(array('\\', '\\\\'), '/', dirname(__FILE__)));
23 require_once($yii);
24 
25 require_once($app);
26 $app = new JWebApplication($config);
27 $app->run();
28 
2024-03-28 23:37:38 nginx/1.18.0 Yii Framework/1.1.16