foreach($result as $a){ $a_search = $this->create_search_str_from_fields($a); $a_sum_pos = 0; # Чем меньше $a_sum_pos тем выше должно подниматься запись if (mb_stripos($a_search, $search_str . ' ') === 0) $a_sum_pos = -1500000; elseif (mb_stripos($a_search, $search_str) !== false) $a_sum_pos = -1000000; elseif (mb_stripos($a_search, $search_str_clean) !== false) $a_sum_pos = -100000; # Подсчет веса для слов из фразы, чем дальше слово тем ниже вес foreach ($search_arr as $key => $item) { $item = ($item); if (trim($item) != '') { $a_pos = mb_stripos($a_search, $item);
$a_sum_pos = 0; # Чем меньше $a_sum_pos тем выше должно подниматься запись if (mb_stripos($a_search, $search_str . ' ') === 0) $a_sum_pos = -1500000; elseif (mb_stripos($a_search, $search_str) !== false) $a_sum_pos = -1000000; elseif (mb_stripos($a_search, $search_str_clean) !== false) $a_sum_pos = -100000; # Подсчет веса для слов из фразы, чем дальше слово тем ниже вес foreach ($search_arr as $key => $item) {
$pricelist['TotalSearchResults'] = $this->FilterResultSearch($pricelist['TotalSearchResults'], $params["MinPrice"], $params["MaxPrice"], trim($params['DelivaryTime'])); } $statist['Filter'] = microtime(true) - $ttt; $ttt = microtime(true); // Сортируем $goods['TotalSearchResults'] = $this->SortResultSearch($goods['TotalSearchResults'], $params["Sort"], $params["name"]); $pricelist['TotalSearchResults'] = $this->SortResultSearch($pricelist['TotalSearchResults'], $params["Sort"], $params["name"]); $statist['Sort'] = microtime(true) - $ttt; $ttt = microtime(true); // Получаем группировки брендов для левой панели $brands = $this->GetBrandsFromSearch($goods["TotalSearchResults"], $params["name"]); // Устарело, проверить
$mysql_params["description"] = $search_str; list ($query, $result_mysql) = $this->search_db($mysql_params, $this->base->userCode); $statist['count/pr'] = count($result_mysql['TotalSearchResults']); $statist['search_pr'] = microtime(true) - $ttt; $ttt = microtime(true); $goods = $this->addPriceToGoods($params, $result_1c, $result_mysql);//Слияние прайсов и 1С $statist['t_add'] = microtime(true) - $ttt; if(isset($goods['statist'])) $statist['add'] = $goods['statist']; break; case '3'://Поиск по паре артикул/бренд
'Only_GAZ_Products' => $this->base->Only_GAZ_Products, ]; $userDb = new userDb(); list ($params2, $goods, $pricelist, $art_brand, $Cross) = $userDb->search_all2($params1, 0, 50); // $tecDoc = new tecDoc(); // $brands = $tecDoc->getCarBrands(); $brands = new CarBrandModel(); $sng = acat::getBrands(); return $this->render('brand', [
$args = $this->controller->bindActionParams($this, $params); Yii::trace('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); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
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();
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 = [ 'id' => 'auto-vaz', ]; $_SESSION = [ '__flash' => [], 'session_id' => 'e175b9dd84954d96469ca94f6ef2d02d', 'login' => 0, 'userId' => -1710815105, 'show_name_strg' => 'n', 'show_orig_price' => 'n', 'clients' => 'n', 'client_id' => '0', 'role' => 'unreg', 'liqpay' => 'N', 'userCode' => '', 'userName' => '', 'email' => '', 'phone' => '', 'basket' => [], 'order_par' => [], 'balance_par' => [], 'basketCount' => 0, 'basketCost' => 0, 'basketComment' => '', 'sort' => '0', 'resultSearchList' => '1', 'countNeudSpros' => 0, 'HideArticles' => 0, 'destForAddGoods' => [ 'type' => 'basket', ], 'Contract' => [], 'selLang' => 'ru-RU', 'alarmTime' => [], ];