| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230717091035InsertIntoMenu
- */
- class M230717091035InsertIntoMenu extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $list = $this->db->createCommand("select * from qimall_menu where title like '%关注回复%' ")->queryAll();
- if($list) return true;
- $this->insert('qimall_menu',[
- 'title'=>'关注回复',
- 'app_id'=>'backend',
- 'cate_id'=>'2',
- 'addons_name'=>'',
- 'is_addon'=>'0',
- 'pid'=>'77',
- 'url'=>'mall/wechat/follow-reply-rule',
- 'icon'=>'',
- 'level'=>'3',
- 'dev'=>'3',
- 'sort'=>'999',
- //'params'=>'',
- 'tree'=>'tr_39 tr_77',
- 'status'=>'1',
- 'created_at'=>1631687277,
- 'updated_at'=>1631687277,
- ]);
- $this->insert('qimall_rbac_auth_item',[
- 'name'=>'mall/wechat/follow-reply-rule',
- 'title'=>'关注回复',
- 'app_id'=>'backend',
- 'addons_name'=>'',
- 'pid'=>'2824',
- 'level'=>'2',
- 'is_addon'=>'0',
- 'sort'=>'999',
- 'tree'=>'tr_0 tr_2824',
- 'status'=>'1',
- 'cate_id'=>'2',
- 'created_at'=>1631687277,
- 'updated_at'=>1631687277,
- ]);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230717091035InsertIntoMenu cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230717091035InsertIntoMenu cannot be reverted.\n";
- return false;
- }
- */
- }
|