12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- use app\model\Medal;
- use app\model\EmployeeMedal;
- class CreatDatasToMedals 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/62b8151195a63.png'],
- ['title'=>20 ,'content'=>'累计学完20门课程','type'=>'class','condition'=>20 ,'remark'=>'学完课程' ,'path'=>'Train/62b8151195a63.png'],
- ['title'=>30 ,'content'=>'累计学完30门课程','type'=>'class','condition'=>30,'remark'=>'学完课程' ,'path'=>'Train/62b8151195a63.png'],
- ['title'=>'达人','content'=>'累计学完50门课程','type'=>'class','condition'=>50 ,'remark'=>'能力提升' ,'path'=>'Train/62b815271f175.png'],
- ['title'=> 10,'content'=>'累计获客10人','type'=>'clue','condition'=>10 ,'remark'=>'客户浏览' ,'path'=>'Train/62b81556e2896.png'],
- ['title'=> 30,'content'=>'累计获客30人','type'=>'clue','condition'=>30 ,'remark'=>'客户浏览' ,'path'=>'Train/62b81556e2896.png'],
- ['title'=> 60,'content'=>'累计获客60人','type'=>'clue','condition'=> 60,'remark'=>'客户浏览' ,'path'=>'Train/62b81556e2896.png'],
- ['title'=> '达人','content'=>'累计获客90人','type'=>'clue','condition'=> 90,'remark'=>'品牌触达' ,'path'=>'Train/62b8156eed1f1.png'],
- ['title'=> 10,'content'=>'累计回答10条','type'=>'comment','condition'=> 10,'remark'=>'话术回答' ,'path'=>'Train/62b8158923ba9.png'],
- ['title'=> 30,'content'=>'累计回答30条','type'=>'comment','condition'=> 30,'remark'=>'话术回答' ,'path'=>'Train/62b8158923ba9.png'],
- ['title'=> 60,'content'=>'累计回答60条','type'=>'comment','condition'=> 60,'remark'=>'话术回答' ,'path'=>'Train/62b8158923ba9.png'],
- ['title'=> '达人','content'=>'累计回答90条','type'=>'comment','condition'=> 90,'remark'=>'答疑解惑' ,'path'=>'Train/62b8159fb7ff9.png'],
- ['title'=> 7,'content'=>'累计签到7天','type'=>'sign','condition'=> 7,'remark'=>'登录天数' ,'path'=>'Train/62b80b489e6bc.png'],
- ['title'=> 30,'content'=>'累计签到30天','type'=>'sign','condition'=> 30,'remark'=>'登录天数' ,'path'=>'Train/62b80b489e6bc.png'],
- ['title'=> 60,'content'=>'累计签到60天','type'=>'sign','condition'=> 60,'remark'=>'登录天数' ,'path'=>'Train/62b80b489e6bc.png'],
- ['title'=> '达人','content'=>'累计签到365天','type'=>'sign','condition'=> 365,'remark'=>'系统使用' ,'path'=>'Train/62b80bfdb46d9.png'],
- ['title'=> 100,'content'=>'累计跟进100次','type'=>'visit_log','condition'=>100 ,'remark'=>'跟进次数' ,'path'=>'Train/62b80c3ed2cff.png'],
- ['title'=> 300,'content'=>'累计跟进300次','type'=>'visit_log','condition'=> 300,'remark'=>'跟进次数' ,'path'=>'Train/62b80c3ed2cff.png'],
- ['title'=> 500,'content'=>'累计跟进500次','type'=>'visit_log','condition'=>500 ,'remark'=>'跟进次数' ,'path'=>'Train/62b80c3ed2cff.png'],
- ['title'=> '达人','content'=>'累计跟进1000次','type'=>'visit_log','condition'=>1000 ,'remark'=>'客户维护' ,'path'=>'Train/62b80d1652705.png'],
- ];
- (new Medal())->saveAll($data);
- }
- }
|