Commit c47176be authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into 'master'

fix See merge request !451
parents c91f572e a3fb4abe
......@@ -18,19 +18,19 @@ class ExploreAppController extends BaseController
$data = null;
$page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 10);
$platform_id = Yii::$app->request->getPlatformId();
if (1 == $platform_id) {
$param_platform_id = Yii::$app->request->get('platform_id', '');
if (false != $param_platform_id) {
$platform_id = $param_platform_id;
}
}
$group = Yii::$app->request->getGroup();
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->setScenario(ExploreAppCategory::SCENARIOS_CREATE);
$params = Yii::$app->request->post();
$params['platform_id'] = $platform_id;
$name_arr = $params['name'];
$name = [];
......@@ -48,6 +48,11 @@ class ExploreAppController extends BaseController
}
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();
$app_category_model = $query->offset(($page - 1) * $size)->orderBy('sort')->limit($size)->asArray()->all();
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