12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class AddPermissionCopyDataUrl extends Migrator
- {
- /**
- * Change Method.
- *
- * Write your reversible migrations using this method.
- *
- * More information on writing migrations is available here:
- * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
- *
- * The following commands can be used in this method and Phinx will
- * automatically reverse them when rolling back:
- *
- * createTable
- * renameTable
- * addColumn
- * renameColumn
- * addIndex
- * addForeignKey
- *
- * Remember to call "create()" or "update()" and NOT "save()" when working
- * with the Table class.
- */
- public function change()
- {
- //复制课程培训地址
- $info1 = \app\model\Permission::where([['auth_name', '=', '课程培训']])->find();
- $info1->relation = $info1->relation . ',train/addData';
- $info1->save();
- //复制拓客案例、拓客视频、拓客图文、公司实力、热装楼盘地址
- $info2 = \app\model\Permission::where([['auth_name', '=', '拓客案例']])->find();
- $info2->relation = $info2->relation . ',material/copy_materialcase,material/copy_video,material/copy_article,material/copy_companystrength,material/copy_building';
- $info2->save();
- //复制客户好评地址
- $info3 = \app\model\Permission::where([['auth_name', '=', '客户好评']])->find();
- $info3->relation = $info3->relation . ',material/copy_materialevidence';
- $info3->save();
- //复制话术管理地址
- $info4 = \app\model\Permission::where([['auth_name', '=', '话术管理']])->find();
- $info4->relation = $info4->relation . ',talkskill/copy_talkskill';
- $info4->save();
- //复制成功案例话术地址
- $info5 = \app\model\Permission::where([['auth_name', '=', '成功案例']])->find();
- $info5->relation = $info5->relation . ',talkskill/copy_talkskill_success';
- $info5->save();
- //复制精选话术地址
- $info6 = \app\model\Permission::where([['auth_name', '=', '精选话术']])->find();
- $info6->relation = $info6->relation . ',talkskill/copy_talkskill_chosen';
- $info6->save();
- }
- }
|