Commit a3fb4abe authored by shajiaiming's avatar shajiaiming

fix

parent c91f572e
...@@ -18,19 +18,19 @@ class ExploreAppController extends BaseController ...@@ -18,19 +18,19 @@ class ExploreAppController extends BaseController
$data = null; $data = null;
$page = Yii::$app->request->get('page', 1); $page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 10); $size = Yii::$app->request->get('size', 10);
$platform_id = Yii::$app->request->getPlatformId();
if (1 == $platform_id) { $group = Yii::$app->request->getGroup();
$param_platform_id = Yii::$app->request->get('platform_id', '');
if (false != $param_platform_id) {
$platform_id = $param_platform_id;
}
}
if (Yii::$app->request->isPost) { if (Yii::$app->request->isPost) {
$params = Yii::$app->request->post();
if ('administrator' == $group) {
$params['platform_id'] = $params['platform_id'];
} else {
$params['platform_id'] = Yii::$app->request->getPlatformId();
}
$model = new ExploreAppCategory(); $model = new ExploreAppCategory();
$model->setScenario(ExploreAppCategory::SCENARIOS_CREATE); $model->setScenario(ExploreAppCategory::SCENARIOS_CREATE);
$params = Yii::$app->request->post();
$params['platform_id'] = $platform_id;
$name_arr = $params['name']; $name_arr = $params['name'];
$name = []; $name = [];
...@@ -48,6 +48,11 @@ class ExploreAppController extends BaseController ...@@ -48,6 +48,11 @@ class ExploreAppController extends BaseController
} }
if (Yii::$app->request->isGet) { if (Yii::$app->request->isGet) {
$platform_id = Yii::$app->request->getPlatformId();
if ('administrator' == $group) {
$platform_id = Yii::$app->request->get('platform_id', 1);
}
$query = ExploreAppCategory::find()->where(['platform_id' => $platform_id])->asArray(); $query = ExploreAppCategory::find()->where(['platform_id' => $platform_id])->asArray();
$app_category_model = $query->offset(($page - 1) * $size)->orderBy('sort')->limit($size)->asArray()->all(); $app_category_model = $query->offset(($page - 1) * $size)->orderBy('sort')->limit($size)->asArray()->all();
foreach ($app_category_model as &$val) { foreach ($app_category_model as &$val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment