DROP TABLE IF EXISTS `customer`; CREATE TABLE `customer` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `level` int(8) DEFAULT NULL COMMENT '當前用戶所處深度', `parent_id` int(11) DEFAULT '0' COMMENT '上級用戶id', `add_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '注冊時間', `update_time` bigint(10) DEFAULT '0' COMMENT '更新時間', `username` varchar(64) NOT NULL DEFAULT '' COMMENT '用戶名/手機號碼', `realname` varchar(64) DEFAULT '' COMMENT '真實姓名', `nickname` varchar(64) DEFAULT '' COMMENT '用戶昵稱', `password` varchar(100) NOT NULL DEFAULT '' COMMENT '用戶密碼', `reg_ip` varchar(100) NOT NULL DEFAULT '' COMMENT '注冊IP', `status` smallint(1) NOT NULL DEFAULT '1' COMMENT '賬號狀態[0:封號,1:正常]', `login_times` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '賬號登錄次數', `last_login_ip` varchar(100) DEFAULT '' COMMENT '最后登錄IP', `last_login_time` bigint(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后登錄時間', `head_img` varchar(500) NOT NULL DEFAULT '' COMMENT '用戶頭像', `role_id` int(11) NOT NULL DEFAULT '0', `token` varchar(50) NOT NULL DEFAULT '', `balance` int(11) NOT NULL DEFAULT '0' COMMENT '余額', `profit_percentage` decimal(10,2) DEFAULT '0.00' COMMENT '分潤比列%', `sale_qr_code` varchar(255) DEFAULT '' COMMENT '用戶推廣二維碼圖片地址', `phone` varchar(50) DEFAULT '' COMMENT '聯系電話', `invitation_code` varchar(50) DEFAULT '' COMMENT '邀請碼', `openId` varchar(50) DEFAULT '' COMMENT '微信登陸id', PRIMARY KEY (`id`), KEY `uni_token` (`token`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用戶'; DROP TABLE IF EXISTS `log_action`; CREATE TABLE `log_action` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `add_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '操作時間', `uid` varchar(255) DEFAULT '0' COMMENT '操作用戶ID', `url` varchar(200) NOT NULL COMMENT '操作URL', `post_data` text COMMENT '用戶提交的數據', `response_data` text, `args` varchar(800) DEFAULT NULL, `ua` varchar(255) DEFAULT NULL, `ip` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用戶操作日志'; DROP TABLE IF EXISTS `promote_link`; CREATE TABLE `promote_link` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `add_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '操作時間', `update_time` bigint(20) DEFAULT '0' COMMENT '更新時間', `dispatch_sign` varchar(128) DEFAULT '' COMMENT '派單標識', `link_url` varchar(255) NOT NULL DEFAULT '' COMMENT '推廣鏈接URL', `enter_page` varchar(255) DEFAULT '' COMMENT '入口頁面', `detail` varchar(255) DEFAULT '' COMMENT '詳情', `click_count` int(10) DEFAULT '0' COMMENT '點擊次數', `attention_num` int(10) DEFAULT '0' COMMENT '引進用戶數', `recharge_money` int(15) DEFAULT '0' COMMENT '總充值金額 單位分', `share_money` int(15) DEFAULT '0' COMMENT '已分潤充值金額 單位分', `success_order_count` int(10) DEFAULT '0' COMMENT '成功訂單數', `close_order_count` int(10) DEFAULT '0' COMMENT '關閉訂單數', `rate` varchar(32) DEFAULT '0' COMMENT '完成率%', `customer_id` int(10) DEFAULT '0' COMMENT '被獲取到的推廣鏈接對應用戶id', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='推廣鏈接'; DROP TABLE IF EXISTS `benefit`; CREATE TABLE `benefit` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `add_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '操作時間', `update_time` bigint(20) DEFAULT '0' COMMENT '更新時間', `link_id` int(11) NOT NULL COMMENT '推廣鏈接id', `customer_id` int(11) NOT NULL COMMENT '用戶id', `customer_benefit` int(11) NOT NULL COMMENT '分潤金額,單位分', `profit_percentage` decimal(10,2) DEFAULT '0' COMMENT '分潤比列%', `current_amount` int(11) NOT NULL COMMENT '當前進行分潤的總金額', `recharge_money` int(15) NOT NULL COMMENT '充值金額', PRIMARY KEY(`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='分潤記錄表'; DROP TABLE IF EXISTS `account_withdraw`; CREATE TABLE `account_withdraw` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `add_time` bigint(20) NOT NULL, `update_time` bigint(20) DEFAULT NULL, `userId` int(11) NOT NULL, `amount` varchar(128) NOT NULL COMMENT '提現金額', `channel` varchar(64) DEFAULT NULL COMMENT '提現方式', `status` int(11) DEFAULT NULL, `result` varchar(128) DEFAULT NULL COMMENT '本次提現申請的結果', `phone` varchar(32) DEFAULT NULL COMMENT '手機號', `username` varchar(32) DEFAULT NULL COMMENT '用戶名', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;