Commit 61b4eb5c authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/explore' into 'master'

fix See merge request !191
parents aa3207c8 fca68d1a
...@@ -28,7 +28,7 @@ class ExploreController extends BaseController ...@@ -28,7 +28,7 @@ class ExploreController extends BaseController
$val->name = $val->name[$this->lang]; $val->name = $val->name[$this->lang];
$apps_model = ExploreApp::find()->select('id, name, icon, type, app_url, slogan') $apps_model = ExploreApp::find()->select('id, name, icon, type, app_url, slogan')
->where(['app_category_id' => (int)$val->id]) ->where(['app_category_id' => (int)$val->id])
->orderBy('sort') ->orderBy('sort desc')
->limit($val->limit) ->limit($val->limit)
->all(); ->all();
foreach ($apps_model as &$app) { foreach ($apps_model as &$app) {
......
...@@ -54,7 +54,7 @@ class ExploreAppController extends BaseController ...@@ -54,7 +54,7 @@ class ExploreAppController extends BaseController
if (Yii::$app->request->isGet) { if (Yii::$app->request->isGet) {
$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)->limit($size)->asArray()->all(); $app_category_model = $query->offset(($page - 1) * $size)->orderBy('sort desc')->limit($size)->asArray()->all();
foreach ($app_category_model as &$val) { foreach ($app_category_model as &$val) {
$name = json_decode($val['name'], true); $name = json_decode($val['name'], true);
$val['name'] = $name; $val['name'] = $name;
...@@ -189,7 +189,7 @@ class ExploreAppController extends BaseController ...@@ -189,7 +189,7 @@ class ExploreAppController extends BaseController
$query = ExploreApp::find() $query = ExploreApp::find()
->where(['app_category_id' => $category_id]) ->where(['app_category_id' => $category_id])
->asArray(); ->asArray();
$app_model = $query->offset(($page - 1) * $size)->limit($size)->asArray()->all(); $app_model = $query->offset(($page - 1) * $size)->orderBy('sort desc')->limit($size)->asArray()->all();
foreach ($app_model as &$val) { foreach ($app_model as &$val) {
$name = json_decode($val['name'], true); $name = json_decode($val['name'], true);
$val['name'] = $name; $val['name'] = $name;
......
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