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]); } }
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]); }
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; } }
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"; } }