| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M240508015929CreateTableQimallAddonsStoreClerkIncome
- */
- class M240508015929CreateTableQimallAddonsStoreClerkIncome extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "CREATE TABLE `qimall_addons_store_clerk_income`(
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT 0,
- `store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
- `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
- `clerk_id` int(11) NOT NULL DEFAULT 0 COMMENT '核销员id',
- `mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '电话',
- `order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单编号',
- `amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '核销金额',
- `income` decimal(12, 2) NOT NULL COMMENT '核销收益',
- `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
- `e_coupon_name` varchar(128) NOT NULL DEFAULT '' COMMENT '电子券名称',
- `e_coupon_id` int(11) NOT NULL DEFAULT 0 COMMENT '电子券id',
- `user_e_coupon_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员电子券id',
- `num` int(11) NOT NULL DEFAULT 0 COMMENT '数量',
- `clerk_user_id` int(11) NOT NULL DEFAULT 0 COMMENT '核销员id',
- `clerk_admin_id` int(11) NOT NULL DEFAULT 0 COMMENT '核销管理员',
- `proper_user_id` int(11) NOT NULL DEFAULT 0 COMMENT '专有者id',
- `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '门店核销收益'";
- $this->execute($sql);
- $sql = "CREATE TABLE `qimall_addons_store_clerk_income_data` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `store_id` int(11) NOT NULL,
- `mall_id` int(11) NOT NULL,
- `total_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '总金额',
- `total_count` int(11) NOT NULL DEFAULT 0 COMMENT '总次数',
- `total_income` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '总收益',
- `created_at` int(11) NOT NULL DEFAULT 0,
- `updated_at` int(11) NOT NULL DEFAULT 0,
- `status` int(4) NOT NULL DEFAULT 1,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '门店核销统计'";
- $this->execute($sql);
- $sql="INSERT INTO `qimall_addons_store_menu`(`title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES ( '核销收益', '0', 105, 'store/clerk/index/clerk-income', '', 2, 0, 999, NULL, '', 1, 0, 0, 'Clerk', 1);";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240508015929CreateTableQimallAddonsStoreClerkIncome cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240424015929AlterQimallAddonsStoreSettings cannot be reverted.\n";
- return false;
- }
- */
- }
|