install.sql 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  1. CREATE TABLE IF NOT EXISTS `__PREFIX__service_add_order` (
  2. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  3. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  4. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  5. `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目金额',
  6. `total_cost_seconds` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '时长',
  7. `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  8. `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  9. `add_ids` varchar(122) NOT NULL COMMENT '附加项目id集合',
  10. `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  11. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  12. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  13. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  14. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  15. PRIMARY KEY (`id`),
  16. KEY `user_id` (`user_id`),
  17. KEY `order_id` (`order_id`)
  18. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附加项目订单';
  19. CREATE TABLE IF NOT EXISTS `__PREFIX__service_add_order_detail` (
  20. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  21. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  22. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  23. `goods_add_id` int(10) unsigned NOT NULL COMMENT '附加项目id',
  24. `service_add_order_id` int(10) DEFAULT NULL COMMENT '附加项目订单id',
  25. `name` varchar(40) NOT NULL COMMENT '附加项目名称',
  26. `num` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '数量',
  27. `price` decimal(10,2) unsigned NOT NULL COMMENT '附加项目金额',
  28. `cost_seconds` tinyint(1) unsigned NOT NULL COMMENT '时长',
  29. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  30. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  31. PRIMARY KEY (`id`),
  32. KEY `user_id` (`user_id`),
  33. KEY `order_id` (`order_id`)
  34. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单附加项目详情';
  35. CREATE TABLE IF NOT EXISTS `__PREFIX__service_address` (
  36. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  37. `user_id` int(10) NOT NULL COMMENT '用户id',
  38. `name` char(20) NOT NULL COMMENT '联系人',
  39. `sex` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '性别:1=男,0=女',
  40. `mobile` char(20) NOT NULL COMMENT '联系电话',
  41. `province` varchar(30) NOT NULL COMMENT '省',
  42. `city` varchar(30) NOT NULL COMMENT '市',
  43. `district` varchar(30) DEFAULT NULL COMMENT '县',
  44. `area` varchar(122) NOT NULL COMMENT '服务地址',
  45. `address` varchar(255) DEFAULT NULL COMMENT '详细地址',
  46. `lng` char(20) NOT NULL COMMENT '经度',
  47. `lat` char(20) NOT NULL COMMENT '纬度',
  48. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=非默认,1=默认',
  49. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  50. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  51. `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  52. PRIMARY KEY (`id`)
  53. ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COMMENT='地址表';
  54. CREATE TABLE IF NOT EXISTS `__PREFIX__service_apply_shop` (
  55. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  56. `user_id` int(10) unsigned NOT NULL COMMENT '商家用户id',
  57. `applytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=申请,1=完善资料',
  58. `name` varchar(30) NOT NULL COMMENT '商家名称',
  59. `abbr` char(20) NOT NULL COMMENT '缩写',
  60. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=企业,1=个体工商户',
  61. `credit_code` varchar(30) NOT NULL COMMENT '统一社会信用代码',
  62. `license_image` varchar(122) NOT NULL COMMENT '营业执照',
  63. `username` char(20) NOT NULL COMMENT '法人姓名',
  64. `mobile` char(20) NOT NULL COMMENT '法人手机号',
  65. `idcard` char(20) NOT NULL COMMENT '身份证号',
  66. `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  67. `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  68. `intro` varchar(255) NOT NULL COMMENT '商家简介',
  69. `logo_image` varchar(122) NOT NULL COMMENT 'logo',
  70. `category_ids` varchar(122) NOT NULL COMMENT '经营分类',
  71. `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  72. `leader_name` char(20) NOT NULL COMMENT '负责人姓名',
  73. `leader_mobile` char(20) NOT NULL COMMENT '负责人手机号',
  74. `trade_hour` varchar(122) DEFAULT NULL COMMENT '营业时间',
  75. `province` varchar(30) NOT NULL COMMENT '省',
  76. `city` varchar(30) NOT NULL COMMENT '市',
  77. `district` varchar(50) DEFAULT NULL COMMENT '县',
  78. `address` varchar(122) NOT NULL COMMENT '详细地址',
  79. `lng` char(20) NOT NULL COMMENT '经度',
  80. `lat` char(20) NOT NULL COMMENT '纬度',
  81. `state` enum('0','1','-1') NOT NULL DEFAULT '0' COMMENT '状态:0=待审核,1=审核通过,-1=审核拒绝',
  82. `note` varchar(30) DEFAULT NULL COMMENT '拒绝理由',
  83. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  84. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  85. PRIMARY KEY (`id`),
  86. KEY `user_id` (`user_id`)
  87. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='申请商户表';
  88. CREATE TABLE IF NOT EXISTS `__PREFIX__service_apply_skill` (
  89. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  90. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  91. `applytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=申请,1=完善资料',
  92. `name` char(20) NOT NULL COMMENT '姓名',
  93. `sex` tinyint(1) NOT NULL DEFAULT '0' COMMENT '性别:1=男,0=女',
  94. `idcard` char(20) NOT NULL COMMENT '身份证号码',
  95. `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  96. `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  97. `user_image` varchar(122) NOT NULL COMMENT '实拍照',
  98. `certificate_image` varchar(122) NOT NULL COMMENT '从业资格证',
  99. `health_image` varchar(122) NOT NULL COMMENT '健康证',
  100. `category_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '职业技能id',
  101. `skill_cate_id` int(10) unsigned NOT NULL COMMENT '服务技能id',
  102. `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  103. `image` varchar(122) NOT NULL COMMENT '工装照',
  104. `images` varchar(1500) DEFAULT NULL COMMENT '生活照',
  105. `edu` tinyint(1) unsigned NOT NULL COMMENT '学历:0=小学文化,1=初中,2=高中,3=大专,4=本科,5=硕士,6=博士',
  106. `nation` char(20) NOT NULL COMMENT '民族',
  107. `age` tinyint(1) unsigned NOT NULL COMMENT '年龄',
  108. `height` tinyint(1) DEFAULT NULL COMMENT '身高/cm',
  109. `weight` tinyint(1) DEFAULT NULL COMMENT '体重/kg',
  110. `exper` tinyint(1) NOT NULL DEFAULT '0' COMMENT '经验:0=1年以下,1=1-3年,2=3-5年,3=5年以上',
  111. `province` varchar(30) NOT NULL COMMENT '省',
  112. `city` varchar(30) NOT NULL COMMENT '市',
  113. `district` varchar(50) DEFAULT NULL COMMENT '县',
  114. `address` varchar(122) NOT NULL COMMENT '详细地址',
  115. `lng` char(20) NOT NULL COMMENT '经度',
  116. `lat` char(20) NOT NULL COMMENT '纬度',
  117. `note` varchar(30) DEFAULT NULL COMMENT '拒绝原因',
  118. `state` enum('0','1','-1') NOT NULL DEFAULT '0' COMMENT '审核状态:0=待审核,1=审核通过,-1=审核拒绝',
  119. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  120. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  121. PRIMARY KEY (`id`),
  122. KEY `city` (`city`)
  123. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='申请服务者';
  124. CREATE TABLE IF NOT EXISTS `__PREFIX__service_category` (
  125. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  126. `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级id',
  127. `name` varchar(30) NOT NULL DEFAULT '' COMMENT '分类名称',
  128. `flag` set('hot','new','recommend') NOT NULL DEFAULT '' COMMENT '标志(多选):hot=热门,new=新产品,recommend=推荐',
  129. `image` varchar(100) NOT NULL DEFAULT '' COMMENT '分类图标',
  130. `is_show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否首页显示:0=否,1=是',
  131. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
  132. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  133. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  134. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  135. PRIMARY KEY (`id`),
  136. KEY `pid_index` (`pid`),
  137. KEY `weigh` (`weigh`)
  138. ) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb4 COMMENT='项目分类表';
  139. CREATE TABLE IF NOT EXISTS `__PREFIX__service_city_config` (
  140. `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  141. `city` varchar(30) NOT NULL COMMENT '城市名',
  142. `init_price` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '起步价',
  143. `init_distance` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '起步里程/公里',
  144. `add_price` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '增加1公里增加费用',
  145. `bus_start` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '公交车开启时间(24小时制)',
  146. `bus_end` tinyint(1) NOT NULL DEFAULT '0' COMMENT '公交车结束时间(24小时制)',
  147. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  148. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  149. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  150. PRIMARY KEY (`id`),
  151. UNIQUE KEY `city` (`city`),
  152. KEY `weigh` (`weigh`)
  153. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='城市出行配置表';
  154. CREATE TABLE IF NOT EXISTS `__PREFIX__service_comment` (
  155. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  156. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  157. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  158. `skill_id` int(10) DEFAULT NULL COMMENT '服务人员id',
  159. `shop_id` int(10) DEFAULT NULL COMMENT '商家id',
  160. `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  161. `score` tinyint(1) unsigned NOT NULL DEFAULT '5' COMMENT '评分',
  162. `comment_label_ids` varchar(60) DEFAULT NULL COMMENT '评论标签id',
  163. `comment_label` varchar(255) DEFAULT NULL COMMENT '标签内容',
  164. `content` text COMMENT '评论内容',
  165. `images` varchar(800) DEFAULT NULL COMMENT '图片',
  166. `is_img` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '有图:0=否,1=是',
  167. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  168. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  169. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  170. PRIMARY KEY (`id`),
  171. UNIQUE KEY `order_id` (`order_id`),
  172. KEY `goods_id` (`goods_id`),
  173. KEY `skill_id` (`skill_id`) USING BTREE,
  174. KEY `shop_id` (`shop_id`) USING BTREE
  175. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='评论表';
  176. CREATE TABLE IF NOT EXISTS `__PREFIX__service_comment_label` (
  177. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  178. `name` varchar(30) NOT NULL COMMENT '标签内容',
  179. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  180. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  181. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  182. `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  183. PRIMARY KEY (`id`)
  184. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='评论标签表';
  185. CREATE TABLE IF NOT EXISTS `__PREFIX__service_common_questions` (
  186. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  187. `title` varchar(60) NOT NULL COMMENT '问题标题',
  188. `content` longtext NOT NULL COMMENT '内容',
  189. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  190. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  191. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  192. PRIMARY KEY (`id`)
  193. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='常见问题表';
  194. CREATE TABLE IF NOT EXISTS `__PREFIX__service_complaint` (
  195. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  196. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  197. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  198. `complaint_content` varchar(255) NOT NULL COMMENT '投诉内容',
  199. `content` text COMMENT '补充内容',
  200. `images` varchar(500) DEFAULT NULL COMMENT '图片',
  201. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待处理,1=已处理,-1=已拒绝',
  202. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  203. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  204. PRIMARY KEY (`id`),
  205. KEY `order_id` (`order_id`)
  206. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投诉表';
  207. CREATE TABLE IF NOT EXISTS `__PREFIX__service_complaint_reason` (
  208. `id` int(16) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  209. `name` varchar(60) NOT NULL COMMENT '原因',
  210. `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  211. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  212. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  213. PRIMARY KEY (`id`)
  214. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='投诉原因表';
  215. CREATE TABLE IF NOT EXISTS `__PREFIX__service_config_text` (
  216. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  217. `name` varchar(30) NOT NULL COMMENT '文本名称',
  218. `content` mediumtext NOT NULL COMMENT '文本名称',
  219. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  220. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  221. PRIMARY KEY (`id`)
  222. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='富文本表';
  223. CREATE TABLE IF NOT EXISTS `__PREFIX__service_coupon` (
  224. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  225. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券类型:0=平台通用券,1=平台项目券,2=商户通用券,3=商户项目券,4=口令券',
  226. `goods_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '项目id',
  227. `shop_id` int(10) NOT NULL DEFAULT '0' COMMENT '商户id',
  228. `code` char(20) DEFAULT NULL COMMENT '口令',
  229. `achieve` int(10) unsigned NOT NULL COMMENT '满',
  230. `reduce` int(10) unsigned NOT NULL COMMENT '减',
  231. `starttime` bigint(16) NOT NULL COMMENT '展示开始时间',
  232. `endtime` bigint(16) NOT NULL COMMENT '展示结束时间',
  233. `effective_day` int(10) unsigned NOT NULL COMMENT '领取后有效期/天',
  234. `is_check` tinyint(1) NOT NULL DEFAULT '0' COMMENT '审核状态:0=待审核,1=审核通过,-1=审核未通过',
  235. `note` varchar(100) DEFAULT NULL COMMENT '拒绝原因',
  236. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  237. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  238. PRIMARY KEY (`id`)
  239. ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COMMENT='优惠券表';
  240. CREATE TABLE IF NOT EXISTS `__PREFIX__service_ensure_log` (
  241. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  242. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  243. `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更保证金',
  244. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=服务者,1=商户',
  245. `memo` varchar(255) NOT NULL COMMENT '备注',
  246. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  247. PRIMARY KEY (`id`)
  248. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='保证金日志';
  249. CREATE TABLE IF NOT EXISTS `__PREFIX__service_feedback` (
  250. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  251. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  252. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=用户端,1=服务端,2=商户端',
  253. `content` text NOT NULL COMMENT '反馈内容',
  254. `images` varchar(1000) DEFAULT NULL COMMENT '图片',
  255. `mobile` char(20) DEFAULT NULL COMMENT '手机号',
  256. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待处理,1=已处理',
  257. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  258. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  259. PRIMARY KEY (`id`)
  260. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='反馈意见表';
  261. CREATE TABLE IF NOT EXISTS `__PREFIX__service_follow` (
  262. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  263. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  264. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=服务者,1=服务项目,2=商家',
  265. `follow_id` int(10) unsigned NOT NULL COMMENT '被关注id',
  266. `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=取消关注,1=关注',
  267. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  268. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  269. PRIMARY KEY (`id`)
  270. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='关注表';
  271. CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods` (
  272. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  273. `name` varchar(30) NOT NULL COMMENT '项目名称',
  274. `category_id` int(10) unsigned NOT NULL COMMENT '一级分类',
  275. `two_category_id` int(10) unsigned NOT NULL COMMENT '二级分类',
  276. `skill_cate_ids` varchar(60) NOT NULL COMMENT '所属服务人员分类',
  277. `shop_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商户id',
  278. `shop_user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商户的用户id',
  279. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '项目类型:0=平台项目,1=商户项目',
  280. `province` char(20) DEFAULT NULL COMMENT '省',
  281. `city` char(20) DEFAULT NULL COMMENT '市',
  282. `district` char(30) DEFAULT NULL COMMENT '县',
  283. `to_shop` set('door','shop') DEFAULT 'door' COMMENT '服务方式:door=上门服务,shop=到店核销',
  284. `is_travel` tinyint(1) NOT NULL DEFAULT '0' COMMENT '开启出行:0=否,1=是',
  285. `tag_name` varchar(60) DEFAULT NULL COMMENT '项目标签',
  286. `image` varchar(100) NOT NULL COMMENT '项目主图',
  287. `images` varchar(1500) NOT NULL COMMENT '项目轮播图',
  288. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目价格',
  289. `start_hour` tinyint(1) NOT NULL DEFAULT '6' COMMENT '预约开始(0-23时)',
  290. `end_hour` tinyint(1) NOT NULL DEFAULT '18' COMMENT '预约结束(0-23时)',
  291. `cost_seconds` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '时长/分钟',
  292. `response_hour` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '最快响应时间/小时',
  293. `spec_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '规格类型:0=单规格,1=多规格',
  294. `choose_skill_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '选择技师:0=否,1=是',
  295. `flow_path_images` varchar(1500) NOT NULL COMMENT '服务流程',
  296. `illustrate_images` varchar(1500) NOT NULL COMMENT '服务说明',
  297. `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
  298. `shop_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '商户项目状态:0=待审核,1=审核通过,-1=审核拒绝',
  299. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '上架状态:normal=上架,hidden=下架',
  300. `note` varchar(100) DEFAULT NULL COMMENT '拒绝原因',
  301. `weigh` int(10) DEFAULT '0' COMMENT '权重',
  302. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  303. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  304. `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  305. PRIMARY KEY (`id`),
  306. KEY `salesnum` (`salenums`),
  307. KEY `category1` (`category_id`),
  308. KEY `category2` (`two_category_id`),
  309. KEY `price` (`price`),
  310. KEY `shop_id` (`shop_id`)
  311. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='项目表';
  312. CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods_add` (
  313. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  314. `goods_id` int(10) NOT NULL COMMENT '所属项目id',
  315. `name` varchar(60) NOT NULL COMMENT '附加项目名称',
  316. `price` decimal(10,2) NOT NULL COMMENT '价格',
  317. `cost_seconds` int(10) unsigned NOT NULL COMMENT '时长/分钟',
  318. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  319. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  320. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  321. PRIMARY KEY (`id`)
  322. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附加项目表';
  323. CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods_sku` (
  324. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  325. `goods_id` int(10) unsigned DEFAULT NULL COMMENT '商品id',
  326. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '项目类型:0=普通项目,1=可入套餐项目',
  327. `name` varchar(50) NOT NULL COMMENT '规格名称',
  328. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '价格',
  329. `cost_seconds` int(10) unsigned NOT NULL COMMENT '时长/分钟',
  330. `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
  331. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:hidden=未使用,normal=使用中',
  332. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  333. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  334. PRIMARY KEY (`id`),
  335. KEY `goods_id` (`goods_id`)
  336. ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COMMENT='商品sku表';
  337. CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods_spu` (
  338. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  339. `goods_id` int(10) NOT NULL COMMENT '商品id',
  340. `name` varchar(50) NOT NULL COMMENT '规格名称',
  341. `skudetail` varchar(500) NOT NULL COMMENT '规格详情',
  342. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:hidden=隐藏,normal=正常',
  343. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  344. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  345. PRIMARY KEY (`id`)
  346. ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COMMENT='商品spu';
  347. CREATE TABLE IF NOT EXISTS `__PREFIX__service_join_shop` (
  348. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  349. `skill_id` int(10) unsigned NOT NULL COMMENT '服务人员id',
  350. `skill_name` char(20) NOT NULL COMMENT '服务人员姓名',
  351. `shop_id` int(10) unsigned NOT NULL COMMENT '商户id',
  352. `shop_name` varchar(40) NOT NULL COMMENT '商家名称',
  353. `code` char(10) NOT NULL COMMENT '商家码',
  354. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待审核,1=审核通过,-1=审核拒绝',
  355. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  356. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  357. PRIMARY KEY (`id`)
  358. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='申请加入门店';
  359. CREATE TABLE IF NOT EXISTS `__PREFIX__service_jump` (
  360. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  361. `name` varchar(30) NOT NULL COMMENT '链接名称',
  362. `url` varchar(30) NOT NULL COMMENT '跳转链接',
  363. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  364. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  365. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  366. PRIMARY KEY (`id`)
  367. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='跳转链接';
  368. CREATE TABLE IF NOT EXISTS `__PREFIX__service_mini_template` (
  369. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  370. `user_notice_template` varchar(500) DEFAULT NULL COMMENT '接单通知',
  371. `user_order_template` varchar(500) DEFAULT NULL COMMENT '订单状态通知',
  372. `order_finish_template` varchar(500) DEFAULT NULL COMMENT '订单完成推送用户',
  373. `user_sales_template` varchar(500) DEFAULT NULL COMMENT '售后处理通知',
  374. `user_complaint_template` varchar(500) DEFAULT NULL COMMENT '用户投诉结果通知',
  375. `skill_order_template` varchar(500) DEFAULT NULL COMMENT '服务者订单通知',
  376. `skill_sales_template` varchar(500) DEFAULT NULL COMMENT '服务者售后订单通知',
  377. `shop_order_template` varchar(500) DEFAULT NULL COMMENT '商户新订单通知',
  378. `shop_finish_template` varchar(500) DEFAULT NULL COMMENT '商户订单完成通知',
  379. `shop_sales_template` varchar(500) DEFAULT NULL COMMENT '商户售后通知',
  380. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  381. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  382. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  383. PRIMARY KEY (`id`)
  384. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='微信推送配置';
  385. CREATE TABLE IF NOT EXISTS `__PREFIX__service_notice` (
  386. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  387. `title` varchar(60) NOT NULL COMMENT '标题',
  388. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=用户端,1=服务端,2=商户端',
  389. `image` varchar(122) NOT NULL COMMENT '封面图',
  390. `content` mediumtext NOT NULL COMMENT '内容',
  391. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  392. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  393. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  394. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  395. PRIMARY KEY (`id`)
  396. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='平台公告表';
  397. CREATE TABLE IF NOT EXISTS `__PREFIX__service_order` (
  398. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  399. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  400. `ordertype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单类型:0=普通订单,1=套餐订单',
  401. `package_order_id` int(10) DEFAULT NULL COMMENT '套餐卡订单id',
  402. `leader_id` int(10) DEFAULT '0' COMMENT '上级分销商id',
  403. `rec_leader_id` int(10) NOT NULL DEFAULT '0' COMMENT '上上级分销商id',
  404. `skill_id` int(10) DEFAULT NULL COMMENT '服务者id',
  405. `shop_id` int(10) DEFAULT NULL COMMENT '商户id',
  406. `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  407. `traveltype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '出行方式:0=免费出行,1=出租车,2=公交',
  408. `choose_skill_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '选择技师:0=否,1=是',
  409. `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  410. `to_shop` enum('door','shop') NOT NULL DEFAULT 'door' COMMENT '服务方式:door=上门服务,shop=到店核销',
  411. `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  412. `city` varchar(30) NOT NULL COMMENT '城市',
  413. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目金额',
  414. `distance` float(8,2) NOT NULL DEFAULT '0.00' COMMENT '距离/km',
  415. `travel_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '出行费用',
  416. `sumprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总金额',
  417. `goods_total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目实际总金额',
  418. `discount` tinyint(1) unsigned NOT NULL DEFAULT '100' COMMENT '折扣%',
  419. `coupon_id` int(10) DEFAULT NULL COMMENT '优惠券id',
  420. `coupon_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券金额',
  421. `premium_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '补价',
  422. `add_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '附加项目金额',
  423. `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  424. `act_travel_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际结算车费',
  425. `refund_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',
  426. `settle_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '结算金额',
  427. `total_cost_seconds` int(10) unsigned DEFAULT NULL COMMENT '项目总时长',
  428. `starttime` bigint(16) DEFAULT NULL COMMENT '开始时间',
  429. `endtime` bigint(16) DEFAULT NULL COMMENT '结束时间',
  430. `actendtime` bigint(16) DEFAULT NULL COMMENT '实际结束时间',
  431. `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  432. `memo` varchar(100) DEFAULT NULL COMMENT '订单备注',
  433. `qrcode_image` varchar(122) DEFAULT NULL COMMENT '核销码',
  434. `check_name` char(20) DEFAULT NULL COMMENT '核销码内容',
  435. `is_service` tinyint(1) NOT NULL DEFAULT '0' COMMENT '售后状态:0=未售后,1=售后中,2=已退款,-1=已拒绝',
  436. `is_complaint` tinyint(1) NOT NULL DEFAULT '0' COMMENT '投诉状态:0=未投诉,1=已投诉',
  437. `is_pool` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单池:0=否,1=是',
  438. `is_settle` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态:0=未结算,1=待结算,2=已结算',
  439. `skill_percent` tinyint(1) NOT NULL DEFAULT '0' COMMENT '服务者分佣比例',
  440. `shop_percent` tinyint(1) NOT NULL DEFAULT '0' COMMENT '商户分佣比例',
  441. `skill_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '服务者佣金',
  442. `shop_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '门店佣金',
  443. `platform_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '平台收益',
  444. `leader_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '直推分佣',
  445. `rec_leader_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '间推分佣',
  446. `dis_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '分销金额',
  447. `reach_images` varchar(1000) DEFAULT NULL COMMENT '到达拍照',
  448. `finish_images` varchar(1000) DEFAULT NULL COMMENT '完成服务拍照',
  449. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态:0=待支付,1=待接单,2=待出发,3=已出发,4=已到达,5=服务中,6=已完成,7=已评价,-1=已取消',
  450. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  451. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  452. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  453. `accepttime` bigint(16) DEFAULT NULL COMMENT '接单时间',
  454. `gotime` bigint(16) DEFAULT NULL COMMENT '出发时间',
  455. `reachtime` bigint(16) DEFAULT NULL COMMENT '到达时间',
  456. `servicetime` bigint(16) DEFAULT NULL COMMENT '开始服务时间',
  457. `finishtime` bigint(16) DEFAULT NULL COMMENT '服务完成时间',
  458. `settletime` bigint(16) DEFAULT NULL COMMENT '结算时间',
  459. `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  460. PRIMARY KEY (`id`),
  461. UNIQUE KEY `user_unique` (`user_id`,`createtime`),
  462. KEY `user_id` (`user_id`),
  463. KEY `skill_id` (`skill_id`),
  464. KEY `shop_id` (`shop_id`),
  465. KEY `status` (`status`),
  466. KEY `is_service` (`is_service`),
  467. KEY `is_settle` (`is_settle`),
  468. KEY `goods_id` (`goods_id`)
  469. ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COMMENT='订单表';
  470. CREATE TABLE IF NOT EXISTS `__PREFIX__service_order_address` (
  471. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  472. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  473. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  474. `name` char(20) NOT NULL COMMENT '姓名',
  475. `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别:1=男,0=女',
  476. `mobile` char(20) NOT NULL COMMENT '手机号',
  477. `province` varchar(30) NOT NULL COMMENT '省',
  478. `city` varchar(30) NOT NULL COMMENT '市',
  479. `district` varchar(50) NOT NULL COMMENT '县',
  480. `address` varchar(122) NOT NULL COMMENT '详细地址',
  481. `area` varchar(255) NOT NULL COMMENT '服务地址',
  482. `lng` char(20) NOT NULL COMMENT '经度',
  483. `lat` char(20) NOT NULL COMMENT '纬度',
  484. `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=已取消,1=使用中',
  485. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  486. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  487. PRIMARY KEY (`id`),
  488. KEY `order_id` (`order_id`)
  489. ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COMMENT='订单地址';
  490. CREATE TABLE IF NOT EXISTS `__PREFIX__service_order_detail` (
  491. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  492. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  493. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  494. `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  495. `goods_sku_id` int(10) DEFAULT NULL COMMENT '项目规格id',
  496. `skill_id` int(10) DEFAULT NULL COMMENT '服务人员id',
  497. `name` varchar(30) NOT NULL COMMENT '项目名称',
  498. `image` varchar(122) DEFAULT NULL COMMENT '项目图片',
  499. `sku_name` varchar(30) DEFAULT NULL COMMENT '规格名称',
  500. `num` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '项目数量',
  501. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目单价',
  502. `sumprice` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '项目总价',
  503. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  504. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  505. PRIMARY KEY (`id`),
  506. KEY `order_id` (`order_id`)
  507. ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COMMENT='订单详情表';
  508. CREATE TABLE IF NOT EXISTS `__PREFIX__service_order_log` (
  509. `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  510. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  511. `user_id` int(10) unsigned NOT NULL COMMENT '订单用户id',
  512. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态:0=创建订单,1=已支付,2=服务者已接单,3=已出发,4=已到达,5=服务中,6=已完成,7=已评价,8=申请退款,9=已退款,10=申请退款拒绝,11=订单投诉,12=订单补差价,13=订单添加附加项目,14=订单已分配,15=商户已接单,16=平台已分配,17=用户取消申请退款,18=投诉已处理',
  513. `content` text NOT NULL COMMENT '内容',
  514. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  515. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  516. PRIMARY KEY (`id`),
  517. KEY `user_id` (`order_id`)
  518. ) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4 COMMENT='订单日志';
  519. CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_card` (
  520. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  521. `name` varchar(122) NOT NULL COMMENT '套餐名称',
  522. `images` varchar(1000) NOT NULL COMMENT '套餐图片',
  523. `original_price` decimal(10,2) unsigned NOT NULL COMMENT '套餐原价',
  524. `price` decimal(10,2) unsigned NOT NULL COMMENT '现价',
  525. `info_images` varchar(1500) NOT NULL COMMENT '套餐详情',
  526. `flow_images` varchar(1500) NOT NULL COMMENT '套餐流程',
  527. `refund_content` text NOT NULL COMMENT '退订说明',
  528. `daynums` int(10) unsigned NOT NULL COMMENT '有效天数(0=无限)',
  529. `plus_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '参与会员折扣:0=否,1=是',
  530. `show_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '产品详情页展示:0=否,1=是',
  531. `coupon_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '使用优惠券:0=否,1=是',
  532. `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
  533. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  534. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:normal=上架,hidden=下架',
  535. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  536. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  537. PRIMARY KEY (`id`)
  538. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='套餐卡';
  539. CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_goods` (
  540. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  541. `package_card_id` int(10) unsigned NOT NULL COMMENT '套餐卡id',
  542. `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  543. `goods_sku_id` int(10) NOT NULL COMMENT '商品规格id',
  544. `goodsname` varchar(30) NOT NULL COMMENT '商品名称',
  545. `name` varchar(50) NOT NULL COMMENT '规格名称',
  546. `original_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '原价',
  547. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '套餐价',
  548. `cost_seconds` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '时长/分钟',
  549. `unit` char(20) DEFAULT NULL COMMENT '单位',
  550. `nums` int(10) unsigned NOT NULL COMMENT '套餐次数',
  551. `total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总价',
  552. `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:hidden=未使用,normal=使用中',
  553. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  554. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  555. PRIMARY KEY (`id`)
  556. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='套餐商品表';
  557. CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_order` (
  558. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  559. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  560. `package_card_id` int(10) unsigned NOT NULL COMMENT '套餐id',
  561. `name` varchar(40) NOT NULL COMMENT '套餐名称',
  562. `image` varchar(122) DEFAULT NULL COMMENT '套餐图片',
  563. `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  564. `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  565. `original_price` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '套餐原价',
  566. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '现价',
  567. `discount` tinyint(1) unsigned NOT NULL DEFAULT '100' COMMENT '折扣%',
  568. `coupon_id` int(10) DEFAULT NULL COMMENT '优惠券id',
  569. `coupon_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券金额',
  570. `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  571. `total_refund_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最多退款金额',
  572. `refund_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际退款金额',
  573. `starttime` bigint(16) DEFAULT NULL COMMENT '套餐开始时间(空为永久)',
  574. `endtime` bigint(16) DEFAULT NULL COMMENT '套餐结束时间(空为永久)',
  575. `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  576. `is_service` tinyint(1) NOT NULL DEFAULT '0' COMMENT '售后状态:0=未售后,1=售后中,2=已退款,-1=已拒绝',
  577. `original_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '原先状态',
  578. `note` varchar(60) DEFAULT NULL COMMENT '拒绝原因',
  579. `is_update` tinyint(1) NOT NULL DEFAULT '0' COMMENT '更新时间:0=未更新,1=已更新',
  580. `total_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总次数',
  581. `use_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已使用次数',
  582. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=已支付,-1=已失效,2=已完成,-2=退款中,-3=已退款',
  583. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  584. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  585. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  586. PRIMARY KEY (`id`),
  587. KEY `user_id` (`user_id`),
  588. KEY `package_card_id` (`package_card_id`)
  589. ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COMMENT='套餐卡订单';
  590. CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_order_detail` (
  591. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  592. `package_order_id` int(10) unsigned NOT NULL COMMENT '套餐订单id',
  593. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  594. `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  595. `goods_sku_id` int(10) unsigned NOT NULL COMMENT '商品规格id',
  596. `goodsname` varchar(30) NOT NULL COMMENT '商品名称',
  597. `name` varchar(50) NOT NULL COMMENT '规格名称',
  598. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目价格',
  599. `act_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '实际价格',
  600. `total_price` decimal(10,2) DEFAULT '0.00' COMMENT '总价',
  601. `cost_seconds` int(10) NOT NULL DEFAULT '0' COMMENT '时长/分钟',
  602. `unit` char(20) DEFAULT NULL COMMENT '单位',
  603. `nums` int(10) NOT NULL COMMENT '次数',
  604. `usenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用次数',
  605. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  606. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  607. PRIMARY KEY (`id`)
  608. ) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8mb4 COMMENT='套餐订单项目详情';
  609. CREATE TABLE IF NOT EXISTS `__PREFIX__service_plus_config` (
  610. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  611. `name` varchar(30) NOT NULL COMMENT '会员名称',
  612. `daynums` int(3) unsigned NOT NULL COMMENT '有效天数',
  613. `original_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '原价',
  614. `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '现价',
  615. `discount` tinyint(1) unsigned NOT NULL COMMENT '享受折扣%',
  616. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  617. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  618. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  619. `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  620. PRIMARY KEY (`id`)
  621. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='会员配置';
  622. CREATE TABLE IF NOT EXISTS `__PREFIX__service_plus_pay` (
  623. `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  624. `user_id` int(10) NOT NULL COMMENT '用户id',
  625. `plus_id` int(10) unsigned NOT NULL COMMENT '选取配置id',
  626. `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  627. `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  628. `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  629. `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  630. `is_update` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态:0=会员未更新,1=会员已更新',
  631. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  632. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  633. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  634. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  635. PRIMARY KEY (`id`)
  636. ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COMMENT='会员支付';
  637. CREATE TABLE IF NOT EXISTS `__PREFIX__service_premium_order` (
  638. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  639. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  640. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  641. `paytype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  642. `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '补充价',
  643. `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  644. `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  645. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  646. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  647. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  648. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  649. PRIMARY KEY (`id`),
  650. KEY `user_id` (`user_id`),
  651. KEY `order_id` (`order_id`)
  652. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='补差价表';
  653. CREATE TABLE IF NOT EXISTS `__PREFIX__service_project_config` (
  654. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  655. `service_mobile` char(20) DEFAULT NULL COMMENT '客服电话',
  656. `cooperate_mobile` char(20) DEFAULT NULL COMMENT '合作电话',
  657. `user_notice` varchar(255) DEFAULT NULL COMMENT '用户端小广播',
  658. `skill_notice` varchar(255) DEFAULT NULL COMMENT '服务端小广播',
  659. `shop_notice` varchar(255) DEFAULT NULL COMMENT '商家端小广播',
  660. `refund_notice` varchar(122) DEFAULT NULL COMMENT '退款注意事项',
  661. `head_image` varchar(122) DEFAULT NULL COMMENT '默认头像',
  662. `user_privacy_info_id` int(10) DEFAULT NULL COMMENT '用户端隐私政策',
  663. `user_agreement_info_id` int(10) DEFAULT NULL COMMENT '用户端用户协议',
  664. `service_privacy_info_id` int(10) DEFAULT NULL COMMENT '服务端隐私政策',
  665. `service_agreement_info_id` int(10) DEFAULT NULL COMMENT '服务端用户协议',
  666. `shop_privacy_info_id` int(10) DEFAULT NULL COMMENT '商家端隐私政策',
  667. `shop_agreement_info_id` int(10) DEFAULT NULL COMMENT '商家端用户协议',
  668. `plus_info_id` int(10) DEFAULT NULL COMMENT '充值会员须知',
  669. `service_ensure_info_id` int(10) DEFAULT NULL COMMENT '服务端保证金',
  670. `shop_ensure_info_id` int(10) DEFAULT NULL COMMENT '商家端保证金',
  671. `skill_equity_info_id` int(10) DEFAULT NULL COMMENT '服务者保证金权益',
  672. `shop_equity_info_id` int(10) DEFAULT NULL COMMENT '商户端保证金权益',
  673. `recharge_info_id` int(10) DEFAULT NULL COMMENT '充值须知',
  674. `withdraw_info_id` int(10) DEFAULT NULL COMMENT '提现须知',
  675. `exchange_info_id` int(10) DEFAULT NULL COMMENT '兑换须知',
  676. `settle_day` int(5) unsigned NOT NULL DEFAULT '1' COMMENT '平台订单结算日期',
  677. `cancel_minute` int(10) unsigned NOT NULL COMMENT '超时未支付取消',
  678. `comment_day` tinyint(1) unsigned NOT NULL COMMENT '超时未评价',
  679. `withdrawtype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '提现方式:0=月,1=周',
  680. `accept_nums` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '默认服务者接单数',
  681. `shop_accept_nums` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '默认商户可接单数',
  682. `service_nums` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '默认商家服务者数量',
  683. `day` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '具体提现日期',
  684. `user_image` varchar(122) DEFAULT NULL COMMENT '用户端logo',
  685. `user_name` varchar(122) DEFAULT NULL COMMENT '用户端名称',
  686. `user_intro` varchar(255) DEFAULT NULL COMMENT '用户端描述',
  687. `skill_image` varchar(122) DEFAULT NULL COMMENT '服务端logo',
  688. `skill_name` varchar(122) DEFAULT NULL COMMENT '服务端名称',
  689. `skill_intro` varchar(255) DEFAULT NULL COMMENT '服务端描述',
  690. `shop_image` varchar(122) DEFAULT NULL COMMENT '商户端logo',
  691. `shop_name` varchar(122) DEFAULT NULL COMMENT '商户端名称',
  692. `shop_intro` varchar(255) DEFAULT NULL COMMENT '商户端简介',
  693. `home_notice_image` varchar(122) DEFAULT NULL COMMENT '首页通知图片',
  694. `home_notice_word` text COMMENT '首页通知文字',
  695. `home_notice_url` varchar(122) DEFAULT NULL COMMENT '首页通知跳转链接',
  696. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=取消,1=使用',
  697. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  698. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  699. PRIMARY KEY (`id`),
  700. KEY `state` (`state`)
  701. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='项目配置表';
  702. CREATE TABLE IF NOT EXISTS `__PREFIX__service_project_configure` (
  703. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  704. `userappid` varchar(40) DEFAULT NULL COMMENT '用户端appid',
  705. `usersecret` varchar(40) DEFAULT NULL COMMENT '用户端secret',
  706. `skillappid` varchar(40) DEFAULT NULL COMMENT '服务端appid',
  707. `skillsecret` varchar(40) DEFAULT NULL COMMENT '服务端secret',
  708. `shopappid` varchar(40) DEFAULT NULL COMMENT '商户端appid',
  709. `shopsecret` varchar(40) DEFAULT NULL COMMENT '商户端secret',
  710. `gaodekey` varchar(40) DEFAULT NULL COMMENT '高德key',
  711. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=暂停中,1=使用中',
  712. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  713. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  714. PRIMARY KEY (`id`),
  715. KEY `state` (`state`)
  716. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='项目配置';
  717. CREATE TABLE IF NOT EXISTS `__PREFIX__service_rebate` (
  718. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  719. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  720. `from_user_id` int(10) unsigned NOT NULL COMMENT '来源用户id',
  721. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=服务者佣金,1=商户商户佣金',
  722. `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  723. `num` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '返佣金额',
  724. `rebatetype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '佣金来源:0=平台,1=门店,2=车费',
  725. `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  726. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待结算,1=已结算',
  727. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  728. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  729. PRIMARY KEY (`id`),
  730. KEY `user_id` (`user_id`),
  731. KEY `order_id` (`id`)
  732. ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COMMENT='返佣记录表';
  733. CREATE TABLE IF NOT EXISTS `__PREFIX__service_rebate_money_log` (
  734. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  735. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  736. `money` char(20) NOT NULL COMMENT '变更金额',
  737. `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  738. `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  739. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  740. PRIMARY KEY (`id`)
  741. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='佣金记录表';
  742. CREATE TABLE IF NOT EXISTS `__PREFIX__service_recharge` (
  743. `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  744. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  745. `recharge_package_id` int(10) unsigned NOT NULL COMMENT '充值套餐id',
  746. `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '充值金额',
  747. `gift_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '赠送金额',
  748. `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  749. `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  750. `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  751. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  752. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  753. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  754. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  755. PRIMARY KEY (`id`)
  756. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值表';
  757. CREATE TABLE IF NOT EXISTS `__PREFIX__service_recharge_package` (
  758. `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  759. `price` decimal(10,2) unsigned NOT NULL COMMENT '充值金额',
  760. `gift_price` decimal(10,2) unsigned NOT NULL COMMENT '赠送金额',
  761. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  762. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  763. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  764. PRIMARY KEY (`id`)
  765. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='充值套餐表';
  766. CREATE TABLE IF NOT EXISTS `__PREFIX__service_refund_order` (
  767. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  768. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  769. `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  770. `refund_reason` varchar(100) NOT NULL COMMENT '退款原因',
  771. `refund_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',
  772. `images` varchar(500) DEFAULT NULL COMMENT '图片',
  773. `content` mediumtext COMMENT '补充原因',
  774. `is_dec` tinyint(1) NOT NULL DEFAULT '0' COMMENT '扣除保证金:0=否,1=是',
  775. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待审核,1=审核通过,-1=审核拒绝,-2=已取消',
  776. `note` varchar(122) DEFAULT NULL COMMENT '拒绝原因',
  777. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  778. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  779. PRIMARY KEY (`id`)
  780. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='订单退款表';
  781. CREATE TABLE IF NOT EXISTS `__PREFIX__service_refund_reason` (
  782. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  783. `name` varchar(80) NOT NULL COMMENT '原因',
  784. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  785. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  786. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  787. PRIMARY KEY (`id`)
  788. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='退款原因表';
  789. CREATE TABLE IF NOT EXISTS `__PREFIX__service_search_log` (
  790. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  791. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  792. `name` varchar(60) NOT NULL COMMENT '搜索内容',
  793. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  794. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  795. PRIMARY KEY (`id`),
  796. KEY `user_id` (`user_id`)
  797. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='搜索日志表';
  798. CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop` (
  799. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  800. `user_id` int(10) unsigned NOT NULL COMMENT '商家用户id',
  801. `to_shop` tinyint(1) NOT NULL DEFAULT '0' COMMENT '开启到店:0=否,1=是',
  802. `ensure_id` int(10) DEFAULT NULL COMMENT '保证金id',
  803. `ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金',
  804. `ensure_name` varchar(30) DEFAULT NULL COMMENT '保证金等级名称',
  805. `accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '每日可接单数量',
  806. `already_accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已接单数量',
  807. `service_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '服务人员数量',
  808. `already_service_nums` int(10) NOT NULL DEFAULT '0' COMMENT '已拥有人员数量',
  809. `name` varchar(40) NOT NULL COMMENT '商家名称',
  810. `abbr` char(20) NOT NULL COMMENT '商户缩写',
  811. `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=企业,1=个体工商户',
  812. `code` int(10) NOT NULL COMMENT '商家码',
  813. `percent` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单分成',
  814. `credit_code` varchar(30) NOT NULL COMMENT '统一社会信用代码',
  815. `license_image` varchar(122) NOT NULL COMMENT '营业执照',
  816. `username` char(20) NOT NULL COMMENT '法人姓名',
  817. `mobile` char(20) NOT NULL COMMENT '法人手机号',
  818. `idcard` char(20) NOT NULL COMMENT '身份证号',
  819. `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  820. `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  821. `intro` varchar(122) NOT NULL COMMENT '商家简介',
  822. `logo_image` varchar(122) NOT NULL COMMENT 'logo',
  823. `category_ids` varchar(122) NOT NULL COMMENT '经营分类',
  824. `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  825. `leader_name` char(20) NOT NULL COMMENT '负责人姓名',
  826. `leader_mobile` char(20) NOT NULL COMMENT '负责人手机号',
  827. `withdrawtype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '提现方式:0=月,1=周',
  828. `day` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '具体提现日期',
  829. `settle_day` int(5) unsigned NOT NULL DEFAULT '1' COMMENT '订单结算日期',
  830. `trade_hour` varchar(122) DEFAULT NULL COMMENT '营业时间',
  831. `province` varchar(30) NOT NULL COMMENT '省',
  832. `city` varchar(30) NOT NULL COMMENT '市',
  833. `district` varchar(50) DEFAULT NULL COMMENT '县',
  834. `address` varchar(122) NOT NULL COMMENT '详细地址',
  835. `lng` char(20) NOT NULL COMMENT '经度',
  836. `lat` char(20) NOT NULL COMMENT '纬度',
  837. `is_train` tinyint(1) NOT NULL DEFAULT '0' COMMENT '岗前培训:0=未培训,1=已培训',
  838. `rebate_price` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总佣金收入',
  839. `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '服务数量',
  840. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  841. `state` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  842. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  843. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  844. `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  845. PRIMARY KEY (`id`),
  846. KEY `name` (`name`),
  847. KEY `weigh` (`weigh`)
  848. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='商家表';
  849. CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_ensure` (
  850. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  851. `name` char(20) NOT NULL COMMENT '名称',
  852. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金金额',
  853. `accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '日接单数量',
  854. `service_nums` int(10) NOT NULL DEFAULT '0' COMMENT '服务人员数量',
  855. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  856. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  857. PRIMARY KEY (`id`)
  858. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='商家服务金';
  859. CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_ensure_pay` (
  860. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  861. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  862. `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  863. `orderId` varchar(40) DEFAULT NULL COMMENT '订单编号',
  864. `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  865. `paytype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  866. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  867. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  868. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  869. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  870. PRIMARY KEY (`id`),
  871. UNIQUE KEY `user_id` (`user_id`,`createtime`) USING BTREE
  872. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='商家保证金支付表';
  873. CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_money_log` (
  874. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  875. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  876. `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更余额',
  877. `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  878. `memo` varchar(255) NOT NULL COMMENT '备注',
  879. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  880. PRIMARY KEY (`id`)
  881. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='服务者商户余额记录';
  882. CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_user_money_log` (
  883. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  884. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  885. `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更金额 ',
  886. `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  887. `memo` varchar(255) NOT NULL COMMENT '备注',
  888. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  889. PRIMARY KEY (`id`)
  890. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='商户平台余额记录';
  891. CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill` (
  892. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  893. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  894. `shop_id` int(10) DEFAULT NULL COMMENT '商家id',
  895. `code` char(20) DEFAULT NULL COMMENT '服务工号',
  896. `mobile` char(20) NOT NULL COMMENT '手机号',
  897. `ensure_id` int(10) DEFAULT NULL COMMENT '保证金id',
  898. `ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金',
  899. `ensure_name` varchar(30) DEFAULT NULL COMMENT '保证金等级名称',
  900. `accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '每日可接单数量',
  901. `already_accept_nums` int(10) NOT NULL DEFAULT '0' COMMENT '已接取数量',
  902. `credit_score` tinyint(1) unsigned NOT NULL DEFAULT '60' COMMENT '信用分',
  903. `percent` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单分成%',
  904. `name` char(20) NOT NULL COMMENT '姓名',
  905. `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别:1=男,0=女',
  906. `idcard` char(20) NOT NULL COMMENT '身份证号',
  907. `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  908. `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  909. `user_image` varchar(122) NOT NULL COMMENT '实拍照',
  910. `certificate_image` varchar(122) NOT NULL COMMENT '从业资格证',
  911. `health_image` varchar(122) NOT NULL COMMENT '健康证',
  912. `category_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '项目分类id',
  913. `skill_cate_id` int(10) unsigned NOT NULL COMMENT '职业技能分类id',
  914. `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  915. `image` varchar(122) NOT NULL COMMENT '工装照',
  916. `images` varchar(1500) DEFAULT NULL COMMENT '生活照',
  917. `edu` tinyint(1) unsigned NOT NULL COMMENT '学历:0=小学文化,1=初中,2=高中,3=大专,4=本科,5=硕士,6=博士',
  918. `age` tinyint(1) unsigned NOT NULL COMMENT '年龄',
  919. `nation` char(20) NOT NULL COMMENT '民族',
  920. `height` tinyint(1) DEFAULT NULL COMMENT '身高/cm',
  921. `weight` tinyint(1) DEFAULT NULL COMMENT '体重/kg',
  922. `exper` tinyint(1) NOT NULL DEFAULT '0' COMMENT '经验:0=1年以下,1=1-3年,2=3-5年,3=5年以上',
  923. `province` varchar(30) NOT NULL COMMENT '省',
  924. `city` varchar(30) NOT NULL COMMENT '市',
  925. `district` varchar(30) DEFAULT NULL COMMENT '县',
  926. `address` varchar(122) NOT NULL COMMENT '详细地址',
  927. `lng` char(20) NOT NULL COMMENT '经度',
  928. `lat` char(20) NOT NULL COMMENT '纬度',
  929. `is_rest` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工作状态:0=接单中,1=休息中',
  930. `is_train` tinyint(1) NOT NULL DEFAULT '0' COMMENT '岗前培训:0=未培训,1=已培训',
  931. `rebate_price` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总佣金收入',
  932. `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '服务数量',
  933. `state` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  934. `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  935. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  936. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  937. `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  938. PRIMARY KEY (`id`),
  939. KEY `name` (`name`),
  940. KEY `shop_id` (`shop_id`),
  941. KEY `weigh` (`weigh`)
  942. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='服务人员信息表';
  943. CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_cate` (
  944. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  945. `name` varchar(30) NOT NULL COMMENT '分类名称',
  946. `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  947. `createtime` int(16) DEFAULT NULL COMMENT '创建时间',
  948. `updatetime` int(16) DEFAULT NULL COMMENT '更新时间',
  949. PRIMARY KEY (`id`)
  950. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='技师分类表';
  951. CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_ensure` (
  952. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  953. `name` char(20) NOT NULL COMMENT '名称',
  954. `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金金额',
  955. `accept_nums` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '日接单数量',
  956. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  957. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  958. PRIMARY KEY (`id`)
  959. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='商户保证金';
  960. CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_ensure_pay` (
  961. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  962. `user_id` int(10) unsigned NOT NULL COMMENT '服务者用户id',
  963. `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  964. `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  965. `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  966. `paytype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  967. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  968. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  969. `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  970. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  971. PRIMARY KEY (`id`),
  972. UNIQUE KEY `user_id` (`user_id`,`createtime`) USING BTREE
  973. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务者保证金支付';
  974. CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_time` (
  975. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  976. `skill_id` int(10) unsigned NOT NULL COMMENT '服务人员id',
  977. `buy_id` int(10) DEFAULT NULL COMMENT '下单用户id',
  978. `timetype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '时间类型:0=今天,1=明天,2=后天',
  979. `number` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '时间序号',
  980. `starttime` bigint(16) NOT NULL COMMENT '创建时间',
  981. `endtime` bigint(16) NOT NULL COMMENT '更新时间',
  982. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=空闲,1=已预约,2=不可预约 ',
  983. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  984. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  985. `changetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  986. PRIMARY KEY (`id`),
  987. KEY `skill_id` (`skill_id`)
  988. ) ENGINE=InnoDB AUTO_INCREMENT=577 DEFAULT CHARSET=utf8mb4 COMMENT='技师时间表';
  989. CREATE TABLE IF NOT EXISTS `__PREFIX__service_thumb` (
  990. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  991. `image` varchar(122) NOT NULL COMMENT '图片',
  992. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '跳转类型:0=不跳转,1=项目详情,2=文本协议,3=其他路由',
  993. `goods_id` int(10) DEFAULT NULL COMMENT '项目id',
  994. `config_text_id` int(10) DEFAULT NULL COMMENT '文本协议id',
  995. `jump_id` int(10) DEFAULT NULL COMMENT '路由链接',
  996. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  997. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  998. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  999. PRIMARY KEY (`id`)
  1000. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='轮播图表';
  1001. CREATE TABLE IF NOT EXISTS `__PREFIX__service_total_data` (
  1002. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  1003. `total_order_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总订单',
  1004. `total_user_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总用户',
  1005. `total_plus_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总会员',
  1006. `total_skill_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总服务人员',
  1007. `total_shop_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总商户',
  1008. `total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总金额',
  1009. `rebate_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总佣金',
  1010. `recharge_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总充值',
  1011. `withdraw_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '提现总额',
  1012. `skill_ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '服务人员保证金',
  1013. `shop_ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商户保证金',
  1014. `day_order_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '日服务订单数量',
  1015. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  1016. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  1017. PRIMARY KEY (`id`)
  1018. ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COMMENT='数据统计表';
  1019. CREATE TABLE IF NOT EXISTS `__PREFIX__service_train` (
  1020. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  1021. `title` varchar(60) NOT NULL COMMENT '标题',
  1022. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=服务端,1=商户端',
  1023. `image` varchar(122) NOT NULL COMMENT '封面图',
  1024. `videofile` varchar(122) NOT NULL COMMENT '视频',
  1025. `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  1026. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  1027. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  1028. PRIMARY KEY (`id`)
  1029. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='培训表';
  1030. CREATE TABLE IF NOT EXISTS `__PREFIX__service_user_coupon` (
  1031. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  1032. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  1033. `coupon_id` int(10) unsigned NOT NULL COMMENT '优惠券id',
  1034. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '优惠券类型:0=平台通用券,1=平台项目券,2=商户通用券,3=商户项目券,4=口令券',
  1035. `goods_id` int(10) DEFAULT NULL COMMENT '项目id',
  1036. `shop_id` int(10) DEFAULT NULL COMMENT '商户id',
  1037. `code` char(20) DEFAULT NULL COMMENT '口令',
  1038. `achieve` int(10) unsigned NOT NULL COMMENT '满',
  1039. `reduce` int(10) unsigned NOT NULL COMMENT '减',
  1040. `exittime` bigint(16) unsigned NOT NULL COMMENT '截止时间',
  1041. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待使用,1=已使用,-1=已过期 ',
  1042. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  1043. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  1044. PRIMARY KEY (`id`)
  1045. ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COMMENT='用户优惠券表';
  1046. CREATE TABLE IF NOT EXISTS `__PREFIX__service_user_info` (
  1047. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  1048. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  1049. `mobile` char(20) NOT NULL COMMENT '手机号',
  1050. `is_skill` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否服务人员:0=否,1=是',
  1051. `is_shop` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否商家:0=否,1=是',
  1052. `leader_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级用户id',
  1053. `rec_leader_id` int(10) DEFAULT '0' COMMENT '上上级用户id',
  1054. `total_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '消费总额',
  1055. `unionid` varchar(40) DEFAULT NULL COMMENT '联合id',
  1056. `user_openid` varchar(40) DEFAULT NULL COMMENT '用户openid',
  1057. `skill_openid` varchar(40) DEFAULT NULL COMMENT '服务openid',
  1058. `shop_openid` varchar(40) DEFAULT NULL COMMENT '商家openid',
  1059. `alipay_name` char(20) DEFAULT NULL COMMENT '支付宝姓名',
  1060. `alipay_account` varchar(30) DEFAULT NULL COMMENT '支付宝账号',
  1061. `bank_name` varchar(122) DEFAULT NULL COMMENT '开户行',
  1062. `bank_user` char(20) DEFAULT NULL COMMENT '开户人',
  1063. `bank_card` char(20) DEFAULT NULL COMMENT '银行卡号',
  1064. `money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '服务者平台可提现余额',
  1065. `shop_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商户可提现余额',
  1066. `shop_user_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商户平台可提现余额',
  1067. `rebate_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '佣金',
  1068. `is_plus` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '会员:0=否,1=是',
  1069. `is_update` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否更新:0=否,1=是',
  1070. `discount` tinyint(1) unsigned NOT NULL DEFAULT '100' COMMENT '享受折扣%',
  1071. `plusname` varchar(30) DEFAULT NULL COMMENT '会员名称',
  1072. `plustime` bigint(16) DEFAULT NULL COMMENT '会员有效期',
  1073. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  1074. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  1075. PRIMARY KEY (`id`),
  1076. KEY `user_id` (`user_id`),
  1077. KEY `mobile` (`mobile`),
  1078. KEY `is_skill` (`is_skill`),
  1079. KEY `is_shop` (`is_shop`)
  1080. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='用户信息表';
  1081. CREATE TABLE IF NOT EXISTS `__PREFIX__service_user_money_log` (
  1082. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  1083. `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  1084. `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更金额',
  1085. `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  1086. `memo` varchar(255) NOT NULL COMMENT '备注',
  1087. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  1088. PRIMARY KEY (`id`)
  1089. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务者平台余额明细表';
  1090. CREATE TABLE IF NOT EXISTS `__PREFIX__service_withdraw` (
  1091. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  1092. `user_id` int(10) unsigned NOT NULL COMMENT '提现用户id',
  1093. `type` tinyint(1) unsigned DEFAULT '0' COMMENT '金额来源:0=服务者平台余额提现,1=服务者商户余额提现,2=商户平台余额提现,3=服务者保证金提现,4=商户保证金提现',
  1094. `shop_id` int(10) DEFAULT NULL COMMENT '商户id',
  1095. `withdrawtype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '提现方式:0=支付宝,1=银行卡',
  1096. `withdraw_info` varchar(255) NOT NULL COMMENT '提现信息',
  1097. `num` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '提现金额',
  1098. `images` varchar(1000) DEFAULT NULL COMMENT '转账证明',
  1099. `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '提现状态:-1=已拒绝,0=待审核,1=已审核,2=已转账',
  1100. `note` varchar(100) DEFAULT NULL COMMENT '拒绝原因',
  1101. `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  1102. `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  1103. PRIMARY KEY (`id`),
  1104. UNIQUE KEY `user_id` (`user_id`,`createtime`),
  1105. KEY `shop_id` (`shop_id`),
  1106. KEY `user_index` (`user_id`)
  1107. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='提现';
  1108. --
  1109. -- 1.0.1
  1110. -- 添加名称字段name
  1111. --
  1112. ALTER TABLE `__PREFIX__service_recharge` ADD COLUMN `gift_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '赠送金额' AFTER `price`;
  1113. ALTER TABLE `__PREFIX__service_recharge` ADD COLUMN `recharge_package_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT '充值套餐id' AFTER `user_id`;
  1114. --
  1115. -- 1.1.0
  1116. -- 添加名称字段name
  1117. --
  1118. ALTER TABLE `__PREFIX__service_order`
  1119. ADD COLUMN leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级用户id',
  1120. ADD COLUMN rec_leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上上级用户id'
  1121. ADD COLUMN ordertype TINYINT(1) NOT NULL DEFAULT 0 COMMENT '订单类型:0=普通订单,1=套餐订单',
  1122. ADD COLUMN package_order_id INT(10) DEFAULT NULL COMMENT '套餐卡订单id';
  1123. ALTER TABLE `__PREFIX__service_user_info`
  1124. ADD COLUMN leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级用户id',
  1125. ADD COLUMN rec_leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上上级用户id';
  1126. ALTER TABLE `__PREFIX__service_goods_sku`
  1127. ADD COLUMN type TINYINT(1) NOT NULL DEFAULT 0 COMMENT '项目类型:0=普通项目,1=可入套餐项目';
  1128. --
  1129. -- 1.1.1
  1130. -- 添加名称字段name
  1131. --
  1132. ALTER TABLE `__PREFIX__service_order`
  1133. ADD COLUMN skill_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '服务者佣金',
  1134. ADD COLUMN shop_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '门店佣金',
  1135. ADD COLUMN platform_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '平台收益',
  1136. ADD COLUMN leader_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '直推分佣',
  1137. ADD COLUMN rec_leader_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '间推分佣',
  1138. ADD COLUMN dis_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '分销金额';
  1139. ALTER TABLE `__PREFIX__service_user_info`
  1140. ADD COLUMN total_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费总额';
  1141. ADD COLUMN rebate_money decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '佣金';
  1142. ALTER TABLE `__PREFIX__service_goods`
  1143. ADD COLUMN `cost_seconds` int(10) unsigned NOT NULL COMMENT '时长/分钟';