1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- use app\model\Medal;
- use app\model\EmployeeMedal;
- class AddDataForMedal 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()
- {
- (new Medal())->where('1=1')->delete();
- (new EmployeeMedal())->where('1=1')->delete();
- $data = [
- ['title'=>10 ,'content'=>'累计学完10门课程','type'=>'class','condition'=>10 ,'remark'=>'学完课程' ,'path'=>'Train/62b9c006585f3.png'],
- ['title'=>20 ,'content'=>'累计学完20门课程','type'=>'class','condition'=>20 ,'remark'=>'学完课程' ,'path'=>'Train/62b9c03e88fff.png'],
- ['title'=>30 ,'content'=>'累计学完30门课程','type'=>'class','condition'=>30,'remark'=>'学完课程' ,'path'=>'Train/62b9c078a6878.png'],
- ['title'=>'达人','content'=>'累计学完50门课程','type'=>'class','condition'=>50 ,'remark'=>'能力提升' ,'path'=>'Train/62b9c0b5dafde.png'],
- ['title'=> 10,'content'=>'累计获客10人','type'=>'clue','condition'=>10 ,'remark'=>'客户浏览' ,'path'=>'Train/62b9c0e7a6f06.png'],
- ['title'=> 30,'content'=>'累计获客30人','type'=>'clue','condition'=>30 ,'remark'=>'客户浏览' ,'path'=>'Train/62b9c109a767c.png'],
- ['title'=> 60,'content'=>'累计获客60人','type'=>'clue','condition'=> 60,'remark'=>'客户浏览' ,'path'=>'Train/62b9c12a2aa10.png'],
- ['title'=> '达人','content'=>'累计获客90人','type'=>'clue','condition'=> 90,'remark'=>'品牌触达' ,'path'=>'Train/62b9c150a6c5d.png'],
- ['title'=> 10,'content'=>'累计回答10条','type'=>'comment','condition'=> 10,'remark'=>'话术回答' ,'path'=>'Train/62b9c1b27bd34.png'],
- ['title'=> 30,'content'=>'累计回答30条','type'=>'comment','condition'=> 30,'remark'=>'话术回答' ,'path'=>'Train/62b9c1d247af5.png'],
- ['title'=> 60,'content'=>'累计回答60条','type'=>'comment','condition'=> 60,'remark'=>'话术回答' ,'path'=>'Train/62b9c1f7dcd01.png'],
- ['title'=> '达人','content'=>'累计回答90条','type'=>'comment','condition'=> 90,'remark'=>'答疑解惑' ,'path'=>'Train/62b9c218a3f19.png'],
- ['title'=> 7,'content'=>'累计签到7天','type'=>'sign','condition'=> 7,'remark'=>'登录天数' ,'path'=>'Train/62b9c24cdd869.png'],
- ['title'=> 30,'content'=>'累计签到30天','type'=>'sign','condition'=> 30,'remark'=>'登录天数' ,'path'=>'Train/62b9c26955fe7.png'],
- ['title'=> 60,'content'=>'累计签到60天','type'=>'sign','condition'=> 60,'remark'=>'登录天数' ,'path'=>'Train/62b9c289bacca.png'],
- ['title'=> '达人','content'=>'累计签到365天','type'=>'sign','condition'=> 365,'remark'=>'系统使用' ,'path'=>'Train/62b9c2a5f34aa.png'],
- ['title'=> 100,'content'=>'累计跟进100次','type'=>'visit_log','condition'=>100 ,'remark'=>'跟进次数' ,'path'=>'Train/62b9c2c873aa1.png'],
- ['title'=> 300,'content'=>'累计跟进300次','type'=>'visit_log','condition'=> 300,'remark'=>'跟进次数' ,'path'=>'Train/62b9c2e531718.png'],
- ['title'=> 500,'content'=>'累计跟进500次','type'=>'visit_log','condition'=>500 ,'remark'=>'跟进次数' ,'path'=>'Train/62b9c300e1bfd.png'],
- ['title'=> '达人','content'=>'累计跟进1000次','type'=>'visit_log','condition'=>1000 ,'remark'=>'客户维护' ,'path'=>'Train/62b9c31e6585b.png'],
- ];
- (new Medal())->saveAll($data);
- }
- }
|