Skip to content

Commit

Permalink
'模块配置bug'
Browse files Browse the repository at this point in the history
  • Loading branch information
yidashi committed Feb 17, 2017
1 parent 6cf6d98 commit c706cf9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion backend/controllers/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function actionConfig($id)
Yii::$app->session->setFlash('error', '插件没安装');
return $this->redirect(['index']);
}
$configs = $module->getConfig();
$configs = Json::decode($module->getModel()->config);
$configModels = [];
if (!empty($configs)) {
foreach ($configs as $k => $config) {
Expand Down
2 changes: 1 addition & 1 deletion backend/controllers/PluginsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function actionConfig($id)
Yii::$app->session->setFlash('error', '插件没安装');
return $this->redirect(['index']);
}
$configs = $plugin->getConfig();
$configs = Json::decode($plugin->getModel()->config);
$configModels = [];
if (!empty($configs)) {
foreach ($configs as $k => $config) {
Expand Down
2 changes: 1 addition & 1 deletion common/models/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function rules()
[['status', 'type'], 'integer'],
[['type'], 'in', 'range' => [1,2]],
[['name'], 'string', 'max' => 50],
[['class', 'bootstrap'], 'string', 'max' => 128],
[['bootstrap'], 'string', 'max' => 128],
[['config'], 'string'],
['status', 'default', 'value' => 1],
[['id'], 'unique'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Handles the creation for table `{{%module}}`.
*/
class m160702_101410_create_plugins extends Migration
class m160702_101410_create_module extends Migration
{
/**
* @inheritdoc
Expand All @@ -20,7 +20,6 @@ public function up()
'id' => $this->string(50)->notNull()->unique()->comment('标识'),
'name' => $this->string(50)->notNull(),
'bootstrap' => $this->string(128)->comment('模块初始化应用ID'),
'class' => $this->string(128)->comment('模块类'),
'status' => $this->smallInteger(1)->notNull(),
'type' => $this->smallInteger(1)->notNull()->comment('模块类型1core2plugin'),
'config' => $this->text()->comment('配置'),
Expand All @@ -32,7 +31,6 @@ public function up()
'id' => 'user',
'name' => '用户模块',
'bootstrap' => 'app-frontend|app-backend',
'class' => 'common\\modules\\user\\Module',
'status' => 1,
'type' => 1,
'created_at' => time(),
Expand All @@ -42,7 +40,6 @@ public function up()
'id' => 'message',
'name' => '站内信模块',
'bootstrap' => 'app-frontend|app-backend',
'class' => 'common\\modules\\message\\Module',
'status' => 1,
'type' => 1,
'created_at' => time(),
Expand All @@ -51,7 +48,6 @@ public function up()
$this->insert('{{%module}}', [
'id' => 'city',
'name' => '城市模块',
'class' => 'common\\modules\\city\\Module',
'status' => 1,
'type' => 1,
'created_at' => time(),
Expand All @@ -61,7 +57,6 @@ public function up()
'id' => 'config',
'name' => '动态配置',
'bootstrap' => 'app-frontend|app-backend|app-console',
'class' => 'common\\modules\\config\\Module',
'status' => 1,
'type' => 1,
'created_at' => time(),
Expand All @@ -70,7 +65,6 @@ public function up()
$this->insert('{{%module}}', [
'id' => 'area',
'name' => '前台动态区域',
'class' => 'common\\modules\\area\\Module',
'status' => 1,
'type' => 1,
'created_at' => time(),
Expand Down

0 comments on commit c706cf9

Please sign in to comment.