86 lines
5.0 KiB
SQL
86 lines
5.0 KiB
SQL
-- ----------------------------
|
|
-- Title:线索池
|
|
-- Author:lcc
|
|
-- 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)
|
|
) 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;
|
|
alter table lc_receiver_clues add en_time timestamp not null default '0000-00-00 00:00:00' comment '最后报名时间';
|
|
alter table lc_receiver_clues add city_id int(10) unsigned NOT NULL DEFAULT '0' COMMENT '城市id' after app_id;
|
|
alter table lc_receiver_clues add `county_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '区id' after city_id;
|
|
alter table lc_receiver_clues add `lat` double(15,12) NOT NULL DEFAULT '0.000000000000' COMMENT '经度' after county_id;
|
|
alter table lc_receiver_clues add `lng` double(15,12) NOT NULL DEFAULT '0.000000000000' COMMENT '纬度' after lat;
|
|
|
|
-- ----------------------------
|
|
-- Title:线索操作日志表
|
|
-- Author:lcc
|
|
-- 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)
|
|
) 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='线索统计表'
|
|
|
|
|
|
-- ----------------------------
|
|
-- Title:线索来源表
|
|
-- Author:lcc
|
|
-- Table:lc_receiver_clues_cfrom
|
|
-- ---------------------------
|
|
drop table if exists lc_receiver_clues_cfrom;
|
|
create table lc_receiver_clues_cfrom (
|
|
id int(10) unsigned not null auto_increment comment '自增id',
|
|
title varchar(32) not null comment '渠道名称',
|
|
status tinyint(1) not null default '1' comment '状态:-1删除 1使用中',
|
|
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='线索来源表';
|
|
alter table lc_receiver_clues_cfrom add column pid int unsigned not null default 0 comment '父来源ID' after title;
|