Commit 155b354d authored by shajiaiming's avatar shajiaiming

fix

parent 817b744e
...@@ -14,11 +14,11 @@ class ExploreController extends BaseController ...@@ -14,11 +14,11 @@ class ExploreController extends BaseController
{ {
$header = Yii::$app->request->headers; $header = Yii::$app->request->headers;
$platform_id = $header['FZM-PLATFORM-ID'] ?? null; $platform_id = $header['FZM-PLATFORM-ID'] ?? null;
$data = null;
if (false == $platform_id) { if (false == $platform_id) {
$msg = '参数错误'; $msg = '参数错误';
$code = -1; $code = -1;
$data = null;
goto doEnd; goto doEnd;
} }
...@@ -26,7 +26,6 @@ class ExploreController extends BaseController ...@@ -26,7 +26,6 @@ class ExploreController extends BaseController
if (false == $app_category_model) { if (false == $app_category_model) {
$msg = 'success'; $msg = 'success';
$code = 0; $code = 0;
$data = null;
goto doEnd; goto doEnd;
} }
foreach ($app_category_model as $key => $val) { foreach ($app_category_model as $key => $val) {
...@@ -72,6 +71,12 @@ class ExploreController extends BaseController ...@@ -72,6 +71,12 @@ class ExploreController extends BaseController
} }
$app_category_model = ExploreAppCategory::find()->where(['id' => (int)$category_id, 'platform_id' => $platform_id])->all(); $app_category_model = ExploreAppCategory::find()->where(['id' => (int)$category_id, 'platform_id' => $platform_id])->all();
if (false == $app_category_model) {
$msg = 'success';
$code = 0;
$data = null;
goto doEnd;
}
foreach ($app_category_model as &$val) { foreach ($app_category_model as &$val) {
foreach ($val->applications as $app) { foreach ($val->applications as $app) {
$app->name = $app->name[$this->lang]; $app->name = $app->name[$this->lang];
...@@ -112,6 +117,12 @@ class ExploreController extends BaseController ...@@ -112,6 +117,12 @@ class ExploreController extends BaseController
->orderBy([$order => true]) ->orderBy([$order => true])
->limit(4) ->limit(4)
->all(); ->all();
if (false == $apps_model) {
$msg = 'success';
$code = 0;
$data = null;
goto doEnd;
}
foreach ($apps_model as &$app) { foreach ($apps_model as &$app) {
$app->name = $app->name[$this->lang]; $app->name = $app->name[$this->lang];
} }
......
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