CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused

/var/www/textile_club/http/protected/services/SeoFiltersService.php(48)

36                 $join = "LEFT JOIN categories c2 ON c2.id = c.category";
37             }
38 
39             $query = "
40                 SELECT ci.id ci_id, c.id c_id, ci.sort sort, c.sort sort2, ci.code as code
41                 FROM catalogitems ci 
42                 LEFT JOIN catalogs c ON c.id = ci.catalog
43                 $join
44                 WHERE $where ci.code = '$filterCode' AND c.seo = 1
45                 ORDER BY c.sort ASC, ci.sort ASC
46             ";
47 
48             if (!$filter = Yii::app()->db->createCommand($query)->queryRow()) {
49                 $this->errors[] = "Filter with code = $filterCode not found";
50                 break;
51             }
52 
53             $this->filters[$filterCode] = $filter;
54         }
55 
56         if ($category && $filters && !$this->errors) {
57             $this->createSeoPage($filters, $category);
58         }
59     }
60 

Stack Trace

#4
+
 /var/www/textile_club/http/protected/services/SeoFiltersService.php(48): CModule->__get("db")
43                 $join
44                 WHERE $where ci.code = '$filterCode' AND c.seo = 1
45                 ORDER BY c.sort ASC, ci.sort ASC
46             ";
47 
48             if (!$filter = Yii::app()->db->createCommand($query)->queryRow()) {
49                 $this->errors[] = "Filter with code = $filterCode not found";
50                 break;
51             }
52 
53             $this->filters[$filterCode] = $filter;
#5
+
 /var/www/textile_club/http/protected/services/SeoFiltersService.php(16): SeoFiltersService->prepare("avictory", "podushki")
11      * @return array
12      * @throws CException
13      */
14     public function convert(string $filters, string $category): array
15     {
16         $this->prepare($filters, $category);
17         if ($this->check($filters)) {
18             return $this->formatGetParams();
19         }
20 
21         throw new CHttpException(404, Yii::t('catalog', 'not_found'));
#6
+
 /var/www/textile_club/http/protected/controllers/SiteController.php(111): SeoFiltersService->convert("avictory", "podushki")
106 //       $id = $routeParams[0];
107 //    }
108 
109         if ($filter !== '') {
110             $service = new SeoFiltersService();
111             $this->jsParams['seoFilters'] = $service->convert($filter, $id);
112         }
113 
114         $service = new RedirectService(['catalog']);
115         $service->redirect(Yii::$app->request->url);
116 
2024-03-19 14:02:25 nginx/1.20.1 Yii Framework/1.1.20