1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-24 08:51:43 +08:00
course-tencent-cloud/db/migrations/20210126024511_data_202101261130.php
koogua 0336a54911 1.源文件增加版权信息
2.群组状态和课程协同
2021-06-13 15:49:47 +08:00

53 lines
1.4 KiB
PHP

<?php
/**
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
class Data202101261130 extends Phinx\Migration\AbstractMigration
{
public function up()
{
$consumeRule = ['enabled' => 1, 'rate' => 5];
$eventRule = [
'account_register' => ['enabled' => 1, 'point' => 100],
'course_review' => ['enabled' => 1, 'point' => 50],
'chapter_study' => ['enabled' => 1, 'point' => 10],
'site_visit' => ['enabled' => 1, 'point' => 10],
'im_discuss' => ['enabled' => 1, 'point' => 10],
];
$rows = [
[
'section' => 'point',
'item_key' => 'enabled',
'item_value' => 1,
],
[
'section' => 'point',
'item_key' => 'consume_rule',
'item_value' => json_encode($consumeRule),
],
[
'section' => 'point',
'item_key' => 'event_rule',
'item_value' => json_encode($eventRule),
],
];
$this->table('kg_setting')->insert($rows)->save();
}
public function down()
{
$this->getQueryBuilder()
->delete('kg_setting')
->where(['section' => 'point'])
->execute();
}
}