| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\migrations;
- use common\models\rbac\AuthItem;
- use common\models\rbac\AuthItemChild;
- use yii\db\Migration;
- /**
- * Class M230818061320UpdateQimallRbacAuthItem
- */
- class M230818061320UpdateQimallRbacAuthItem extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $res = AuthItem::findOne(['id'=>'3313','name'=>'mall/addons/index','status'=>1]);
- if(!empty($res)){
- $res->status = -1;
- $res->save();
- AuthItemChild::deleteAll(['id'=>'3313','name'=>'mall/addons/index']);
- }
- $res = AuthItem::findOne(['id'=>'3370','name'=>'mall/addons/detail','status'=>1]);
- if(!empty($res)){
- $res->status = -1;
- $res->save();
- AuthItemChild::deleteAll(['id'=>'3370','name'=>'mall/addons/detail']);
- }
- }catch (\Exception $e){
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230818061320UpdateQimallRbacAuthItem cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230818061320UpdateQimallRbacAuthItem cannot be reverted.\n";
- return false;
- }
- */
- }
|