M230214171014InsterQimallDiyComponents.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230214171014InsterQimallDiyComponents
  6. */
  7. class M230214171014InsterQimallDiyComponents extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql="INSERT INTO `qimall_diy_components`(`code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES
  16. ('best-sellers', '全城热卖', 'store', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Store', 1, 1652929474, 1652929474),
  17. ('img-button-group', '瓷片区', 'img_text', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, '', 1, 1634538238, 1634538238),
  18. ('store-commodity-classify-list', '商品分类', 'store', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Store', 1, 1634538238, 1634538238),
  19. ('shop-cate-recommend', '爆款商品聚合页', 'store', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Store', 1, 1634538238, 1634538238),
  20. ('store-prioritizing', '小白优选', 'store', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Store', 1, 1634538238, 1634538238),
  21. ('store-cate-recommend', '门店聚合页', 'store', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Store', 1, 1634538238, 1634538238),
  22. ('store', '推荐商家', 'store', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Store', 1, 1634538238, 1634538238);";
  23. $this->execute($sql);
  24. }catch (\Exception $e){
  25. }
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function safeDown()
  31. {
  32. echo "M230214171014InsterQimallDiyComponents cannot be reverted.\n";
  33. return false;
  34. }
  35. /*
  36. // Use up()/down() to run migration code without a transaction.
  37. public function up()
  38. {
  39. }
  40. public function down()
  41. {
  42. echo "M230117144314AddQimallFreeShippingRules cannot be reverted.\n";
  43. return false;
  44. }
  45. */
  46. }