3 changed files with 178 additions and 0 deletions
Unified View
Diff Options
@ -0,0 +1,92 @@ |
|||||
|
/*==============================================================*/ |
||||
|
/* DBMS name: MySQL 5.0 */ |
||||
|
/* Created on: 2018/9/6 12:42:36 */ |
||||
|
/*==============================================================*/ |
||||
|
|
||||
|
drop table if exists recommend_config; |
||||
|
|
||||
|
drop table if exists rel_vgoods_service_category; |
||||
|
|
||||
|
drop table if exists service_category; |
||||
|
|
||||
|
|
||||
|
/*==============================================================*/ |
||||
|
/* Table: recommend_config */ |
||||
|
/*==============================================================*/ |
||||
|
create table recommend_config |
||||
|
( |
||||
|
id int(32) not null auto_increment, |
||||
|
merchant_id bigint not null, |
||||
|
coupon_batch_id int(20) not null, |
||||
|
merchant_no varchar(32) comment '商户编号', |
||||
|
coupon_batch_no varchar(32) comment '优惠券模板编号', |
||||
|
created_at bigint comment '创建时间', |
||||
|
created_by varchar(32) comment '创建人', |
||||
|
updated_at bigint comment '更新时间', |
||||
|
updated_by varchar(32) comment '更新人', |
||||
|
del_flag tinyint default 0 comment '删除标识:0-正常,1-已删除', |
||||
|
primary key (id) |
||||
|
); |
||||
|
|
||||
|
alter table recommend_config comment '商户推荐配置'; |
||||
|
|
||||
|
/*==============================================================*/ |
||||
|
/* Table: rel_vgoods_service_category */ |
||||
|
/*==============================================================*/ |
||||
|
create table rel_vgoods_service_category |
||||
|
( |
||||
|
id int(32) not null auto_increment, |
||||
|
category_id int(32) not null, |
||||
|
template_id int(20) not null, |
||||
|
category_no varchar(32) comment '品类编号', |
||||
|
template_no varchar(32) comment '商品模板编号', |
||||
|
sort int comment '排序值', |
||||
|
created_at bigint comment '创建时间', |
||||
|
created_by varchar(32) comment '创建人', |
||||
|
updated_at bigint comment '更新时间', |
||||
|
updated_by varchar(32) comment '更新人', |
||||
|
del_flag tinyint default 0 comment '删除标识:0-正常,1-已删除', |
||||
|
primary key (id) |
||||
|
); |
||||
|
|
||||
|
alter table rel_vgoods_service_category comment '商品与服务品类关系'; |
||||
|
|
||||
|
/*==============================================================*/ |
||||
|
/* Table: service_category */ |
||||
|
/*==============================================================*/ |
||||
|
create table service_category |
||||
|
( |
||||
|
id int(32) not null auto_increment, |
||||
|
category_no varchar(32) comment '品类编号', |
||||
|
category_name varchar(20) comment '品类名称', |
||||
|
status tinyint default 0 comment '状态:0-正常,1-下架', |
||||
|
is_release tinyint default 0 comment '是否发布:0-不发布,1-发布', |
||||
|
category_image varchar(200) comment '品类图', |
||||
|
created_at bigint comment '创建时间', |
||||
|
created_by varchar(32) comment '创建人', |
||||
|
updated_at bigint comment '更新时间', |
||||
|
updated_by varchar(32) comment '更新人', |
||||
|
sort int comment '排序值', |
||||
|
del_flag tinyint default 0 comment '删除标识:0-正常,1-已删除', |
||||
|
primary key (id) |
||||
|
); |
||||
|
|
||||
|
alter table service_category comment '服务品类'; |
||||
|
|
||||
|
/*==============================================================*/ |
||||
|
/* Table: book_serve */ |
||||
|
/*==============================================================*/ |
||||
|
alter table book_serve |
||||
|
add column abnormal_remark varchar(255) comment '服务工单异常备注'; |
||||
|
|
||||
|
/*==============================================================*/ |
||||
|
/* Table: coupon_batch */ |
||||
|
/*==============================================================*/ |
||||
|
alter table coupon_batch |
||||
|
add column exchange_price bigint default 0 comment '劵售价'; |
||||
|
|
||||
|
/*==============================================================*/ |
||||
|
/* Table: coupon */ |
||||
|
/*==============================================================*/ |
||||
|
alter table coupon |
||||
|
add column exchange_price bigint default 0 comment '劵售价'; |
||||
@ -0,0 +1,69 @@ |
|||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('202', '获取服务工单列表', '/admin/web/bookServes', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('203', '服务品类列表', '/admin/web/categories', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('204', '服务品类新增', '/admin/web/categories', 'POST', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('205', '预约调度列表', '/admin/web/bookDetails', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('206', '获取订单列表', '/admin/web/orders', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('207', '服务品类排序', '/admin/web/categories/sort', 'PUT', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('208', '导出商户结算列表', '/admin/web/merchants/settlement/export', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('209', '服务品类下架', '(/admin/web/categories/).*(/off)', 'PUT', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('210', '获取服务品类', '(/admin/web/categories/).*', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('211', '服务品类编辑', '(/admin/web/categories/).*', 'POST', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('212', '获取商户结算列表', '/admin/web/merchants/settlement', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('214', '统计商户结算数据', '/admin/web/merchants/settlement/count', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('215', '服务工单异常', '(/admin/web/bookServes/).*(/status)', 'PUT', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('216', '商户推荐配置', '(/admin/web/merchant/).*(/recommend/config)', 'POST', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('217', '服务品类上架', '(/admin/web/categories/).*(/on)', 'PUT', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('218', '服务品类页', '/admin/web/serviceCategory', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('219', '商户结算页', '/admin/web/merchantSettlement', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('220', '新增编辑服务品类页', '/admin/web/addCategory', 'GET', '0', '0'); |
||||
|
INSERT INTO `1hjz`.`function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES ('221', '新增订单v2.5.0', '/admin/web/orders', 'POST', '0', '0'); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
-- 导出商户结算视图查询 |
||||
|
|
||||
|
CREATE VIEW v_consumer_book_detail_simple AS |
||||
|
SELECT |
||||
|
b.merchant_no, |
||||
|
b.book_no, |
||||
|
b.linkman, |
||||
|
b.address_telephone, |
||||
|
u.mobile register_mobile, |
||||
|
b.book_time, |
||||
|
b.time_type, |
||||
|
b.`status`, |
||||
|
b.card_no, |
||||
|
s.serve_no, |
||||
|
c.id cleaner_id, |
||||
|
c.nick_name cleaner_name, |
||||
|
c.mobile cleaner_mobile |
||||
|
FROM |
||||
|
book_detail b |
||||
|
LEFT JOIN `user` u ON b.user_id = u.user_id |
||||
|
LEFT JOIN cleaner_info c ON b.cleaner_id = c.user_id |
||||
|
LEFT JOIN book_serve s ON b.book_no = s.book_no |
||||
|
WHERE |
||||
|
b.`status` IN ('30', '91') |
||||
|
AND b.del_flag = '0'; |
||||
|
|
||||
|
|
||||
|
CREATE VIEW v_consuner_order_and_card AS |
||||
|
SELECT o.order_no,o.created_at,o.origin_total_price,o.pay_price, |
||||
|
s.card_no as service_card_no,s.card_type,s.total_service_cnt,s.serviced_cnt,s.booked_cnt |
||||
|
,IFNULL(r.commission,'0') commission |
||||
|
FROM vorder o |
||||
|
LEFT JOIN service_card s |
||||
|
ON o.order_no = s.order_no |
||||
|
LEFT JOIN |
||||
|
( |
||||
|
SELECT order_no, commission from user_recommend |
||||
|
where status = '1' |
||||
|
) r |
||||
|
ON o.order_no = r.order_no |
||||
|
WHERE 1=1 |
||||
|
AND o.`status` in ('10','11') |
||||
|
AND s.`status` < 40 |
||||
|
AND o.del_flag = '0' |
||||
|
AND s.del_flag = '0'; |
||||
@ -0,0 +1,17 @@ |
|||||
|
1、数据库备份 |
||||
|
2、执行创建表SQL脚本 |
||||
|
3、执行视图SQL脚本 |
||||
|
4、上传海报底图,命名merchant_poster.jpg |
||||
|
5、添加菜单,权限 |
||||
|
|
||||
|
|
||||
|
|
||||
|
-- 菜单管理 |
||||
|
-- 服务品类,'/admin/web/serviceCategory',193,194,195 |
||||
|
-- 结算管理,'/admin/web/merchantSettlement',208,212,214,215,219 |
||||
|
更新项 |
||||
|
预约调度,33,37,31,187,188,33,41,35,205 |
||||
|
优惠券模板列表,65,63,64,67,92,100,48,186,73 |
||||
|
服务工单,17,18,19,202 |
||||
|
订单管理,114,116,65,117,92,15,48,206,221 |
||||
|
推荐记录,163,164,216,46 |
||||
Write
Preview
Loading…
Cancel
Save