コード例 #1
0
 public function actionModalPodCategory()
 {
     $post = Yii::$app->request->post();
     $id = $post["id_category"];
     $query = FCategory::find()->where(['parent_id' => $id]);
     $FCategory = $query->all();
     if ($query->count() == 0) {
         return "no";
     } else {
         return $this->renderPartial('modalPodCategory', ['category' => $FCategory]);
     }
 }
コード例 #2
0
ファイル: SiteController.php プロジェクト: a7000q/yasvoboden
 public function actionTarif()
 {
     $FCategory = FCategory::find()->where(["bool_item" => 1])->all();
     $RPages = RPages::findOne(["page_name" => 'tarif']);
     return $this->render('tarif', ["categories" => $FCategory, 'page' => $RPages]);
 }
コード例 #3
0
ファイル: FCategory.php プロジェクト: a7000q/yasvoboden
 public function getArrayUsers()
 {
     if ($this->bool_item == 1) {
         $items = RItems::find()->where(['id_parent' => $this->id])->all();
         foreach ($items as $item) {
             $id_user[] = $item->id_user;
         }
     } else {
         $cats = FCategory::find()->where(['parent_id' => $this->id])->all();
         $id_user = array();
         foreach ($cats as $cat) {
             if ($cat->arrayUsers) {
                 $id_user = ArrayHelper::merge($id_user, $cat->arrayUsers);
             }
         }
     }
     if (isset($id_user) and count($id_user) > 0) {
         return $id_user;
     } else {
         return false;
     }
 }
コード例 #4
0
ファイル: UserController.php プロジェクト: a7000q/yasvoboden
 public function actionPodCategory()
 {
     $post = Yii::$app->request->post();
     $FCategory = FCategory::find()->where(['parent_id' => $post["id_category"]])->orderBy('name')->all();
     $cat = FCategory::findOne($post["id_category"]);
     if (count($FCategory) > 0) {
         return $this->renderPartial('modalPodCategory', ['categoryes' => $FCategory, 'cat' => $cat]);
     } else {
         return "no";
     }
 }