20230130102408_add_permission_copy_data_url.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class AddPermissionCopyDataUrl extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. //复制课程培训地址
  30. $info1 = \app\model\Permission::where([['auth_name', '=', '课程培训']])->find();
  31. $info1->relation = $info1->relation . ',train/addData';
  32. $info1->save();
  33. //复制拓客案例、拓客视频、拓客图文、公司实力、热装楼盘地址
  34. $info2 = \app\model\Permission::where([['auth_name', '=', '拓客案例']])->find();
  35. $info2->relation = $info2->relation . ',material/copy_materialcase,material/copy_video,material/copy_article,material/copy_companystrength,material/copy_building';
  36. $info2->save();
  37. //复制客户好评地址
  38. $info3 = \app\model\Permission::where([['auth_name', '=', '客户好评']])->find();
  39. $info3->relation = $info3->relation . ',material/copy_materialevidence';
  40. $info3->save();
  41. //复制话术管理地址
  42. $info4 = \app\model\Permission::where([['auth_name', '=', '话术管理']])->find();
  43. $info4->relation = $info4->relation . ',talkskill/copy_talkskill';
  44. $info4->save();
  45. //复制成功案例话术地址
  46. $info5 = \app\model\Permission::where([['auth_name', '=', '成功案例']])->find();
  47. $info5->relation = $info5->relation . ',talkskill/copy_talkskill_success';
  48. $info5->save();
  49. //复制精选话术地址
  50. $info6 = \app\model\Permission::where([['auth_name', '=', '精选话术']])->find();
  51. $info6->relation = $info6->relation . ',talkskill/copy_talkskill_chosen';
  52. $info6->save();
  53. }
  54. }