Commit becac46d authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/explore' into 'master'

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