Error Info: Array ( [0] => 23000 [1] => 1052 [2] => Column 'status' in where clause is ambiguous )
in /var/www/domains/doctor-arbitailo/vendor/yiisoft/yii2/db/Command.php at line 1290
} $exceptionClass = '\yii\db\Exception'; foreach ($this->exceptionMap as $error => $class) { if (strpos($e->getMessage(), $error) !== false) { $exceptionClass = $class; } } $message = $e->getMessage() . "\nThe SQL being executed was: $rawSql"; $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null; return new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e); } /** * Returns a value indicating whether a SQL statement is for read purpose. * @param string $sql the SQL statement * @return bool whether a SQL statement is for read purpose. */ public function isReadQuery($sql) { $pattern = '/^\s*(SELECT|SHOW|DESCRIBE)\b/i';
} else { $this->pdoStatement->execute(); } break; } catch (\Exception $e) { $rawSql = $rawSql ?: $this->getRawSql(); $e = $this->db->getSchema()->convertException($e, $rawSql); if ($this->_retryHandler === null || !call_user_func($this->_retryHandler, $e, $attempt)) { throw $e; } } } }
$this->prepare(true); try { $profile and Yii::beginProfile($rawSql, 'yii\db\Command::query'); $this->internalExecute($rawSql); if ($method === '') { $result = new DataReader($this); } else { if ($fetchMode === null) { $fetchMode = $this->fetchMode;
* @return array all rows of the query result. Each array element is an array representing a row of data. * An empty array is returned if the query results in nothing. * @throws Exception execution failed */ public function queryAll($fetchMode = null) { return $this->queryInternal('fetchAll', $fetchMode); } /** * Executes the SQL statement and returns the first row of the result. * This method is best used when only the first row of result is needed for a query. * @param int $fetchMode the result fetch mode. Please refer to [PHP manual](http://php.net/manual/en/pdostatement.setfetchmode.php)
*/ public function all($db = null) { if ($this->emulateExecution) { return []; } $rows = $this->createCommand($db)->queryAll(); return $this->populate($rows); } /** * Converts the raw query results into the format as specified by this query. * This method is internally used to convert the data fetched from database
* @param Connection $db the DB connection used to create the DB command. * If null, the DB connection returned by [[modelClass]] will be used. * @return array|ActiveRecord[] the query results. If the query results in nothing, an empty array will be returned. */ public function all($db = null) { return parent::all($db); } /** * {@inheritdoc} */ public function prepare($builder)
/** * {@inheritdoc} * @return \common\models\ServicesType[]|array */ public function all($db = null) { return parent::all($db); } /** * {@inheritdoc} * @return \common\models\ServicesType|array|null */
$queryServicesTypes = ServicesType::find()->active()->andWhere('status = :status',[':status'=>1])->defaultSort()->asArray(); if ($idService) { $queryServicesTypes->rightJoin('services_prices', '`services_prices`.`service_id`=:service_id', [':service_id' => $idService]) ->rightJoin('prices', '`prices`.`id`=`services_prices`.`price_id` and `prices`.`service_type_id`=`services_type`.`id`'); } $this->servicesTypes = $queryServicesTypes->all(); $this->getPrices($this->branches, $offset, $idType, $idService, $search, $branche_id); $this->services = Services::find()->select('id,title,url')->active()->sortAsc()->asArray()->all(); } public function getPrices(&$branches, $offset = 0, $idType = null, $idService = null, $search = null, $branche_id = null) {
if ($branche !== null) { $branche = Branches::find()->select('id')->active()->andWhere(['url' => $branche])->scalar(); } if ($service !== null) { $service = Services::find()->select('id')->active()->andWhere(['url' => $service])->scalar(); } $this->getData(0, null, $service, null, $branche); $bid_res_an = new BidResultAnalysis(); $result = $this->render('index-prices', [ 'branches' => $this->branches, 'services' => $this->services, 'servicesTypes' => $this->servicesTypes,
$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); } }
} $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 */
$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; }
$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) {
{ 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); // if($_SERVER['REQUEST_URI'] == '/prices/') // error_log(" 00 ".time()." index {$_SERVER['REQUEST_URI']}");
require __DIR__ . '/../../common/config/main-local.php', require __DIR__ . '/../config/main.php', require __DIR__ . '/../config/main-local.php' ); // if($_SERVER['REQUEST_URI'] == '/prices/') // error_log(" 00 ".time()." index {$_SERVER['REQUEST_URI']}"); (new yii\web\Application($config))->run(); // if($_SERVER['REQUEST_URI'] == '/prices/') // error_log(" 01 ".time()." index {$_SERVER['REQUEST_URI']}");
$_GET = [ 'branche' => 'detskoe-otdelenie', 'service' => 'geneticheskie-issledovaniya', ];