1
0

20220627062028_create_datas_medals.php 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. use app\model\Medal;
  5. use app\model\EmployeeMedal;
  6. class CreateDatasMedals extends Migrator
  7. {
  8. /**
  9. * Change Method.
  10. *
  11. * Write your reversible migrations using this method.
  12. *
  13. * More information on writing migrations is available here:
  14. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  15. *
  16. * The following commands can be used in this method and Phinx will
  17. * automatically reverse them when rolling back:
  18. *
  19. * createTable
  20. * renameTable
  21. * addColumn
  22. * renameColumn
  23. * addIndex
  24. * addForeignKey
  25. *
  26. * Remember to call "create()" or "update()" and NOT "save()" when working
  27. * with the Table class.
  28. */
  29. public function change()
  30. {
  31. (new Medal())->where('1=1')->delete();
  32. (new EmployeeMedal())->where('1=1')->delete();
  33. $data = [
  34. ['title'=>10 ,'content'=>'累计学完10门课程','type'=>'class','condition'=>10 ,'remark'=>'学完课程' ,'path'=>'Train/62b8110fc8f3c.png'],
  35. ['title'=>20 ,'content'=>'累计学完20门课程','type'=>'class','condition'=>20 ,'remark'=>'学完课程' ,'path'=>'Train/62b8110fc8f3c.png'],
  36. ['title'=>30 ,'content'=>'累计学完30门课程','type'=>'class','condition'=>30,'remark'=>'学完课程' ,'path'=>'Train/62b8110fc8f3c.png'],
  37. ['title'=>'达人','content'=>'累计学完50门课程','type'=>'class','condition'=>50 ,'remark'=>'能力提升' ,'path'=>'Train/62b811220f4be.png'],
  38. ['title'=> 10,'content'=>'累计获客10人','type'=>'clue','condition'=>10 ,'remark'=>'客户浏览' ,'path'=>'Train/62b80f64c07a4.png'],
  39. ['title'=> 30,'content'=>'累计获客30人','type'=>'clue','condition'=>30 ,'remark'=>'客户浏览' ,'path'=>'Train/62b80f64c07a4.png'],
  40. ['title'=> 60,'content'=>'累计获客60人','type'=>'clue','condition'=> 60,'remark'=>'客户浏览' ,'path'=>'Train/62b80f64c07a4.png'],
  41. ['title'=> '达人','content'=>'累计获客90人','type'=>'clue','condition'=> 90,'remark'=>'品牌触达' ,'path'=>'Train/62b80f7d48625.png'],
  42. ['title'=> 10,'content'=>'累计回答10条','type'=>'comment','condition'=> 10,'remark'=>'话术回答' ,'path'=>'Train/62b810595d8a3.png'],
  43. ['title'=> 30,'content'=>'累计回答30条','type'=>'comment','condition'=> 30,'remark'=>'话术回答' ,'path'=>'Train/62b810595d8a3.png'],
  44. ['title'=> 60,'content'=>'累计回答60条','type'=>'comment','condition'=> 60,'remark'=>'话术回答' ,'path'=>'Train/62b810595d8a3.png'],
  45. ['title'=> '达人','content'=>'累计回答90条','type'=>'comment','condition'=> 90,'remark'=>'答疑解惑' ,'path'=>'Train/62b8107183191.png'],
  46. ['title'=> 7,'content'=>'累计签到7天','type'=>'sign','condition'=> 7,'remark'=>'登录天数' ,'path'=>'Train/62b814736e5ce.png'],
  47. ['title'=> 30,'content'=>'累计签到30天','type'=>'sign','condition'=> 30,'remark'=>'登录天数' ,'path'=>'Train/62b814736e5ce.png'],
  48. ['title'=> 60,'content'=>'累计签到60天','type'=>'sign','condition'=> 60,'remark'=>'登录天数' ,'path'=>'Train/62b814736e5ce.png'],
  49. ['title'=> '达人','content'=>'累计签到365天','type'=>'sign','condition'=> 365,'remark'=>'系统使用' ,'path'=>'Train/62b81493b86e9.png'],
  50. ['title'=> 100,'content'=>'累计跟进100次','type'=>'visit_log','condition'=>100 ,'remark'=>'跟进次数' ,'path'=>'Train/62b814b8ad89a.png'],
  51. ['title'=> 300,'content'=>'累计跟进300次','type'=>'visit_log','condition'=> 300,'remark'=>'跟进次数' ,'path'=>'Train/62b814b8ad89a.png'],
  52. ['title'=> 500,'content'=>'累计跟进500次','type'=>'visit_log','condition'=>500 ,'remark'=>'跟进次数' ,'path'=>'Train/62b814b8ad89a.png'],
  53. ['title'=> '达人','content'=>'累计跟进1000次','type'=>'visit_log','condition'=>1000 ,'remark'=>'客户维护' ,'path'=>'Train/62b814cf3d61e.png'],
  54. ];
  55. (new Medal())->saveAll($data);
  56. }
  57. }