| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace addons\WangDianTong\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230705071445WangDianTongCrontabTask
- */
- class M230705071445WangDianTongCrontabTask extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $list = $this->db->createCommand("select * from qimall_crontab_task where
- `command` IN ('wang-dian-tong/logistics-task/sync',
- 'wang-dian-tong/compensate-task/sync') ")->queryAll();
- if($list && count($list) == 2) return true;
- $this->execute("INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('旺店通 - 每5分钟同步一次发货信息', 'wang-dian-tong/logistics-task/sync', 2, '0 */5 * * * *', 0, 1, 1684307540, 1684307544);");
- $this->execute("INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('旺店通 - 同步数据失败每5分钟补偿一次', 'wang-dian-tong/compensate-task/sync', 2, '0 */5 * * * *', 0, 1, 1684307500, 1684307500);");
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230705071445WangDianTongCrontabTask cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230705071445WangDianTongCrontabTask cannot be reverted.\n";
- return false;
- }
- */
- }
|