Commit 5458cbb6 authored by shajiaiming's avatar shajiaiming

fix

parent 05fe32a9
......@@ -22,7 +22,7 @@ class ExploreController extends BaseController
goto doEnd;
}
$app_category_model = ExploreAppCategory::find()->where(['platform_id' => $platform_id])->all();
$app_category_model = ExploreAppCategory::find()->where(['platform_id' => $platform_id, 'status' => ExploreAppCategory::STATUS_ON])->all();
foreach ($app_category_model as &$val) {
unset($val->apps);
$val->name = $val->name[$this->lang];
......
......@@ -7,6 +7,8 @@ use common\core\BaseActiveRecord;
class ExploreAppCategory extends BaseActiveRecord
{
const STATUS_ON = 1; //激活
const STATUS_OFF = 0; //未激活
public static function getDb()
{
......@@ -26,7 +28,7 @@ class ExploreAppCategory extends BaseActiveRecord
public function rules()
{
return [
[['name', 'sort', 'limit', 'style', 'platform_id'], 'required'],
[['name', 'sort', 'limit', 'style', 'platform_id', 'status'], 'required'],
];
}
......@@ -38,8 +40,8 @@ class ExploreAppCategory extends BaseActiveRecord
public function scenarios()
{
$scenarios = [
self:: SCENARIOS_CREATE => ['name', 'sort', 'limit', 'style', 'platform_id'],
self:: SCENARIOS_UPDATE => ['name', 'sort', 'limit', 'style', 'platform_id'],
self:: SCENARIOS_CREATE => ['name', 'sort', 'limit', 'style', 'platform_id', 'status'],
self:: SCENARIOS_UPDATE => ['name', 'sort', 'limit', 'style', 'platform_id', 'status'],
];
return array_merge(parent:: scenarios(), $scenarios);
}
......@@ -50,7 +52,8 @@ class ExploreAppCategory extends BaseActiveRecord
'name' => '应用分类名称',
'sort' => '应用分类排序',
'limit' => '该分类下首页可显示的应用数量',
'style' => '应用分类展示样式'
'style' => '应用分类展示样式',
'status' => '应用分类状态'
];
}
......
......@@ -78,7 +78,7 @@ class ExploreAppController extends BaseController
if (Yii::$app->request->isGet) {
$id = Yii::$app->request->get('id');
$data = ExploreAppCategory::find()->select('id, name, sort, limit, style')->where(['platform_id' => $platform_id, 'id' => $id])->asArray()->one();
$data = ExploreAppCategory::find()->select('id, name, sort, limit, style, status')->where(['platform_id' => $platform_id, 'id' => $id])->asArray()->one();
goto doEnd;
}
......
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