20230309082036_update_data02.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. use app\model\Video as VideoModel;
  5. use app\model\CompanyStrength as CompanyStrengthModel;
  6. class UpdateData02 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. // 61-91酷美整装 (移至公司实力 酷美(问答)
  32. $where = [
  33. ['type','=',2386],
  34. ['root_id','=',1023],
  35. ['label','=',2387]
  36. ];
  37. $list = VideoModel::where($where)->column('*');
  38. foreach ($list as $k => $v) {
  39. CompanyStrengthModel::create([
  40. 'root_id'=>1023,
  41. 'cate'=>'酷美(问答)',
  42. 'title'=>$v['title'],
  43. 'pics'=>$v['video_url'],
  44. 'cover'=>$v['cover'],
  45. 'addtime'=>date('Y-m-d H:i:s'),
  46. 'updatetime'=>date('Y-m-d H:i:s'),
  47. 'del'=>0,
  48. 'publish'=>1,
  49. 'employee_id'=>4401,
  50. 'difference'=>1,
  51. 'video_type'=>0,
  52. 'desc'=>''
  53. ]);
  54. }
  55. // 92-95酷美整装视频 (酷美介绍)
  56. $where = [
  57. ['type','=',2386],
  58. ['root_id','=',1023],
  59. ['label','=',0]
  60. ];
  61. $list = VideoModel::where($where)->column('*');
  62. foreach ($list as $k => $v) {
  63. CompanyStrengthModel::create([
  64. 'root_id'=>1023,
  65. 'cate'=>'酷美介绍',
  66. 'title'=>$v['title'],
  67. 'pics'=>$v['video_url'],
  68. 'cover'=>$v['cover'],
  69. 'addtime'=>date('Y-m-d H:i:s'),
  70. 'updatetime'=>date('Y-m-d H:i:s'),
  71. 'del'=>0,
  72. 'publish'=>1,
  73. 'employee_id'=>4401,
  74. 'difference'=>1,
  75. 'video_type'=>0,
  76. 'desc'=>''
  77. ]);
  78. }
  79. // 96 黄总介绍 (移至公司实力 老板访谈 102 (移至公司实力 老板访谈
  80. $where = [
  81. ['id','in',[3149,3143]]
  82. ];
  83. $list = VideoModel::where($where)->column('*');
  84. foreach ($list as $k => $v) {
  85. CompanyStrengthModel::create([
  86. 'root_id'=>1023,
  87. 'cate'=>'老板访谈',
  88. 'title'=>$v['title'],
  89. 'pics'=>$v['video_url'],
  90. 'cover'=>$v['cover'],
  91. 'addtime'=>date('Y-m-d H:i:s'),
  92. 'updatetime'=>date('Y-m-d H:i:s'),
  93. 'del'=>0,
  94. 'publish'=>1,
  95. 'employee_id'=>4401,
  96. 'difference'=>1,
  97. 'video_type'=>0,
  98. 'desc'=>''
  99. ]);
  100. }
  101. // 97-98设计视频 (移至公司实力 企业介绍)
  102. // 99 (移至公司实力 企业介绍 101 (移至公司实力 企业介绍 103 (移至公司实力 企业介绍)
  103. //133(移至公司实力 企业介绍)
  104. $where = [
  105. ['id','in',[3148,3147,3146,3144,3142,3090]]
  106. ];
  107. $list = VideoModel::where($where)->column('*');
  108. foreach ($list as $k => $v) {
  109. CompanyStrengthModel::create([
  110. 'root_id'=>1023,
  111. 'cate'=>'企业介绍',
  112. 'title'=>$v['title'],
  113. 'pics'=>$v['video_url'],
  114. 'cover'=>$v['cover'],
  115. 'addtime'=>date('Y-m-d H:i:s'),
  116. 'updatetime'=>date('Y-m-d H:i:s'),
  117. 'del'=>0,
  118. 'publish'=>1,
  119. 'employee_id'=>4401,
  120. 'difference'=>1,
  121. 'video_type'=>0,
  122. 'desc'=>''
  123. ]);
  124. }
  125. //100 (移至公司实力 荣誉奖项
  126. $where = [
  127. ['id','in',[3145]]
  128. ];
  129. $list = VideoModel::where($where)->column('*');
  130. foreach ($list as $k => $v) {
  131. CompanyStrengthModel::create([
  132. 'root_id'=>1023,
  133. 'cate'=>'荣誉奖项',
  134. 'title'=>$v['title'],
  135. 'pics'=>$v['video_url'],
  136. 'cover'=>$v['cover'],
  137. 'addtime'=>date('Y-m-d H:i:s'),
  138. 'updatetime'=>date('Y-m-d H:i:s'),
  139. 'del'=>0,
  140. 'publish'=>1,
  141. 'employee_id'=>4401,
  142. 'difference'=>1,
  143. 'video_type'=>0,
  144. 'desc'=>''
  145. ]);
  146. }
  147. //104-105(移至公司实力 承诺)
  148. $where = [
  149. ['id','in',[3140,3141]]
  150. ];
  151. $list = VideoModel::where($where)->column('*');
  152. foreach ($list as $k => $v) {
  153. CompanyStrengthModel::create([
  154. 'root_id'=>1023,
  155. 'cate'=>'承诺',
  156. 'title'=>$v['title'],
  157. 'pics'=>$v['video_url'],
  158. 'cover'=>$v['cover'],
  159. 'addtime'=>date('Y-m-d H:i:s'),
  160. 'updatetime'=>date('Y-m-d H:i:s'),
  161. 'del'=>0,
  162. 'publish'=>1,
  163. 'employee_id'=>4401,
  164. 'difference'=>1,
  165. 'video_type'=>0,
  166. 'desc'=>''
  167. ]);
  168. }
  169. //106-112服务视频 (移至公司实力 团队)
  170. $where = [
  171. ['id','in',[3133,3134,3135,3136,3137,3138,3139]]
  172. ];
  173. $list = VideoModel::where($where)->column('*');
  174. foreach ($list as $k => $v) {
  175. CompanyStrengthModel::create([
  176. 'root_id'=>1023,
  177. 'cate'=>'团队介绍',
  178. 'title'=>$v['title'],
  179. 'pics'=>$v['video_url'],
  180. 'cover'=>$v['cover'],
  181. 'addtime'=>date('Y-m-d H:i:s'),
  182. 'updatetime'=>date('Y-m-d H:i:s'),
  183. 'del'=>0,
  184. 'publish'=>1,
  185. 'employee_id'=>4401,
  186. 'difference'=>1,
  187. 'video_type'=>0,
  188. 'desc'=>''
  189. ]);
  190. }
  191. //113-120工程视频 (移至公司实力 工程)
  192. $where = [
  193. ['id','in',[3114,3116,3117,3121,3123,3124,3125,3127]]
  194. ];
  195. $list = VideoModel::where($where)->column('*');
  196. foreach ($list as $k => $v) {
  197. CompanyStrengthModel::create([
  198. 'root_id'=>1023,
  199. 'cate'=>'工程',
  200. 'title'=>$v['title'],
  201. 'pics'=>$v['video_url'],
  202. 'cover'=>$v['cover'],
  203. 'addtime'=>date('Y-m-d H:i:s'),
  204. 'updatetime'=>date('Y-m-d H:i:s'),
  205. 'del'=>0,
  206. 'publish'=>1,
  207. 'employee_id'=>4401,
  208. 'difference'=>1,
  209. 'video_type'=>0,
  210. 'desc'=>''
  211. ]);
  212. }
  213. //122-125设计视频 (移至公司实力 设计优势)
  214. $where = [
  215. ['id','in',[3103,3104,3106,3107]]
  216. ];
  217. $list = VideoModel::where($where)->column('*');
  218. foreach ($list as $k => $v) {
  219. CompanyStrengthModel::create([
  220. 'root_id'=>1023,
  221. 'cate'=>'设计优势',
  222. 'title'=>$v['title'],
  223. 'pics'=>$v['video_url'],
  224. 'cover'=>$v['cover'],
  225. 'addtime'=>date('Y-m-d H:i:s'),
  226. 'updatetime'=>date('Y-m-d H:i:s'),
  227. 'del'=>0,
  228. 'publish'=>1,
  229. 'employee_id'=>4401,
  230. 'difference'=>1,
  231. 'video_type'=>0,
  232. 'desc'=>''
  233. ]);
  234. }
  235. //128-129 (移至公司实力 产品介绍)
  236. //141-142(移至公司实力 产品介绍)
  237. //144(移至公司实力 产品介绍)
  238. $where = [
  239. ['id','in',[3097,3098,3071,3072,3069]]
  240. ];
  241. $list = VideoModel::where($where)->column('*');
  242. foreach ($list as $k => $v) {
  243. CompanyStrengthModel::create([
  244. 'root_id'=>1023,
  245. 'cate'=>'产品介绍',
  246. 'title'=>$v['title'],
  247. 'pics'=>$v['video_url'],
  248. 'cover'=>$v['cover'],
  249. 'addtime'=>date('Y-m-d H:i:s'),
  250. 'updatetime'=>date('Y-m-d H:i:s'),
  251. 'del'=>0,
  252. 'publish'=>1,
  253. 'employee_id'=>4401,
  254. 'difference'=>1,
  255. 'video_type'=>0,
  256. 'desc'=>''
  257. ]);
  258. }
  259. //130-132 (移至公司实力 全案整装)
  260. //135-136(移至公司实力 全案整装)
  261. //138-139(移至公司实力 全案整装)
  262. $where = [
  263. ['id','in',[3092,3094,3095,3077,3078,3074,3075]]
  264. ];
  265. $list = VideoModel::where($where)->column('*');
  266. foreach ($list as $k => $v) {
  267. CompanyStrengthModel::create([
  268. 'root_id'=>1023,
  269. 'cate'=>'全案整装',
  270. 'title'=>$v['title'],
  271. 'pics'=>$v['video_url'],
  272. 'cover'=>$v['cover'],
  273. 'addtime'=>date('Y-m-d H:i:s'),
  274. 'updatetime'=>date('Y-m-d H:i:s'),
  275. 'del'=>0,
  276. 'publish'=>1,
  277. 'employee_id'=>4401,
  278. 'difference'=>1,
  279. 'video_type'=>0,
  280. 'desc'=>''
  281. ]);
  282. }
  283. //137(移至公司实力 服务)
  284. $where = [
  285. ['id','in',[3076]]
  286. ];
  287. $list = VideoModel::where($where)->column('*');
  288. foreach ($list as $k => $v) {
  289. CompanyStrengthModel::create([
  290. 'root_id'=>1023,
  291. 'cate'=>'服务',
  292. 'title'=>$v['title'],
  293. 'pics'=>$v['video_url'],
  294. 'cover'=>$v['cover'],
  295. 'addtime'=>date('Y-m-d H:i:s'),
  296. 'updatetime'=>date('Y-m-d H:i:s'),
  297. 'del'=>0,
  298. 'publish'=>1,
  299. 'employee_id'=>4401,
  300. 'difference'=>1,
  301. 'video_type'=>0,
  302. 'desc'=>''
  303. ]);
  304. }
  305. //140(移至公司实力 环保优势)
  306. $where = [
  307. ['id','in',[3073]]
  308. ];
  309. $list = VideoModel::where($where)->column('*');
  310. foreach ($list as $k => $v) {
  311. CompanyStrengthModel::create([
  312. 'root_id'=>1023,
  313. 'cate'=>'环保优势',
  314. 'title'=>$v['title'],
  315. 'pics'=>$v['video_url'],
  316. 'cover'=>$v['cover'],
  317. 'addtime'=>date('Y-m-d H:i:s'),
  318. 'updatetime'=>date('Y-m-d H:i:s'),
  319. 'del'=>0,
  320. 'publish'=>1,
  321. 'employee_id'=>4401,
  322. 'difference'=>1,
  323. 'video_type'=>0,
  324. 'desc'=>''
  325. ]);
  326. }
  327. //143(移至公司实力 材料)
  328. //145-147 (移至公司实力 材料)
  329. $where = [
  330. ['id','in',[3070,3068,3067,3066]]
  331. ];
  332. $list = VideoModel::where($where)->column('*');
  333. foreach ($list as $k => $v) {
  334. CompanyStrengthModel::create([
  335. 'root_id'=>1023,
  336. 'cate'=>'材料',
  337. 'title'=>$v['title'],
  338. 'pics'=>$v['video_url'],
  339. 'cover'=>$v['cover'],
  340. 'addtime'=>date('Y-m-d H:i:s'),
  341. 'updatetime'=>date('Y-m-d H:i:s'),
  342. 'del'=>0,
  343. 'publish'=>1,
  344. 'employee_id'=>4401,
  345. 'difference'=>1,
  346. 'video_type'=>0,
  347. 'desc'=>''
  348. ]);
  349. }
  350. }
  351. }