123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- use app\model\Video as VideoModel;
- use app\model\CompanyStrength as CompanyStrengthModel;
- class UpdateData02 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()
- {
- // 61-91酷美整装 (移至公司实力 酷美(问答)
- $where = [
- ['type','=',2386],
- ['root_id','=',1023],
- ['label','=',2387]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'酷美(问答)',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- // 92-95酷美整装视频 (酷美介绍)
- $where = [
- ['type','=',2386],
- ['root_id','=',1023],
- ['label','=',0]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'酷美介绍',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- // 96 黄总介绍 (移至公司实力 老板访谈 102 (移至公司实力 老板访谈
- $where = [
- ['id','in',[3149,3143]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'老板访谈',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
-
- // 97-98设计视频 (移至公司实力 企业介绍)
- // 99 (移至公司实力 企业介绍 101 (移至公司实力 企业介绍 103 (移至公司实力 企业介绍)
- //133(移至公司实力 企业介绍)
- $where = [
- ['id','in',[3148,3147,3146,3144,3142,3090]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'企业介绍',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //100 (移至公司实力 荣誉奖项
- $where = [
- ['id','in',[3145]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'荣誉奖项',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //104-105(移至公司实力 承诺)
- $where = [
- ['id','in',[3140,3141]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'承诺',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //106-112服务视频 (移至公司实力 团队)
- $where = [
- ['id','in',[3133,3134,3135,3136,3137,3138,3139]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'团队介绍',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //113-120工程视频 (移至公司实力 工程)
- $where = [
- ['id','in',[3114,3116,3117,3121,3123,3124,3125,3127]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'工程',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //122-125设计视频 (移至公司实力 设计优势)
- $where = [
- ['id','in',[3103,3104,3106,3107]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'设计优势',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //128-129 (移至公司实力 产品介绍)
- //141-142(移至公司实力 产品介绍)
- //144(移至公司实力 产品介绍)
- $where = [
- ['id','in',[3097,3098,3071,3072,3069]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'产品介绍',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //130-132 (移至公司实力 全案整装)
- //135-136(移至公司实力 全案整装)
- //138-139(移至公司实力 全案整装)
- $where = [
- ['id','in',[3092,3094,3095,3077,3078,3074,3075]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'全案整装',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //137(移至公司实力 服务)
- $where = [
- ['id','in',[3076]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'服务',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
-
- //140(移至公司实力 环保优势)
- $where = [
- ['id','in',[3073]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'环保优势',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- //143(移至公司实力 材料)
- //145-147 (移至公司实力 材料)
- $where = [
- ['id','in',[3070,3068,3067,3066]]
- ];
- $list = VideoModel::where($where)->column('*');
- foreach ($list as $k => $v) {
- CompanyStrengthModel::create([
- 'root_id'=>1023,
- 'cate'=>'材料',
- 'title'=>$v['title'],
- 'pics'=>$v['video_url'],
- 'cover'=>$v['cover'],
- 'addtime'=>date('Y-m-d H:i:s'),
- 'updatetime'=>date('Y-m-d H:i:s'),
- 'del'=>0,
- 'publish'=>1,
- 'employee_id'=>4401,
- 'difference'=>1,
- 'video_type'=>0,
- 'desc'=>''
- ]);
- }
- }
-
- }
|