add-api-distribution

This commit is contained in:
lccsw
2021-08-03 14:18:13 +08:00
parent bd84cdea8b
commit 6bdb56155d
27 changed files with 1031 additions and 176 deletions
+47
View File
@@ -50,3 +50,50 @@ create table lc_app_wxpaylog (
u_time timestamp not null default current_timestamp comment '更新时间',
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='支付回调日志';
-- ----------------------------
-- Title:用户资金账户表
-- Author:lcc
-- Table:lc_app_user_account
-- ---------------------------
drop table if exists lc_app_user_account;
create table lc_app_user_account (
id int(10) unsigned not null auto_increment comment 'id',
app_id int(10) unsigned not null comment '小程序id',
app_uid int(10) unsigned not null comment '小程序用户id',
biz_id int(11) not null default '0' comment '商家id',
type tinyint(1) not null default '1' comment '账户类型 0.系统账户, 1.用户账户, 2.商家账户',
money_total decimal(12,2) not null default '0.00' comment '资金总额',
money_freeze decimal(12,2) not null default '0.00' comment '冻结资金',
money_left decimal(12,2) not null default '0.00' comment '余额',
jsondata json default null comment '其他',
status tinyint(1) not null default '1' comment '账户状态-1销户 0冻结 1正常',
c_time int(11) not null default '0' comment '创建时间',
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户资金账户表';
-- ----------------------------
-- Title:账户资金流水表
-- Author:lcc
-- Table:lc_app_user_accountlog
-- ---------------------------
drop table if exists lc_app_user_accountlog;
create table lc_app_user_accountlog (
id int(10) unsigned not null auto_increment comment 'id',
account_id int(10) unsigned not null default '0' comment '账户id',
sid varchar(32) not null default '' comment '订单号',
trade_type tinyint(4) not null default '0' comment '交易类型 1入账 2提现 3冲正 4转账',
money_type varchar(32) not null default '' comment '金额类型',
cfrom varchar(32) not null default '' comment '金额类型',
money_in decimal(12,2) not null default '0.00' comment '收入金额',
money_out decimal(12,2) not null default '0.00' comment '支出金额',
money_left decimal(12,2) not null default '0.00' comment '当前余额',
descrip varchar(255) not null default '' comment '流水说明',
jsondata json default null comment '更多数据',
status tinyint(1) not null default '0' comment ' -1失败 0进行中 1已完成',
ck varchar(32) not null default '' comment '同一批校验码',
c_time int(11) not null default '0' comment '创建时间',
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='账户资金流水表';
+19
View File
@@ -18,6 +18,7 @@ create table lc_app_liche_users (
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='狸车小程序用户表';
alter table lc_app_liche_users add ifdist tinyint(1) unsigned not null default 0 comment '是否分销人员' after jsondata;
-- ----------------------------
@@ -44,3 +45,21 @@ create table lc_app_liche_cms (
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='狸车小程序cms';
-- ----------------------------
-- Title:狸车用户数据表
-- Author:lcc
-- Table:lc_app_liche_udata
-- ---------------------------
drop table if exists lc_app_liche_udata;
create table lc_app_liche_udata (
id int(10) unsigned not null auto_increment comment '自增id',
cf_id int(10) unsigned not null default '0' comment '来源id',
type int(10) unsigned not null default '0' comment '类型(0推广素材二维码)',
datatype char(10) not null default '0' comment '数据类型 img video',
dataurl char(200) not null default '' comment '资源地址',
jsondata json default null comment '附加字段',
c_time int(10) unsigned not null default '0' comment '创建时间',
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='狸车用户数据表';
+34 -34
View File
@@ -4,40 +4,40 @@
-- Table:lc_order_purchase
-- ---------------------------
drop table if exists hd_order_purchase;
create table `lc_order_purchase` (
`id` int(10) unsigned not null auto_increment,
`app_id` int(10) unsigned not null comment '小程序id',
`app_uid` int(10) unsigned not null comment '小程序用户id',
`sid` varchar(32) not null default '' comment '订单号',
`item_id` int(10) unsigned not null comment '商品/服务id',
`sku_id` int(10) unsigned not null default '0' comment 'id',
`item_title` varchar(1024) not null default '' comment '商品/服务名称',
`item_num` int(10) unsigned not null default '1' comment '商品/服务数量',
`item_price` decimal(12,2) not null default '0.00' comment '商品/服务价格',
`biz_id` int(11) not null default '0' comment '商家id',
`carriage` int(10) unsigned not null default '0' comment '运费',
`total_price` decimal(12,2) not null default '0.00' comment '订单价格',
`pay_price` decimal(12,2) not null default '0.00' comment '实付金额',
`uname` varchar(16) not null default '' comment '订单用户姓名',
`mobile` varchar(11) not null default '' comment '手机号码',
`type` tinyint(1) not null default '0' comment '订单类型 1实物 2虚拟 3活动定金 4合同定金',
`payway` tinyint(1) not null default '0' comment '支付方式 0未选择 1微信',
`pay_time` timestamp not null default '0000-00-00 00:00:00' comment '付款时间',
`jsondata` json default null comment '订单其它数据',
`descrip` varchar(255) not null default '' comment '备注/描述',
`cf_id` int(10) unsigned not null default '0' comment '来源id',
`cf_uid` int(10) unsigned not null default '0' comment '来源用户id',
`cf_platform` varchar(16) not null default '' comment '来源平台',
`status` tinyint(1) not null default '0' comment '订单状态[-2已过期 -1删除 0待支付 1已支付 2退款中 3已退款]',
`status_detail` tinyint(1) not null default '0' comment 'status',
`expire_time` int(10) unsigned not null default '0' comment '订单过期时间(0不过期)',
`express_time` timestamp not null default '0000-00-00 00:00:00' comment '发货时间',
`finish_time` timestamp not null default '0000-00-00 00:00:00' comment '交易完成时间(核销完成|确认收货)',
`c_time` int(10) unsigned not null default '0' comment '创建时间',
`u_time` timestamp not null default current_timestamp on update current_timestamp,
primary key (`id`),
key `idx_user_order` (`app_id`,`app_uid`,`status`),
key `idx_sid` (`sid`)
create table lc_order_purchase (
id int(10) unsigned not null auto_increment,
app_id int(10) unsigned not null comment '小程序id',
app_uid int(10) unsigned not null comment '小程序用户id',
sid varchar(32) not null default '' comment '订单号',
item_id int(10) unsigned not null comment '商品/服务id',
sku_id int(10) unsigned not null default '0' comment 'id',
item_title varchar(1024) not null default '' comment '商品/服务名称',
item_num int(10) unsigned not null default '1' comment '商品/服务数量',
item_price decimal(12,2) not null default '0.00' comment '商品/服务价格',
biz_id int(11) not null default '0' comment '商家id',
carriage int(10) unsigned not null default '0' comment '运费',
total_price decimal(12,2) not null default '0.00' comment '订单价格',
pay_price decimal(12,2) not null default '0.00' comment '实付金额',
uname varchar(16) not null default '' comment '订单用户姓名',
mobile varchar(11) not null default '' comment '手机号码',
type tinyint(1) not null default '0' comment '订单类型 1实物 2虚拟 3活动定金 4合同定金',
payway tinyint(1) not null default '0' comment '支付方式 0未选择 1微信',
pay_time timestamp not null default '0000-00-00 00:00:00' comment '付款时间',
jsondata json default null comment '订单其它数据',
descrip varchar(255) not null default '' comment '备注/描述',
cf_id int(10) unsigned not null default '0' comment '来源id',
cf_uid int(10) unsigned not null default '0' comment '来源用户id',
cf_platform varchar(16) not null default '' comment '来源平台',
status tinyint(1) not null default '0' comment '订单状态[-2已过期 -1删除 0待支付 1已支付 2退款中 3已退款]',
status_detail tinyint(1) not null default '0' comment 'status',
expire_time int(10) unsigned not null default '0' comment '订单过期时间(0不过期)',
express_time timestamp not null default '0000-00-00 00:00:00' comment '发货时间',
finish_time timestamp not null default '0000-00-00 00:00:00' comment '交易完成时间(核销完成|确认收货)',
c_time int(10) unsigned not null default '0' comment '创建时间',
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id),
key idx_user_order (app_id,app_uid,status),
key idx_sid (sid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消费订单表';
+48 -30
View File
@@ -4,27 +4,27 @@
-- Table:lc_receiver_clues
-- ---------------------------
drop table if exists lc_receiver_clues;
create table `lc_receiver_clues` (
`id` int(10) not null auto_increment comment '自增id',
`name` varchar(32) not null comment '客户姓名',
`mobile` varchar(11) not null comment '客户手机号码',
`brand_id` int(10) not null default '0' comment '车型品牌id',
`s_id` int(10) not null default '0' comment '车系id',
`if_driver` tinyint(4) not null default '0' comment '是否试驾(0否 1是)',
`admin_id` int(10) not null default '0' comment '销售id',
`app_id` int(10) unsigned not null default '0' comment '来源小程序id',
`cf_id` int(10) not null default '0' comment '来源id',
`out_id` int(10) not null default '0' comment '外部来源id',
`cf_uid` int(10) not null default '0' comment '来源用户id',
`cf_platform` varchar(20) not null default '' comment '来源平台',
`jsondata` json default null comment '其它信息',
`status` tinyint(1) not null default '0' comment '状态',
`status_id` int(10) not null default '1',
`u_time` timestamp not null default current_timestamp on update current_timestamp,
`c_time` int(10) unsigned not null default '0' comment '创建时间',
primary key (`id`)
create table lc_receiver_clues (
id int(10) not null auto_increment comment '自增id',
name varchar(32) not null comment '客户姓名',
mobile varchar(11) not null comment '客户手机号码',
brand_id int(10) not null default '0' comment '车型品牌id',
s_id int(10) not null default '0' comment '车系id',
if_driver tinyint(4) not null default '0' comment '是否试驾(0否 1是)',
admin_id int(10) not null default '0' comment '销售id',
app_id int(10) unsigned not null default '0' comment '来源小程序id',
cf_id int(10) not null default '0' comment '来源id',
out_id int(10) not null default '0' comment '外部来源id',
cf_uid int(10) not null default '0' comment '来源用户id',
cf_platform varchar(20) not null default '' comment '来源平台',
jsondata json default null comment '其它信息',
status tinyint(1) not null default '0' comment '状态',
status_id int(10) not null default '1',
u_time timestamp not null default current_timestamp on update current_timestamp,
c_time int(10) unsigned not null default '0' comment '创建时间',
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='线索池';
alter table lc_receiver_clues add recommend_id int(10) not null default 0 comment '推荐用id' after cf_id;
-- ----------------------------
-- Title:线索操作日志表
@@ -32,14 +32,32 @@ create table `lc_receiver_clues` (
-- Table:lc_receiver_clue_oplogs
-- ---------------------------
drop table if exists lc_receiver_clue_oplogs;
create table `lc_receiver_clue_oplogs` (
`id` int(10) unsigned not null auto_increment comment '自增id',
`clue_id` int(10) unsigned not null comment '线索id',
`uid` int(10) unsigned not null comment '操作用户id',
`uname` varchar(32) not null default '' comment '操作用户名',
`type` tinyint(1) not null default '0' comment '类型',
`log` varchar(256) not null default '' comment '操作内容',
`c_time` int(10) unsigned not null default '0' comment '创建时间',
`u_time` timestamp not null default current_timestamp on update current_timestamp,
primary key (`id`)
create table lc_receiver_clue_oplogs (
id int(10) unsigned not null auto_increment comment '自增id',
clue_id int(10) unsigned not null comment '线索id',
uid int(10) unsigned not null comment '操作用户id',
uname varchar(32) not null default '' comment '操作用户名',
type tinyint(1) not null default '0' comment '类型',
log varchar(256) not null default '' comment '操作内容',
c_time int(10) unsigned not null default '0' comment '创建时间',
u_time timestamp not null default current_timestamp on update current_timestamp,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='线索操作日志表';
-- ----------------------------
-- Title:线索统计表
-- Author:lcc
-- Table:lc_receiver_clue_statistics
-- ---------------------------
drop table if exists lc_receiver_clue_statistics;
CREATE TABLE `lc_receiver_clue_statistics` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`app_id` int(10) unsigned NOT NULL COMMENT '应用id',
`uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
`browse_num` int(10) NOT NULL DEFAULT '0' COMMENT '浏览量',
`day` date NOT NULL DEFAULT '0000-00-00' COMMENT '日期',
`c_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`u_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='线索统计表'