diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 6d0a5e6d..8d68a058 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -300,7 +300,7 @@ class Clues extends HD_Controller{ 'brand_id' => $clues_row['brand_id'], 's_id' => $clues_row['s_id'], 'if_driver' => $clues_row['if_driver'], - 'cf_title' => '后台分配', + 'cf_title' => '平台分配', 'p_time' => date('Y-m-d H:i:s'), 'c_time' => time() ]; @@ -316,7 +316,7 @@ class Clues extends HD_Controller{ $this->load->library('receiver/clues_entity'); $this->clues_entity->add_log($val,$this->uid,$this->username,"分配给【{$biz['biz_name']}】商家"); $this->load->library('receiver/customers_entity'); - $this->customers_entity->add_log($customers_id,$this->uid,$this->username,"后台分配",0,'admin'); + $this->customers_entity->add_log($customers_id,$this->uid,$this->username,"平台分配",0,'admin'); } } } diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index 253b5c86..6cb0d725 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -60,6 +60,7 @@ class Orders extends HD_Controller{ $loan['status'] = intval($loan['status']); $loan['first_price'] = number_format($loan['first_price'],2); $loan['notify_file'] = $loan['notify_file'] ? build_qiniu_image_url($loan['notify_file']) : ''; + $loan['lend_file'] = $loan['lend_file'] ? build_qiniu_image_url($loan['lend_file']) : ''; $row['loan_info'] = $loan; } //获取开票 @@ -164,7 +165,11 @@ class Orders extends HD_Controller{ return $this->show_json(SYS_CODE_FAIL, '上传文件失败!'); } $size = getimagesize($res['url']); - $update['notify_file'] = $res['file']; + if($params['type']){ + $update['lend_file'] = $res['file']; + }else{ + $update['notify_file'] = $res['file']; + } $this->data['file_url'] = build_qiniu_image_url($res['file']); } strlen($params['status']) && $update['status'] = $params['status']; diff --git a/admin/views/biz/store/edit.php b/admin/views/biz/store/edit.php index 9868ff90..6c20e526 100755 --- a/admin/views/biz/store/edit.php +++ b/admin/views/biz/store/edit.php @@ -264,13 +264,14 @@ - +
diff --git a/admin/views/items/goods/edit.php b/admin/views/items/goods/edit.php index 285b7f52..bfa73488 100644 --- a/admin/views/items/goods/edit.php +++ b/admin/views/items/goods/edit.php @@ -157,8 +157,8 @@
-
指导价
- +
平台价
+
@@ -381,4 +381,4 @@ line-height: 37px; font-size: 1.6rem; } - \ No newline at end of file + diff --git a/admin/views/items/goods/get_info.php b/admin/views/items/goods/get_info.php index e07ffaa0..f478bb63 100644 --- a/admin/views/items/goods/get_info.php +++ b/admin/views/items/goods/get_info.php @@ -71,7 +71,7 @@ - 指导价: + 平台价: 折扣%: @@ -108,4 +108,4 @@ line-height: 37px; font-size: 1.6rem; } - \ No newline at end of file + diff --git a/admin/views/items/goods/lists.php b/admin/views/items/goods/lists.php index d071a56e..375cdd17 100644 --- a/admin/views/items/goods/lists.php +++ b/admin/views/items/goods/lists.php @@ -75,7 +75,7 @@ 车身颜色 内饰颜色 选装包 - 市场指导价 + 市场平台价 折扣% 采购成本 采购状态 @@ -175,4 +175,4 @@ }); }); }); - \ No newline at end of file + diff --git a/admin/views/receiver/order/agent/lists.php b/admin/views/receiver/order/agent/lists.php index 9c430d22..cd4f0835 100644 --- a/admin/views/receiver/order/agent/lists.php +++ b/admin/views/receiver/order/agent/lists.php @@ -75,7 +75,7 @@ 车型 车身颜色 内饰颜色 - 车辆指导价 + 车辆平台价 定金 付款方式 状态 diff --git a/admin/views/receiver/order/bill/lists.php b/admin/views/receiver/order/bill/lists.php index f5101718..be08babf 100644 --- a/admin/views/receiver/order/bill/lists.php +++ b/admin/views/receiver/order/bill/lists.php @@ -75,7 +75,7 @@ 车型 车身颜色 内饰颜色 - 车辆指导价 + 车辆平台价 定金 付款方式 状态 diff --git a/admin/views/receiver/order/ckcar/lists.php b/admin/views/receiver/order/ckcar/lists.php index a921004a..24e34cdd 100644 --- a/admin/views/receiver/order/ckcar/lists.php +++ b/admin/views/receiver/order/ckcar/lists.php @@ -75,7 +75,7 @@ 车型 车身颜色 内饰颜色 - 车辆指导价 + 车辆平台价 定金 付款方式 状态 diff --git a/admin/views/receiver/order/delivery/lists.php b/admin/views/receiver/order/delivery/lists.php index 1d87cba8..5719d030 100644 --- a/admin/views/receiver/order/delivery/lists.php +++ b/admin/views/receiver/order/delivery/lists.php @@ -75,7 +75,7 @@ 车型 车身颜色 内饰颜色 - 车辆指导价 + 车辆平台价 定金 付款方式 状态 diff --git a/admin/views/receiver/order/sign/lists.php b/admin/views/receiver/order/sign/lists.php index 0037f118..49771941 100644 --- a/admin/views/receiver/order/sign/lists.php +++ b/admin/views/receiver/order/sign/lists.php @@ -75,7 +75,7 @@ 车型 车身颜色 内饰颜色 - 车辆指导价 + 车辆平台价 定金 付款方式 合同状态 diff --git a/admin/views/receiver/orders/agentinfo.php b/admin/views/receiver/orders/agentinfo.php index 68768f28..a022a19a 100644 --- a/admin/views/receiver/orders/agentinfo.php +++ b/admin/views/receiver/orders/agentinfo.php @@ -15,11 +15,17 @@
+ +
+ +
+
@@ -39,17 +45,6 @@
-
-
- -
- -
-
-
- -
-
diff --git a/admin/views/receiver/orders/get.php b/admin/views/receiver/orders/get.php index 590caae7..db3e2368 100644 --- a/admin/views/receiver/orders/get.php +++ b/admin/views/receiver/orders/get.php @@ -198,11 +198,12 @@ } },'json'); }, - upTz: function(index){ + upTz: function(type,event){ var that = this; var formData = new FormData(); - formData.append("file",$("#tz_file").get(0).files[0]); //上传一个files对象 + formData.append("file",$(event.currentTarget).get(0).files[0]); //上传一个files对象 formData.append('id',this.info.id); + formData.append('type',type); $.ajax({//jQuery方法,此处可以换成其它请求方式 url: '/receiver/orders/edit_loan', dataType: "json", @@ -218,7 +219,11 @@ console.dir(res) layer.msg(res.msg); if(res.code){ - that.info.loan_info.notify_file = res.data.file_url; + if(type){ + that.info.loan_info.lend_file = res.data.file_url; + }else{ + that.info.loan_info.notify_file = res.data.file_url; + } } return; } diff --git a/admin/views/receiver/orders/loaninfo.php b/admin/views/receiver/orders/loaninfo.php index a716dd56..c8d94fa6 100644 --- a/admin/views/receiver/orders/loaninfo.php +++ b/admin/views/receiver/orders/loaninfo.php @@ -34,13 +34,23 @@ 查看文件
+ +
+ + 查看文件 +
diff --git a/admin/views/receiver/orders/oinfo.php b/admin/views/receiver/orders/oinfo.php index 06bec3af..4b4b9b18 100644 --- a/admin/views/receiver/orders/oinfo.php +++ b/admin/views/receiver/orders/oinfo.php @@ -51,7 +51,7 @@
- +
diff --git a/admin/views/sys/role/lists.php b/admin/views/sys/role/lists.php index 16e3f389..f3fdf525 100755 --- a/admin/views/sys/role/lists.php +++ b/admin/views/sys/role/lists.php @@ -35,9 +35,11 @@ + ID 角色名称 角色描述 @@ -48,9 +50,11 @@ $value){?> + @@ -91,4 +95,4 @@
- \ No newline at end of file + diff --git a/api/controllers/wxapp/licheb/Cusorder.php b/api/controllers/wxapp/licheb/Cusorder.php index 492b6b10..4ba247b7 100644 --- a/api/controllers/wxapp/licheb/Cusorder.php +++ b/api/controllers/wxapp/licheb/Cusorder.php @@ -259,7 +259,7 @@ class Cusorder extends Wxapp{ '车辆名称' => $brand['name'].$series['name'], '车辆级别' => $version, '颜色' => $color, - '车辆指导价格' => $row['price'], + '车辆平台价格' => $row['price'], '定金' => $row['deposit'] ]; //开票信息 diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 55ccdfae..8dfd5baa 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -233,7 +233,7 @@ class Customers extends Wxapp{ $this->load->library('receiver/customers_entity'); $level = $this->customers_entity->get_level(); - $cfrom = ['自行到店','后台分配']; + $cfrom = ['自行到店','平台分配']; $data = [ 'level' => $level, 'cfrom' => $cfrom diff --git a/common/helpers/comm_helper.php b/common/helpers/comm_helper.php index ed2bf949..ae27c692 100644 --- a/common/helpers/comm_helper.php +++ b/common/helpers/comm_helper.php @@ -929,7 +929,7 @@ if (!function_exists('http_host_com')){ } } elseif(false !== strpos($_SERVER['HTTP_HOST'], 'test')) {//test 测试 if($type == 'api'){ - $url = 'https://api.test.liche.cn'; + $url = 'api.lc.haodian.cn'; } else if($type == 'home'){ $url = "https://www-test.liche.cn"; } else if($type == 'admin'){ @@ -937,11 +937,11 @@ if (!function_exists('http_host_com')){ } } else { // 正式 if($type == 'api'){ - $url = 'https://api.liche.cn'; + $url = 'https://api.lc.haodian.cn'; } else if($type == 'home'){ $url = "https://www.liche.cn"; } else if($type == 'admin'){ - $url = "https://admin.liche.cn"; + $url = "https://admin.lc.haodian.cn"; } } return $url; diff --git a/sql/app/app.sql b/sql/app/app.sql new file mode 100644 index 00000000..be2ba24f --- /dev/null +++ b/sql/app/app.sql @@ -0,0 +1,52 @@ + +-- ---------------------------- +-- Title:小程序表 +-- Author:laa +-- Table:lc_app +-- --------------------------- +drop table if exists lc_app; +create table lc_app ( + id int(11) not null auto_increment, + name char(30) not null default '' comment '名称', + logo varchar(128) not null default '' comment 'logo', + jsondata text not null default '' comment '更多数据', + c_time int(10) not null default '0' comment '创建时间', + u_time timestamp not null default current_timestamp on update current_timestamp comment '更新时间', + primary key (id) +) engine=innodb default CHARSET=utf8mb4 comment='小程序表'; + + +-- ---------------------------- +-- Title:app配置表 +-- Author:xxb +-- Table:lc_app_config +-- --------------------------- +drop table if exists lc_app_config; +create table lc_app_config ( + id int(10) unsigned not null auto_increment comment '自增id', + app_id int unsigned not null default 0 comment '小程序id', + title varchar(128) not null default '' comment '标题', + k varchar(32) not null comment '配置key', + v json default null comment '配置数据', + admin_id int unsigned not null default 0 comment '操作员ID', + 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 comment='app配置表'; + + +-- ---------------------------- +-- Title:支付回调日志 +-- Author:lcc +-- Table:lc_app_wxpaylog +-- --------------------------- +drop table if exists lc_app_wxpaylog; +create table lc_app_wxpaylog ( + id int(11) unsigned not null auto_increment comment '自增id', + app_id int(10) unsigned not null default '1' comment '小程序id', + sid varchar(32) not null comment '订单号', + trade_no varchar(32) not null comment '支付流水号', + notify_param text comment '回调参数', + u_time timestamp not null default current_timestamp comment '更新时间', + primary key (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='支付回调日志' diff --git a/sql/app/liche.sql b/sql/app/liche.sql new file mode 100644 index 00000000..ee347a5d --- /dev/null +++ b/sql/app/liche.sql @@ -0,0 +1,46 @@ +-- ---------------------------- +-- Title:狸车小程序用户表 +-- Author:lcc +-- Table:lc_app_liche_users +-- --------------------------- +drop table if exists lc_app_liche_users; +create table lc_app_liche_users ( + id int(10) unsigned not null auto_increment comment '自增id', + mobile varchar(11) not null default '' comment '手机号码', + nickname varchar(32) not null default '' comment '用户名/微信昵称', + headimg varchar(200) not null default '' comment '用户头像', + signature varchar(256) not null comment '用户签名', + unionid varchar(32) not null default '' comment 'unionid', + openid varchar(32) not null default '' comment 'openid', + jsondata json default null comment '其他信息', + status tinyint(1) not null default '1' comment '状态:-1删除,0禁用,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='狸车小程序用户表' + + +-- ---------------------------- +-- Title:狸车小程序cms +-- Author:lcc +-- Table:lc_app_liche_cms +-- --------------------------- +drop table if exists lc_app_liche_cms; +create table lc_app_liche_cms ( + id int(10) unsigned not null auto_increment comment '自增id', + title varchar(128) not null default '' comment '标题', + url varchar(128) not null default '' comment '链接', + cover varchar(128) not null default '' comment '图片', + content text comment '详情', + s_time int(10) unsigned not null default '0' comment '开始时间', + e_time int(10) unsigned not null default '0' comment '结束时间 0表示长期有效', + type tinyint(1) not null default '1' comment '类型 1购车 ', + target_id int(10) unsigned not null default '0' comment '对象id', + position tinyint(1) not null default '0' comment '默认0首页', + jsondata json default null comment '其他信息', + sort int(11) not null default '0' comment '排序', + status tinyint(1) not null default '1' comment '状态 -1.删除,0.禁用,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='狸车小程序cms'; diff --git a/sql/app/licheb.sql b/sql/app/licheb.sql new file mode 100644 index 00000000..2eb9a670 --- /dev/null +++ b/sql/app/licheb.sql @@ -0,0 +1,24 @@ +-- ---------------------------- +-- Title:狸车宝用户表 +-- Author:lcc +-- Table:lc_app_licheb_users +-- --------------------------- +drop table if exists lc_app_licheb_users; +create table lc_app_licheb_users ( + id int(10) unsigned not null auto_increment comment '自增id', + pid int(10) not null default '0' comment '父id', + mobile varchar(11) not null default '' comment '手机号码', + uname varchar(20) not null default '' comment '姓名', + nickname varchar(32) not null default '' comment '用户名/微信昵称', + headimg varchar(200) not null default '' comment '用户头像', + signature varchar(256) not null default '' comment '用户签名', + unionid varchar(32) not null default '' comment 'unionid', + openid varchar(32) not null default '' comment 'openid', + group_id tinyint(1) not null default '1' comment '用户角色(1销售 2店长 3掌柜)', + biz_id int(10) not null default '0' comment '门店id', + status tinyint(1) not null default '1' comment '状态:-1删除,0禁用,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='狸车宝用户表' + diff --git a/sql/app/subject.sql b/sql/app/subject.sql new file mode 100644 index 00000000..35e3b511 --- /dev/null +++ b/sql/app/subject.sql @@ -0,0 +1,53 @@ +-- ---------------------------- +-- Title:动态表 +-- Author:0fun +-- Table:lc_subjects +-- --------------------------- +drop table if exists lc_subjects; +create table lc_subjects( + id int unsigned not null auto_increment comment '自增id', + app_id int unsigned not null default 1 comment '小程序ID', + app_uid int unsigned not null comment '用户id', + title varchar(32) not null default '' comment '标题', + cover text comment '封面(多图用逗号隔开,包含图片信息)', + imgs text comment '图片信息(多图用逗号隔开,包含图片信息)', + content text not null comment '内容', + cate_id int(10) unsigned not null default '0' comment '图片信息', + biz_id int(10) unsigned not null default '0' comment '商家id', + address varchar(255) not null default '' comment '定位地址', + lat double(15,12) not null default '0.000000000000' comment '经度', + lng double(15,12) not null default '0.000000000000' comment '纬度', + zan_num int unsigned not null default 0 comment '点赞数', + fav_num int unsigned not null default 0 comment '收藏数', + share_num int unsigned not null default 0 comment '分享数', + status tinyint(1) not null default 1 comment '状态:-1删除,0禁用,1正常', + top tinyint(1) not null default 0 comment '0正常,1置顶', + c_time int unsigned not null default 0 comment '创建时间', + u_time timestamp not null default current_timestamp on update current_timestamp, + primary key(id), + key idx_user_subject (app_id,app_uid,status), + key idx_cate_subject (app_id,cate_id,status) +)ENGINE=InnoDB default CHARSET=utf8mb4 comment='动态表'; +alter table lc_subjects add column hit_num int(10) not null default 0 comment '浏览量' after share_num; +alter table lc_subjects add column type tinyint(1) unsigned not null default 0 comment '类型 0图片 1视频' after app_uid; +alter table lc_subjects add column video varchar(128) not null default '' comment '视频地址' after imgs; +alter table lc_subjects add column sort int unsigned not null default 0 comment '排序,倒序' after top; + +-- ---------------------------- +-- Title:用户动态喜好表 +-- Author:0fun +-- Table:lc_subject_user_fond +-- --------------------------- +drop table if exists lc_subject_user_fond; +create table lc_subject_user_fond( + id int unsigned not null auto_increment comment '自增id', + app_id int unsigned not null default 1 comment '小程序ID', + app_uid int unsigned not null comment '用户id', + type tinyint(1) not null default 0 comment '喜好类型 1收藏 2点赞 3分享', + sub_id int unsigned not null comment '动态id', + primary key (id) +)ENGINE=InnoDB default CHARSET=utf8mb4 comment='小程序用户喜好表'; +alter table lc_subject_user_fond +add column ftype tinyint(1) unsigned not null default 0 comment '类型 0好评 1回复' after app_uid, +add column ftype_id int unsigned not null comment '目标ID' after ftype; +alter table lc_subject_user_fond add index idx_fond (app_id, app_uid) ; diff --git a/sql/auto.sql b/sql/auto.sql new file mode 100644 index 00000000..a2e9878d --- /dev/null +++ b/sql/auto.sql @@ -0,0 +1,47 @@ +-- ---------------------------- +-- Title:车型库_品牌 +-- Author:lcc +-- Table:lc_auto_brand +-- --------------------------- +drop table if exists lc_auto_brand; +create table lc_auto_brand ( + id int(10) unsigned not null auto_increment comment '品牌id', + name char(16) not null default '' comment '品牌', + status tinyint(1) not null default '1' comment '状态: 1正常 -1删除 0下架', + 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_auto_series +-- --------------------------- +drop table if exists lc_auto_series; +create table lc_auto_series ( + id int(10) unsigned not null auto_increment comment '车系id', + brand_id int(11) not null comment '品牌id', + name char(32) not null comment '车系名字', + status tinyint(1) not null default '1' comment '状态(1正常 0下架 -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='车型库_车系' + +-- ---------------------------- +-- Title:车型属性 +-- Author:lcc +-- Table:lc_auto_attr +-- --------------------------- +drop table if exists lc_auto_attr; +create table lc_auto_attr ( + id int(10) not null auto_increment comment '自增id', + s_id int(10) not null comment '车系id', + title varchar(50) not null default '' comment '标题', + type tinyint(2) not null default '0' comment '0颜色 1型号 2内饰颜色', + jsondata json default null comment '参数数据', + u_time timestamp not null default current_timestamp on update current_timestamp comment '更新时间', + c_time int(10) not null default '0' comment '创建时间', + primary key (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='车型属性'; diff --git a/sql/biz.sql b/sql/biz.sql new file mode 100644 index 00000000..e92d637f --- /dev/null +++ b/sql/biz.sql @@ -0,0 +1,55 @@ +-- ---------------------------- +-- Title:商家表 +-- Author:lcc +-- Table:lc_biz +-- --------------------------- +drop table if exists lc_biz; +create table lc_biz ( + id int(10) unsigned not null auto_increment comment '自增id', + biz_name varchar(32) not null comment '商家名称', + headimg varchar(128) not null default '' comment '商家头像', + cover varchar(128) not null default '' comment '商家封面', + brand_id int(10) unsigned not null default '0' comment '品牌id', + province_id int(10) unsigned not null default '0' comment '省id', + city_id int(10) unsigned not null default '0' comment '城市id', + county_id int(10) unsigned not null default '0' comment '区id', + area_id int(10) unsigned not null default '0' comment '商圈/路段id', + firstchar varchar(16) not null default '' comment '大写拼音首字母', + lat double(15,12) not null default '0.000000000000' comment '经度', + lng double(15,12) not null default '0.000000000000' comment '纬度', + address varchar(255) not null default '' comment '具体地址', + floor tinyint(1) not null default '0' comment '楼层', + status tinyint(1) not null default '0' 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 comment '更新时间', + primary key (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商家表' + +-- ---------------------------- +-- Title:品牌表 +-- Author:lcc +-- Table:lc_biz_brand +-- --------------------------- +drop table if exists lc_biz_brand; +create table lc_biz_brand ( + id int(10) unsigned not null auto_increment comment '自增id', + brand_name varchar(32) not null comment '品牌名称', + brand_logo varchar(128) not null default '' comment '品牌logo', + status tinyint(1) not null default '1' comment '状态 -1删除 0:禁用 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='品牌表' + +-- ---------------------------- +-- Title:商家标签关系 +-- Author:lcc +-- Table:lc_biz_tagdata +-- --------------------------- +drop table if exists lc_biz_tagdata; +create table lc_biz_tagdata ( + biz_id int(10) unsigned not null comment '商家id', + tag_id int(10) unsigned not null comment '标签id', + type tinyint(1) not null default '1' comment '1亮点标签 2附加标签', + primary key (biz_id,tag_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商家标签关系' diff --git a/sql/common.sql b/sql/common.sql new file mode 100644 index 00000000..d2fa0c95 --- /dev/null +++ b/sql/common.sql @@ -0,0 +1,17 @@ +-- ---------------------------- +-- Title:行政区域表 +-- Author:0fun +-- Table:lc_city +-- --------------------------- +drop table if exists lc_area; +create table lc_area( + id int unsigned not null auto_increment comment 'id', + province_id int unsigned not null comment '省id', + province_name varchar(32) not null comment '省名称', + city_id int unsigned not null comment '城市id', + city_name varchar(32) not null comment '城市名称', + county_id int unsigned not null comment '区id', + county_name varchar(32) not null comment '区名称', + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='行政区域表'; +alter table lc_area add firstchar varchar(4) not null default '' comment '城市大写首字母' diff --git a/sql/item.sql b/sql/item.sql new file mode 100644 index 00000000..325b8ca7 --- /dev/null +++ b/sql/item.sql @@ -0,0 +1,36 @@ +-- ---------------------------- +-- Title:行政区域表 +-- Author:lcc +-- Table:lc_items +-- --------------------------- +drop table if exists lc_items; +create table lc_items ( + id int(10) unsigned not null auto_increment comment '自增id', + brand_id int(10) unsigned not null default '0' comment '品牌id', + s_id int(10) unsigned not null default '0' comment '车系id', + v_id int(10) unsigned not null default '0' comment '车型id', + cor_id int(10) unsigned not null default '0' comment '车身颜色id', + incor_id int(10) unsigned not null default '0' comment '内饰颜色', + ori_price decimal(10,2) not null default '0.00' comment '指导价', + sale_price decimal(10,2) not null default '0.00' comment '售价', + bill_price decimal(10,2) not null default '0.00' comment '开票金额', + buy_price decimal(10,2) not null default '0.00' comment '采购成本', + dis_price decimal(10,2) not null default '0.00' comment '折扣价', + discount tinyint(3) unsigned not null default '0' comment '折扣百分比', + address varchar(100) not null default '' comment '送货地址', + vin varchar(100) not null default '' comment 'vin码', + frame_num varchar(100) not null default '' comment '车架号', + engine_num varchar(100) not null default '' comment '发动机号', + stdard_num varchar(100) not null default '' comment '合格证号', + bill_num varchar(100) not null default '' comment '开票号', + if_pack tinyint(1) unsigned not null default '0' comment '是否需要装包(0否 1是)', + status tinyint(1) not null default '1' comment '状态值(0下架 1正常 2已售)', + pro_time timestamp not null default '0000-00-00 00:00:00' comment '生产时间', + p_time timestamp not null default '0000-00-00 00:00:00' comment '分配时间', + out_time timestamp not null default '0000-00-00 00:00:00' comment '出库时间', + bill_time timestamp not null default '0000-00-00 00:00:00' comment '开票时间', + c_time int(10) 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=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品表' + diff --git a/sql/order.sql b/sql/order.sql new file mode 100644 index 00000000..1c724b09 --- /dev/null +++ b/sql/order.sql @@ -0,0 +1,58 @@ +-- ---------------------------- +-- Title:消费订单表 +-- Author:lcc +-- 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消费订单表'; + + +-- ---------------------------- +-- Title:订单总表 +-- Author:lcc +-- Table:lc_orders +-- --------------------------- +drop table if exists lc_orders; +create table lc_orders( + id int unsigned not null auto_increment, + app_id int unsigned not null default 1 comment '小程序ID', + app_uid int unsigned not null default 1 comment '小程序用户ID', + sid varchar(32) not null default '' comment '订单号', + mobile varchar(11) not null default '' comment '手机号码', + type varchar(16) not null default '' comment '订单类型(表名)', + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 comment='订单表'; diff --git a/sql/receiver/clue.sql b/sql/receiver/clue.sql new file mode 100644 index 00000000..91052a88 --- /dev/null +++ b/sql/receiver/clue.sql @@ -0,0 +1,45 @@ +-- ---------------------------- +-- 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='线索池'; + + +-- ---------------------------- +-- 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='线索操作日志表'; diff --git a/sql/receiver/customer.sql b/sql/receiver/customer.sql new file mode 100644 index 00000000..ab32da9f --- /dev/null +++ b/sql/receiver/customer.sql @@ -0,0 +1,53 @@ +-- ---------------------------- +-- Title:客户表 +-- Author:lcc +-- Table:lc_receiver_customers +-- --------------------------- +drop table if exists lc_receiver_customers; +create table lc_receiver_customers ( + id int(10) unsigned not null auto_increment comment '自增id', + rid int(10) unsigned not null default '0' comment '线索池id', + name varchar(32) not null comment '客户姓名', + mobile varchar(11) not null comment '客户手机号码', + biz_id int(10) not null default '0' comment '门店id', + brand_id int(10) not null default '0' comment '车型品牌id', + s_id int(10) not null default '0' comment '车系id', + v_id int(10) not null default '0' comment '车型号', + if_driver tinyint(4) not null default '0' comment '是否试驾(0否 1是)', + is_top tinyint(4) not null default '0' comment '是否置顶(0否 1是)', + admin_id int(10) not null default '0' comment '销售id', + level enum('h','a','b','c','d') not null default 'd' comment '用户等级', + cf_title varchar(50) not null default '' comment '来源title', + t_num tinyint(3) not null default '0' comment '试驾次数', + a_num tinyint(3) not null default '0' comment '到店次数', + p_time timestamp not null default '0000-00-00 00:00:00' comment '分配时间', + cont_time timestamp not null default '0000-00-00 00:00:00' comment '最后联系时间', + buy_time timestamp not null default '0000-00-00 00:00:00' comment '预计购买时间', + user_json json default null comment '用户其它数据', + car_json json default null comment '车信息', + jsondata json default null comment '其他信息', + status tinyint(1) not null default '0' comment '状态:-1删除 0未见客户 1到店客户 2订单客户 3战败客户', + 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_customer_oplogs +-- --------------------------- +drop table if exists lc_receiver_customer_oplogs; +create table lc_receiver_customer_oplogs ( + id int(10) unsigned not null auto_increment comment '自增id', + customer_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 '类型 0 普通 1短信 2电话', + log varchar(256) not null default '' comment '操作内容', + cf_platform varchar(10) 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='客户操作日志表'; + diff --git a/sql/receiver/order.sql b/sql/receiver/order.sql new file mode 100644 index 00000000..d13a97f6 --- /dev/null +++ b/sql/receiver/order.sql @@ -0,0 +1,182 @@ +-- ---------------------------- +-- Title:订单代办表 +-- Author:lcc +-- Table:lc_receiver_order_agents +-- --------------------------- +drop table if exists lc_receiver_order_agents; +create table lc_receiver_order_agents ( + id int(10) unsigned not null auto_increment comment '自增id', + o_id int(10) unsigned not null default '0' comment '订单表id', + car_num varchar(20) not null default '' comment '车牌号', + if_ins tinyint(1) not null default '0' comment '否是交强制险', + car_img varchar(100) not null default '' comment '行驶证', + ins_img json default null comment '保险单图片', + ins_time timestamp not null default '0000-00-00 00:00:00' comment '保险到期时间', + status tinyint(1) not null default '0' comment '状态(0未完成 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), + unique key o_id (o_id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='订单代办表'; + +-- ---------------------------- +-- Title:订单开票 +-- Author:lcc +-- Table:lc_receiver_order_bills +-- --------------------------- +drop table if exists lc_receiver_order_bills; +create table lc_receiver_order_bills ( + id int(10) unsigned not null auto_increment comment '自增id', + o_id int(10) unsigned not null default '0' comment '订单表id', + cardida varchar(100) not null default '' comment '省份证正面图片', + cardidb varchar(100) not null default '' comment '省份证正面图片', + money decimal(10,2) not null default '0.00' comment '到账金额', + file varchar(100) not null default '' comment 'pdf文件', + jsondata json default null comment 'json数据', + status tinyint(1) not null default '0' comment '状态(0未开票 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), + unique key o_id (o_id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='订单开票'; + +-- ---------------------------- +-- Title:订单车辆确定表 +-- Author:lcc +-- Table:lc_receiver_order_ckcars +-- --------------------------- +drop table if exists lc_receiver_order_ckcars; +create table lc_receiver_order_ckcars ( + id int(10) unsigned not null auto_increment comment '自增id', + o_id int(10) unsigned not null default '0' comment '订单表id', + status tinyint(1) not null default '0' comment '状态(0未确定 1后台确定 2用户签名)', + 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), + unique key o_id (o_id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='订单车辆确定表'; + +-- ---------------------------- +-- Title:订单合同信息 +-- Author:lcc +-- Table:lc_receiver_order_contracts +-- --------------------------- +drop table if exists lc_receiver_order_contracts; +create table lc_receiver_order_contracts ( + id int(10) unsigned not null auto_increment comment '自增id', + cid varchar(32) not null comment '合同编号', + o_id int(10) unsigned not null default '0' comment '订单表id', + file varchar(255) not null default '' comment '合同文件地址', + imgs json default null comment '合同图片地址', + jsondata json default null comment '其他信息', + type tinyint(1) not null default '0' comment '合同类型(0整车合同 1代理协议 2确定信息 3交接信息)', + status tinyint(1) not null default '0' comment '状态(0未签署 1已签署)', + sign_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) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='订单合同信息'; + +-- ---------------------------- +-- Title:交付确认订单 +-- Author:lcc +-- Table:lc_receiver_order_deliverys +-- --------------------------- +drop table if exists lc_receiver_order_deliverys; +create table lc_receiver_order_deliverys ( + id int(10) unsigned not null auto_increment comment '自增id', + o_id int(10) unsigned not null default '0' comment '订单表id', + status tinyint(1) not null default '0' comment '状态(0待确认 1用户已确认 2销售已确认)', + 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), + unique key o_id (o_id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='交付确认订单'; + +-- ---------------------------- +-- Title:订单贷款表 +-- Author:lcc +-- Table:lc_receiver_order_loans +-- --------------------------- +drop table if exists lc_receiver_order_loans; +create table lc_receiver_order_loans ( + id int(10) unsigned not null auto_increment comment '自增id', + o_id int(10) unsigned not null default '0' comment '订单表id', + title varchar(100) not null default '' comment '产品名称', + year tinyint(2) not null default '0' comment '贷款年限', + first_price decimal(9,2) not null default '0.00' comment '首付金额', + notify_file varchar(100) not null default '' comment '通知函文件', + lend_file varchar(100) not null default '' comment '放款函文件', + status tinyint(1) not null default '0' comment '状态(0审核中 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), + unique key o_id (o_id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='订单贷款表'; + +-- ---------------------------- +-- Title:订单操作日志表 +-- Author:lcc +-- Table:lc_receiver_order_oplogs +-- --------------------------- +drop table if exists lc_receiver_order_loans; +create table lc_receiver_order_oplogs ( + id int(10) unsigned not null auto_increment comment '自增id', + order_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 '类型 0 普通 1短信 2电话', + log varchar(256) not null default '' comment '操作内容', + cf_platform varchar(10) 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_order_signs +-- --------------------------- +drop table if exists lc_receiver_order_signs; +create table lc_receiver_order_signs ( + id int(10) unsigned not null auto_increment comment '自增id', + o_id int(10) unsigned not null default '0' comment '订单表id', + status tinyint(1) not null default '0' comment '状态(0已生成合同 1已签合同 2已预交款)', + 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), + unique key o_id (o_id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='订单合同签订'; + +-- ---------------------------- +-- Title:订单表 +-- Author:lcc +-- Table:lc_receiver_orders +-- --------------------------- +drop table if exists lc_receiver_orders; +create table lc_receiver_orders ( + id int(10) unsigned not null auto_increment comment '自增id', + rid int(10) not null default '0' comment '客户池id', + sid varchar(32) not null comment '订单号', + name varchar(32) not null comment '客户姓名', + mobile varchar(11) not null comment '客户手机号码', + biz_id int(10) not null default '0' comment '门店id', + item_id int(10) unsigned not null default '0' comment '商品id', + brand_id int(10) not null default '0' comment '车型品牌id', + s_id int(10) not null default '0' comment '车系id', + v_id int(10) not null default '0' comment '车型号', + cor_id int(10) not null default '0' comment '车身颜色id', + incor_id int(10) not null default '0' comment '内饰颜色', + price decimal(10,2) not null default '0.00' comment '车辆指导价', + deposit decimal(8,2) not null default '0.00' comment '车辆定金', + payway tinyint(1) not null default '0' comment '付款方式(0分期 1全款)', + admin_id int(10) not null default '0' comment '销售id', + info_json json default null comment '用户其它信息', + car_json json default null comment '车信息', + jsondata json default null comment '其他信息', + status tinyint(2) not null default '0' comment '状态 0签合同 1办理分期 2车辆确认 3开票 4代理服务 5车辆交付 6完成交付 7退款', + 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='订单表'; diff --git a/sql/sys.sql b/sql/sys.sql new file mode 100644 index 00000000..3de04bc6 --- /dev/null +++ b/sql/sys.sql @@ -0,0 +1,189 @@ +-- ---------------------------- +-- Title:管理员表 +-- Author:0fun +-- Table:lc_sys_admin +-- --------------------------- +-- other_json:{"cate_id":[1,27], "city_id":["350200", "350500"], "platfrom_id":[0, 1], "app_id":[1,2]} +-- cate_id:可操作行业,city_id:可操作城市,platfrom_id:可登录平台,app_id:可操作应用 +-- --------------------------- +drop table if exists lc_sys_admin; +create table lc_sys_admin( + id int unsigned not null auto_increment comment '管理id', + username varchar(32) not null comment '管理员名称', + mobile varchar(11) not null default '' comment '手机号码', + password varchar(255) not null comment '用户密码', + role_id int unsigned not null default 0 comment '角色id', + other_json text not null default '' comment '行业、城市归属 json格式 {cate_id: [1,2]}', + status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用', + c_time int 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 COMMENT='管理员表'; +alter table lc_sys_admin add login_ip varchar(16) not null default '' comment '最近登录ip' after status; + + +-- ---------------------------- +-- Title:管理日志表 +-- Author:0fun +-- Table:lc_sys_admin_log +-- --------------------------- +drop table if exists lc_sys_admin_log; +create table lc_sys_admin_log( + id int unsigned not null auto_increment comment 'id', + admin_id int unsigned not null comment '管理员id', + username varchar(32) not null comment '管理员名称', + target_id int unsigned not null default 0 comment '对象id', + descrip varchar(255) not null comment '操作描述', + action varchar(32) not null comment '操作节点', + ip varchar(32) not null default '' comment 'ip', + jsondata text not null default '' comment '更多数据', + u_time timestamp not null default current_timestamp on update current_timestamp, + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='管理日志表'; +create index idx_admin_id on lc_sys_admin_log(admin_id); +create index idx_action on lc_sys_admin_log(action); +alter table lc_sys_admin_log add type varchar(16) not null default '' comment '特殊日志类型 如jjd'; + + +-- ---------------------------- +-- Title:区域表 +-- Author:0fun +-- Table:lc_sys_area +-- --------------------------- +drop table if exists lc_sys_area; +create table lc_sys_area( + id int unsigned not null auto_increment comment 'id', + name varchar(32) not null comment '商圈/路段 名称', + province_id int unsigned not null comment '省id', + province_name varchar(32) not null comment '省名称', + city_id int unsigned not null comment '城市id', + city_name varchar(32) not null comment '城市名称', + county_id int unsigned not null comment '区id', + county_name varchar(32) not null comment '区名称', + type tinyint(1) unsigned not null default 0 comment '类型 1:商圈|2:路段|3:卖场', + status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用', + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='区域表'; + + +-- ---------------------------- +-- Title:行业分类表 +-- Author:0fun +-- Table:lc_sys_category +-- --------------------------- +drop table if exists lc_sys_category; +create table lc_sys_category( + id int unsigned not null auto_increment comment 'id', + pid int unsigned not null default 0 comment '父id', + name varchar(32) not null comment '行业分类名称', + status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用', + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='行业分类表'; + + +-- ---------------------------- +-- Title:开通城市表 +-- Author:0fun +-- Table:lc_sys_city +-- --------------------------- +drop table if exists lc_sys_city; +create table lc_sys_city( + id int unsigned not null auto_increment comment 'id', + city_id int unsigned not null comment '城市id', + name varchar(32) not null default '' comment '城市名称', + firstchar varchar(2) not null default '' comment '城市首字母', + status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用', + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='开通城市表'; + + +drop table if exists lc_sys_config; +create table lc_sys_config( + id int unsigned not null auto_increment comment '自增id', + k varchar(32) not null comment '配置key', + v text not null default '' comment '配置', + c_time int 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 COMMENT='系统配置表'; + + +-- ---------------------------- +-- Title:系统菜单表 +-- Author:0fun +-- Table:lc_sys_menu +-- --------------------------- +drop table if exists lc_sys_menu; +create table lc_sys_menu( + id int unsigned not null auto_increment comment '自增id', + pid int unsigned not null default 0 comment '父id', + name varchar(32) not null comment '菜单名称', + icon varchar(128) not null default '' comment '菜单图标', + node varchar(128) not null default '' comment '节点', + url varchar(128) not null default '' comment '链接', + sort int unsigned not null default 0 comment '排序', + status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用', + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='系统菜单表'; +alter table lc_sys_menu add outer_link tinyint(1) not null default 0 comment '是否为外链' after url; +alter table lc_sys_menu add column type tinyint(1) unsigned not null default 0 comment '类型(0总后台 1商家后台)'; + + +-- ---------------------------- +-- Title:系统角色表 +-- Author:0fun +-- Table:lc_sys_role +-- --------------------------- +drop table if exists lc_sys_role; +create table lc_sys_role( + id int unsigned not null auto_increment comment '角色id', + name varchar(32) not null comment '角色名称', + menu_ids text not null default '' comment '菜单id 都会隔开', + action_json text not null default '' comment '操作权限 json格式 {菜单id: [1,2]}', + descrip varchar(255) not null default '' comment '角色描述', + status tinyint(1) not null default 1 comment '状态 -1删除 0:禁用 1:启用', + primary key(id) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='系统角色表'; + + +-- ---------------------------- +-- Title:标签表 +-- Author:0fun +-- Table:lc_sys_tag +-- --------------------------- +drop table if exists lc_sys_tag; +create table lc_sys_tag( + id int unsigned not null auto_increment comment '自增id', + tag_name varchar(128) not null comment '标签名称', + primary key(id), + unique key (tag_name) +)ENGINE=InnoDB default CHARSET=utf8mb4 COMMENT='标签表'; + +-- ---------------------------- +-- Title:系统内容标签表 +-- Author:0fun +-- Table:lc_sys_content_tags +-- --------------------------- +drop table if exists lc_sys_content_tags; +create table lc_sys_content_tags ( + id int(10) unsigned not null auto_increment comment '自增id', + cate_id int(10) unsigned not null comment '一级分类id', + cate2_id int(10) unsigned not null comment '二级分类id', + tag_id int(10) unsigned not null comment '标签id', + status tinyint(1) not null default '1' comment '状态:-1删除,0禁用,1正常', + primary key (id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='系统内容标签表' + +-- ---------------------------- +-- Title:系统内容标签表 +-- Author:0fun +-- Table:lc_sys_tag_category +-- --------------------------- +drop table if exists lc_sys_tag_category; +create table lc_sys_tag_category ( + id int(10) unsigned not null auto_increment comment '自增id', + pid int(10) unsigned not null default '0' comment '父id', + name varchar(32) not null default '' comment '分类名称', + status tinyint(1) not null default '1' comment '状态:-1删除,0禁用,1正常', + primary key (id) +) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4 COLLATE=UTF8MB4_0900_AI_CI COMMENT='系统标签分类表'