---
title: 数据字典
description: 文本抽取：知识库/02-商城交易私域场景/ECshopex开源资料/数据字典
updated: 2026-11-04
tags: [原始文档, 抽取, 知识库]
source: 知识库/02-商城交易私域场景/ECshopex开源资料/数据字典
source_type: txt
source_hash: 9b152bf8b74a
extracted_at: 2026-11-04
quality: ok
---

---
source: 知识库/02-商城交易私域场景/ECshopex开源资料/数据字典.md
type: md
size_kb: 611
category: 02-商城交易私域场景
quality: ok
---

 # 数据辞典

数据库表数量: 431个

- [Hfpay\_withdraw\_set(提现设置表)](#table-Hfpay_withdraw_set)
- [activate\_log(激活表)](#table-activate_log)
- [adapay\_alipay\_industry\_category(支付宝行业分类)](#table-adapay_alipay_industry_category)
- [adapay\_bank\_codes(银行代码)](#table-adapay_bank_codes)
- [adapay\_corp\_member(企业用户对象)](#table-adapay_corp_member)
- [adapay\_div\_fee(分账金额表)](#table-adapay_div_fee)
- [adapay\_draw\_cash(adapay提现表)](#table-adapay_draw_cash)
- [adapay\_entry\_apply(开户申请表)](#table-adapay_entry_apply)
- [adapay\_member(实名用户对象)](#table-adapay_member)
- [adapay\_member\_update\_log(adapay子账户修改log(审核成功后修改))](#table-adapay_member_update_log)
- [adapay\_merchant\_entry(adapay开户进件)](#table-adapay_merchant_entry)
- [adapay\_merchant\_resident(adapay商户入驻)](#table-adapay_merchant_resident)
- [adapay\_operation\_log(adapay操作日志表)](#table-adapay_operation_log)
- [adapay\_paymemt\_confirm(adapay支付确认表)](#table-adapay_paymemt_confirm)
- [adapay\_payment\_reverse(adapay支付撤销表)](#table-adapay_payment_reverse)
- [adapay\_regions(省市编码(四位码))](#table-adapay_regions)
- [adapay\_regions\_third(省市区编码(六位码或九位码))](#table-adapay_regions_third)
- [adapay\_settle\_account(结算账户)](#table-adapay_settle_account)
- [adapay\_sms\_log(adapay短信提醒日志表)](#table-adapay_sms_log)
- [adapay\_submit\_license(adapay提交商户证照)](#table-adapay_submit_license)
- [adapay\_upload\_license(adapay上传商户证照)](#table-adapay_upload_license)
- [adapay\_withdraw\_set(提现设置表)](#table-adapay_withdraw_set)
- [adapay\_wx\_business\_category(微信经营类目)](#table-adapay_wx_business_category)
- [aftersales(售后主表)](#table-aftersales)
- [aftersales\_detail(售后明细子表)](#table-aftersales_detail)
- [aftersales\_offline\_refund(线下转账退款)](#table-aftersales_offline_refund)
- [aftersales\_refund(退款表)](#table-aftersales_refund)
- [ali\_mini\_app\_setting(支付宝小程序配置表)](#table-ali_mini_app_setting)
- [aliyunsms\_accesskey(AccessKey表)](#table-aliyunsms_accesskey)
- [aliyunsms\_record(短信发送记录)](#table-aliyunsms_record)
- [aliyunsms\_scene(场景表)](#table-aliyunsms_scene)
- [aliyunsms\_scene\_item(场景实例表)](#table-aliyunsms_scene_item)
- [aliyunsms\_sign(短信签名表)](#table-aliyunsms_sign)
- [aliyunsms\_task(短信群发任务)](#table-aliyunsms_task)
- [aliyunsms\_template(模板表)](#table-aliyunsms_template)
- [bspay\_div\_fee(分账金额表)](#table-bspay_div_fee)
- [bspay\_entry\_apply(开户申请表)](#table-bspay_entry_apply)
- [bspay\_paymemt\_confirm(斗拱支付确认表)](#table-bspay_paymemt_confirm)
- [bspay\_regions\_third(省市区编码(六位码或九位码))](#table-bspay_regions_third)
- [bspay\_user\_card(用户结算账户)](#table-bspay_user_card)
- [bspay\_user\_ent(企业用户对象)](#table-bspay_user_ent)
- [bspay\_user\_indv(个人用户)](#table-bspay_user_indv)
- [bspay\_user\_update\_log(用户进件修改log(审核成功后修改))](#table-bspay_user_update_log)
- [business\_rep\_user(业务员关联会员)](#table-business_rep_user)
- [business\_representative(业务员)](#table-business_representative)
- [card\_package(卡券包)](#table-card_package)
- [card\_package\_items(卡券包关联表)](#table-card_package_items)
- [card\_package\_receive(卡券包领取记录表)](#table-card_package_receive)
- [card\_package\_receive\_details(卡券包领取记录详情表)](#table-card_package_receive_details)
- [card\_package\_receive\_record(等级卡券包领取记录表)](#table-card_package_receive_record)
- [card\_package\_trigger(卡券包触发关联表)](#table-card_package_trigger)
- [chinaumspay\_division(银联商务支付分账流水)](#table-chinaumspay_division)
- [chinaumspay\_division\_detail(银联商务支付分账流水明细)](#table-chinaumspay_division_detail)
- [chinaumspay\_division\_error\_log(银联商务支付分账错误日志)](#table-chinaumspay_division_error_log)
- [chinaumspay\_division\_upload\_detail(银联商务支付sftp上传明细)](#table-chinaumspay_division_upload_detail)
- [chinaumspay\_division\_upload\_log(银联商务支付上传文件日志)](#table-chinaumspay_division_upload_log)
- [community\_activity(社区拼团活动表)](#table-community_activity)
- [community\_activity\_item(社区拼团活动商品表)](#table-community_activity_item)
- [community\_activity\_ziti(社区拼团活动自提表)](#table-community_activity_ziti)
- [community\_cart(社区团购购物车)](#table-community_cart)
- [community\_chief(社区拼团团长表)](#table-community_chief)
- [community\_chief\_apply\_info(社区拼团团长申请表)](#table-community_chief_apply_info)
- [community\_chief\_cash\_withdrawal(团长提现表)](#table-community_chief_cash_withdrawal)
- [community\_chief\_distributor(社区拼团团长关联店铺表)](#table-community_chief_distributor)
- [community\_chief\_ziti(社区拼团团长自提点管理表)](#table-community_chief_ziti)
- [community\_items(社区拼团商品池)](#table-community_items)
- [community\_order\_rel\_activity(社区团购购物车)](#table-community_order_rel_activity)
- [company\_rel\_dada(商城关联达达同城配表)](#table-company_rel_dada)
- [company\_rel\_delivery(商城关联配送配置表)](#table-company_rel_delivery)
- [company\_rel\_kuaizhen(商城关联580快诊配置)](#table-company_rel_kuaizhen)
- [company\_rel\_logistics(商城物流启用表)](#table-company_rel_logistics)
- [company\_rel\_shansong(商城关联闪送应用配置信息表)](#table-company_rel_shansong)
- [companys(公司表)](#table-companys)
- [companys\_article(文章表)](#table-companys_article)
- [companys\_article\_category(文章类目表)](#table-companys_article_category)
- [companys\_currency\_exchange\_rate(货币汇率)](#table-companys_currency_exchange_rate)
- [companys\_employee\_rel\_roles(员工绑定角色表)](#table-companys_employee_rel_roles)
- [companys\_operator\_cart(导购员购物车)](#table-companys_operator_cart)
- [companys\_operator\_logs(商家操作日志表)](#table-companys_operator_logs)
- [companys\_operator\_pending\_order(导购挂单)](#table-companys_operator_pending_order)
- [companys\_profit(分润记录表)](#table-companys_profit)
- [companys\_profit\_log(分润记录表)](#table-companys_profit_log)
- [companys\_profit\_statistics(分润记录表)](#table-companys_profit_statistics)
- [companys\_protocol\_update\_log(协议更新日志表)](#table-companys_protocol_update_log)
- [companys\_regionauth(地区权限)](#table-companys_regionauth)
- [companys\_roles(员工角色表)](#table-companys_roles)
- [companys\_saleman\_customer\_complaints(导购客诉表)](#table-companys_saleman_customer_complaints)
- [companys\_saleperson\_cart(导购员购物车)](#table-companys_saleperson_cart)
- [companys\_sales\_promotions(导购促销单)](#table-companys_sales_promotions)
- [companys\_salesperson\_statistics(导购员销售额数据统计表)](#table-companys_salesperson_statistics)
- [companys\_setting(企业设置表)](#table-companys_setting)
- [companys\_statistics(商城数据统计表)](#table-companys_statistics)
- [companys\_store\_statistics(商城数据统计表)](#table-companys_store_statistics)
- [config\_request\_fields(配置信息, 配置传递的请求字段)](#table-config_request_fields)
- [coupon\_give\_error\_log(优惠券赠送失败记录表)](#table-coupon_give_error_log)
- [coupon\_give\_log(优惠券赠送表)](#table-coupon_give_log)
- [crossborder\_identity(跨境-身份证信息)](#table-crossborder_identity)
- [crossborder\_origincountry(跨境-产地国表)](#table-crossborder_origincountry)
- [crossborder\_set(跨境-设置)](#table-crossborder_set)
- [crossborder\_taxstrategy(跨境-税费策略)](#table-crossborder_taxstrategy)
- [custom\_declare\_order\_result(订单附加信息提交信息接口请求结果表)](#table-custom_declare_order_result)
- [customs\_data(接收海关支付数据请求表)](#table-customs_data)
- [datacube\_company\_data(商城数据统计表)](#table-datacube_company_data)
- [datacube\_distributor\_data(商城门店数据统计表)](#table-datacube_distributor_data)
- [datacube\_goods\_data(商品数据统计表)](#table-datacube_goods_data)
- [datacube\_merchant\_data(商户数据统计表)](#table-datacube_merchant_data)
- [datacube\_monitors(小程序页面监控)](#table-datacube_monitors)
- [datacube\_relsources(小程序页面与来源关联表)](#table-datacube_relsources)
- [datacube\_statistics(小程序页面与来源关联表)](#table-datacube_statistics)
- [deposit\_recharge\_agreement(充值协议表)](#table-deposit_recharge_agreement)
- [deposit\_recharge\_rule(储值规则，充值固定金额送钱或送礼品)](#table-deposit_recharge_rule)
- [deposit\_trade(预存款交易记录表)](#table-deposit_trade)
- [distribution\_basic\_config(分销商基础配置)](#table-distribution_basic_config)
- [distribution\_cash\_withdrawal(分销商佣金提现记录表)](#table-distribution_cash_withdrawal)
- [distribution\_distribute\_logs(分销商佣金记录表)](#table-distribution_distribute_logs)
- [distribution\_distributor(店铺表)](#table-distribution_distributor)
- [distribution\_distributor\_geofence(店铺围栏信息)](#table-distribution_distributor_geofence)
- [distribution\_distributor\_items(店铺导购员表)](#table-distribution_distributor_items)
- [distribution\_distributor\_sales\_count(店铺销量表)](#table-distribution_distributor_sales_count)
- [distribution\_distributor\_salesman(店铺导购员表)](#table-distribution_distributor_salesman)
- [distribution\_distributor\_salesman\_role(店铺权限表)](#table-distribution_distributor_salesman_role)
- [distribution\_distributor\_user(会员对应的导购员信息表)](#table-distribution_distributor_user)
- [distribution\_distributor\_white\_list(店铺表)](#table-distribution_distributor_white_list)
- [distribution\_pickup\_location(店铺自提点)](#table-distribution_pickup_location)
- [distribution\_shopScreen\_advertisement(广告表)](#table-distribution_shopScreen_advertisement)
- [distribution\_shopScreen\_slider()](#table-distribution_shopScreen_slider)
- [distributor\_aftersales\_address(店铺售后地址)](#table-distributor_aftersales_address)
- [distributor\_rel\_tags(店铺关联标签表)](#table-distributor_rel_tags)
- [distributor\_tags(店铺标签库表)](#table-distributor_tags)
- [distributor\_wechat\_rel(店务端微信关联表)](#table-distributor_wechat_rel)
- [distributor\_work\_wechat\_rel(店务端企业微信关联表)](#table-distributor_work_wechat_rel)
- [employee\_purchase\_activities(员工内购活动表)](#table-employee_purchase_activities)
- [employee\_purchase\_activity\_enterprises(活动参与企业表)](#table-employee_purchase_activity_enterprises)
- [employee\_purchase\_activity\_goods(员工内购商品表)](#table-employee_purchase_activity_goods)
- [employee\_purchase\_activity\_items(员工内购商品表)](#table-employee_purchase_activity_items)
- [employee\_purchase\_cart(员工内购活动购物车)](#table-employee_purchase_cart)
- [employee\_purchase\_employees(企业员工表)](#table-employee_purchase_employees)
- [employee\_purchase\_enterprise\_email\_box(企业发件邮箱)](#table-employee_purchase_enterprise_email_box)
- [employee\_purchase\_enterprises(企业表)](#table-employee_purchase_enterprises)
- [employee\_purchase\_member\_activity\_aggregate(内购活动会员累计使用额度)](#table-employee_purchase_member_activity_aggregate)
- [employee\_purchase\_member\_activity\_items\_aggregate(内购活动商品会员累计使用额度)](#table-employee_purchase_member_activity_items_aggregate)
- [employee\_purchase\_orders\_rel\_activity(内购订单关联活动企业表)](#table-employee_purchase_orders_rel_activity)
- [employee\_purchase\_relatives(企业员工家属表)](#table-employee_purchase_relatives)
- [espier\_address(地区表)](#table-espier_address)
- [espier\_export\_log(导出日志表)](#table-espier_export_log)
- [espier\_printer(打印机表)](#table-espier_printer)
- [espier\_subdistrict(街道社区表)](#table-espier_subdistrict)
- [espier\_uploadefile(上传文件日志ID)](#table-espier_uploadefile)
- [espier\_uploadimages(图片上传表)](#table-espier_uploadimages)
- [espier\_uploadimages\_cat(图片分类表)](#table-espier_uploadimages_cat)
- [goods\_items\_rel\_cats(商品和分类关联表)](#table-goods_items_rel_cats)
- [hfpay\_bank\_card(汇付取现银行卡表)](#table-hfpay_bank_card)
- [hfpay\_cash\_record(汇付取现记录表)](#table-hfpay_cash_record)
- [hfpay\_company\_statistics\_day(平台分账数据统计)](#table-hfpay_company_statistics_day)
- [hfpay\_distributor\_statistics\_day(店铺分账数据统计)](#table-hfpay_distributor_statistics_day)
- [hfpay\_distributor\_transaction\_statistics(店铺交易统计统计)](#table-hfpay_distributor_transaction_statistics)
- [hfpay\_enterapply(入驻信息表)](#table-hfpay_enterapply)
- [hfpay\_ledger\_config(分账配置表)](#table-hfpay_ledger_config)
- [hfpay\_merchant\_payment(汇付平台转账记录表)](#table-hfpay_merchant_payment)
- [hfpay\_trade\_record(汇付记账表)](#table-hfpay_trade_record)
- [icbc\_pay\_log(工商银行接口日志)](#table-icbc_pay_log)
- [item\_keywords(商品热门关键词表)](#table-item_keywords)
- [items(商品表)](#table-items)
- [items\_attribute\_values(商品属性值表)](#table-items_attribute_values)
- [items\_attributes(商品属性表)](#table-items_attributes)
- [items\_barcode(商品条形码表)](#table-items_barcode)
- [items\_category(商品分类表)](#table-items_category)
- [items\_category\_profit(商品分润配置表)](#table-items_category_profit)
- [items\_commission(商品佣金配置表)](#table-items_commission)
- [items\_medicine(商品药品数据表)](#table-items_medicine)
- [items\_profit(商品分润配置表)](#table-items_profit)
- [items\_recommend(商品推荐表)](#table-items_recommend)
- [items\_rel\_attributes(商品关联属性表)](#table-items_rel_attributes)
- [items\_rel\_point\_access(商品和积分获取设置关联表)](#table-items_rel_point_access)
- [items\_rel\_tags(商品关联标签表)](#table-items_rel_tags)
- [items\_rel\_type(商品数值属性关联表)](#table-items_rel_type)
- [items\_tags(商品标签库表)](#table-items_tags)
- [kaquan\_card\_related(卡券库存统计表)](#table-kaquan_card_related)
- [kaquan\_discount\_cards(优惠券信息表)](#table-kaquan_discount_cards)
- [kaquan\_rel\_items(卡券关联商品表)](#table-kaquan_rel_items)
- [kaquan\_rel\_member\_tags(卡券关联用户标签表)](#table-kaquan_rel_member_tags)
- [kaquan\_salesperson\_give\_coupons(导购员发放给用户优惠券记录)](#table-kaquan_salesperson_give_coupons)
- [kaquan\_user\_discount(用户领取的优惠券表)](#table-kaquan_user_discount)
- [kaquan\_user\_discount\_logs(优惠券核销记录表)](#table-kaquan_user_discount_logs)
- [kaquan\_vip\_grade(付费会员等级库表)](#table-kaquan_vip_grade)
- [kaquan\_vip\_grade\_order(付费会员等级卡)](#table-kaquan_vip_grade_order)
- [kaquan\_vip\_rel\_user(付费会员的等级卡表)](#table-kaquan_vip_rel_user)
- [kaquan\_wechat\_card(关联微信卡券)](#table-kaquan_wechat_card)
- [logistics(物流公司表)](#table-logistics)
- [lucky\_draw\_activity(抽奖表)](#table-lucky_draw_activity)
- [map\_config(地图配置表)](#table-map_config)
- [map\_config\_service(地图配置表)](#table-map_config_service)
- [medication\_personnel(用药人信息)](#table-medication_personnel)
- [member\_group(分组表)](#table-member_group)
- [member\_outfit()](#table-member_outfit)
- [member\_outfit\_log()](#table-member_outfit_log)
- [member\_rel\_group(会员分组表)](#table-member_rel_group)
- [member\_remarks(会员备注表)](#table-member_remarks)
- [membercard(会员卡)](#table-membercard)
- [membercard\_grade(会员卡等级表)](#table-membercard_grade)
- [members(会员主表，其他平台的会员本地化表)](#table-members)
- [members\_address(会员收货地址表)](#table-members_address)
- [members\_article\_fav(会员心愿单收藏)](#table-members_article_fav)
- [members\_associations(不同平台会员关联表，关联到members表)](#table-members_associations)
- [members\_browse\_history(会员浏览足迹)](#table-members_browse_history)
- [members\_delete\_record(会员删除记录)](#table-members_delete_record)
- [members\_distribution\_fav(会员店铺收藏)](#table-members_distribution_fav)
- [members\_info(会员详情信息表)](#table-members_info)
- [members\_invoices(会员发票信息表)](#table-members_invoices)
- [members\_items\_fav(会员收藏商品表)](#table-members_items_fav)
- [members\_msmsend\_log(群发短信log)](#table-members_msmsend_log)
- [members\_offine\_log(会员线下实体卡日志)](#table-members_offine_log)
- [members\_operate\_log(管理员修改员工操作日志表)](#table-members_operate_log)
- [members\_protocol\_log(会员隐私协议记录表)](#table-members_protocol_log)
- [members\_rel\_shop(店铺管理会员表)](#table-members_rel_shop)
- [members\_rel\_tags(会员关联标签表)](#table-members_rel_tags)
- [members\_subscribe\_notice(订阅通知)](#table-members_subscribe_notice)
- [members\_tags(会员标签库表)](#table-members_tags)
- [members\_tags\_category(标签分类)](#table-members_tags_category)
- [members\_wechat\_fans(微信粉丝表)](#table-members_wechat_fans)
- [members\_wechatusers(微信会员表)](#table-members_wechatusers)
- [members\_whitelist(会员白名单)](#table-members_whitelist)
- [merchant(商户表)](#table-merchant)
- [merchant\_settlement\_apply(商户入驻申请表)](#table-merchant_settlement_apply)
- [merchant\_type(商户类型表)](#table-merchant_type)
- [offline\_bank\_account(线下转账收款账户)](#table-offline_bank_account)
- [offline\_payment(线下转账支付订单)](#table-offline_payment)
- [onecode\_batchs(物品批次表)](#table-onecode_batchs)
- [onecode\_things(物品表，一物一码的物)](#table-onecode_things)
- [openapi\_developer(openapi开发配置表)](#table-openapi_developer)
- [operator\_bind\_shop(员工关联门店表)](#table-operator_bind_shop)
- [operator\_data\_pass(数据敏感信息申请)](#table-operator_data_pass)
- [operator\_data\_pass\_log(数据敏感信息查看)](#table-operator_data_pass_log)
- [operator\_license(商户许可协议表)](#table-operator_license)
- [operators(账号表)](#table-operators)
- [order\_epidemic\_register(订单疫情登记表)](#table-order_epidemic_register)
- [order\_profit\_sharing(订单资金分账)](#table-order_profit_sharing)
- [order\_profit\_sharing\_details(订单资金分账详情)](#table-order_profit_sharing_details)
- [orders\_associations(订单主关联表)](#table-orders_associations)
- [orders\_bargain(砍价订单表)](#table-orders_bargain)
- [orders\_cancel\_orders(已付钱订单取消退款记录表)](#table-orders_cancel_orders)
- [orders\_cart(购物车)](#table-orders_cart)
- [orders\_delivery(订单发货单表)](#table-orders_delivery)
- [orders\_delivery\_items(订单发货单商品表)](#table-orders_delivery_items)
- [orders\_diagnosis(问诊单)](#table-orders_diagnosis)
- [orders\_invoice(订单发票表)](#table-orders_invoice)
- [orders\_invoice\_item(订单发票商品表)](#table-orders_invoice_item)
- [orders\_invoice\_log(订单发票日志表)](#table-orders_invoice_log)
- [orders\_invoices(发票表)](#table-orders_invoices)
- [orders\_items\_rel\_profit(订单商品分润表)](#table-orders_items_rel_profit)
- [orders\_merchant\_trade(企业付款账单)](#table-orders_merchant_trade)
- [orders\_normal\_orders(实体订单表)](#table-orders_normal_orders)
- [orders\_normal\_orders\_items(实体订单明细表)](#table-orders_normal_orders_items)
- [orders\_operate\_logs(订单操作日志表)](#table-orders_operate_logs)
- [orders\_prescription(问诊单开方数据)](#table-orders_prescription)
- [orders\_process\_log(订单流程记录表)](#table-orders_process_log)
- [orders\_rel\_chinaumspay\_division(订单关联银联商务分账表)](#table-orders_rel_chinaumspay_division)
- [orders\_rel\_dada(实体订单关联达达同城配表)](#table-orders_rel_dada)
- [orders\_rel\_jushuitan(订单关联聚水潭表)](#table-orders_rel_jushuitan)
- [orders\_rel\_profit(订单分润表)](#table-orders_rel_profit)
- [orders\_rel\_promotions(商品促销和订单关联表)](#table-orders_rel_promotions)
- [orders\_rel\_supplier(实体订单关联供应商)](#table-orders_rel_supplier)
- [orders\_rel\_ziti(实体订单关联自提信息)](#table-orders_rel_ziti)
- [orders\_rights(权益表)](#table-orders_rights)
- [orders\_rights\_detail(权益详细ID)](#table-orders_rights_detail)
- [orders\_rights\_log(权益日志表)](#table-orders_rights_log)
- [orders\_rights\_operate\_logs(权益操作日志表)](#table-orders_rights_operate_logs)
- [orders\_rights\_transfer\_logs(权益转赠表)](#table-orders_rights_transfer_logs)
- [orders\_user\_invoice(订单发票)](#table-orders_user_invoice)
- [pages\_open\_screen\_ad(开屏广告设置)](#table-pages_open_screen_ad)
- [pages\_template(页面模板表)](#table-pages_template)
- [pages\_template\_set(模板设置表)](#table-pages_template_set)
- [point\_member(用户积分表)](#table-point_member)
- [point\_member\_log(用户积分记录表)](#table-point_member_log)
- [pointsmall\_items(积分商品表)](#table-pointsmall_items)
- [pointsmall\_items\_rel\_attributes(积分商品关联属性表)](#table-pointsmall_items_rel_attributes)
- [pointsmall\_items\_rel\_cats(积分商品和分类关联表)](#table-pointsmall_items_rel_cats)
- [popularize\_brokerage(分销佣金表)](#table-popularize_brokerage)
- [popularize\_brokerage\_statistics(分销佣金统计)](#table-popularize_brokerage_statistics)
- [popularize\_cash\_withdrawal(推广员提现表)](#table-popularize_cash_withdrawal)
- [popularize\_promoter(推广员表)](#table-popularize_promoter)
- [popularize\_promoter\_goods(推广员商品表)](#table-popularize_promoter_goods)
- [popularize\_promoter\_identity(推广员身份表)](#table-popularize_promoter_identity)
- [popularize\_task\_brokerage(任务制返佣)](#table-popularize_task_brokerage)
- [popularize\_task\_brokerage\_count(任务制返佣)](#table-popularize_task_brokerage_count)
- [promotion\_check\_in(签到日志)](#table-promotion_check_in)
- [promotion\_groups\_activity(拼团活动表)](#table-promotion_groups_activity)
- [promotion\_groups\_team(开团表)](#table-promotion_groups_team)
- [promotion\_groups\_team\_member(参团表)](#table-promotion_groups_team_member)
- [promotion\_user\_task(签到日志)](#table-promotion_user_task)
- [promotions\_active\_articles(活动文章表)](#table-promotions_active_articles)
- [promotions\_activity(自动化营销活动表)](#table-promotions_activity)
- [promotions\_bargain(砍价活动表)](#table-promotions_bargain)
- [promotions\_bargain\_log(砍价日志表)](#table-promotions_bargain_log)
- [promotions\_distributor(分销商营销)](#table-promotions_distributor)
- [promotions\_extrapoint\_activity(积分营销活动表)](#table-promotions_extrapoint_activity)
- [promotions\_items\_tag(商品的促销标签表)](#table-promotions_items_tag)
- [promotions\_limit(限购活动规则表)](#table-promotions_limit)
- [promotions\_limit\_category(限购活动分类表)](#table-promotions_limit_category)
- [promotions\_limit\_item(限购活动商品表)](#table-promotions_limit_item)
- [promotions\_limit\_person(限购活动用户表)](#table-promotions_limit_person)
- [promotions\_marketing\_activity(各种促销活动表)](#table-promotions_marketing_activity)
- [promotions\_marketing\_activity\_category(各种促销活动分类表)](#table-promotions_marketing_activity_category)
- [promotions\_marketing\_activity\_items(各种促销活动商品表)](#table-promotions_marketing_activity_items)
- [promotions\_marketing\_gift\_items(活动赠品列表)](#table-promotions_marketing_gift_items)
- [promotions\_member\_price(商品会员价表)](#table-promotions_member_price)
- [promotions\_notice\_template(小程序通知消息模版)](#table-promotions_notice_template)
- [promotions\_package(组合促销促销规则表)](#table-promotions_package)
- [promotions\_package\_item(组合促销商品表)](#table-promotions_package_item)
- [promotions\_package\_main\_item(组合促销主商品表)](#table-promotions_package_main_item)
- [promotions\_point\_upvaluation(积分升值活动表)](#table-promotions_point_upvaluation)
- [promotions\_recommend\_like\_items(推荐喜欢商品(猜你喜欢))](#table-promotions_recommend_like_items)
- [promotions\_scd\_rel\_user(定向促销会员日志)](#table-promotions_scd_rel_user)
- [promotions\_seckill\_activity(秒杀活动表)](#table-promotions_seckill_activity)
- [promotions\_seckill\_rel\_goods(秒杀关联商品表)](#table-promotions_seckill_rel_goods)
- [promotions\_specific\_crowd\_discount(特定人群促销)](#table-promotions_specific_crowd_discount)
- [promotions\_turntable\_log(用户大转盘中奖纪录表)](#table-promotions_turntable_log)
- [promotions\_user\_bargains(用户砍价表)](#table-promotions_user_bargains)
- [refund\_error\_logs(退款错误日志)](#table-refund_error_logs)
- [register\_promotions(注册营销表)](#table-register_promotions)
- [reservation\_default\_work\_shift(商户配置默认排班)](#table-reservation_default_work_shift)
- [reservation\_level\_rel\_service(资源位服务项目关联表)](#table-reservation_level_rel_service)
- [reservation\_record(预约记录表)](#table-reservation_record)
- [reservation\_resource\_level(资源位表)](#table-reservation_resource_level)
- [reservation\_setting(预约配置表)](#table-reservation_setting)
- [reservation\_shift\_type(班次类型表)](#table-reservation_shift_type)
- [reservation\_work\_shift(班次类型表)](#table-reservation_work_shift)
- [resources(资源包表)](#table-resources)
- [resources\_op\_log(资源操作记录表)](#table-resources_op_log)
- [salesperson\_active\_article\_share\_log(活动文章表)](#table-salesperson_active_article_share_log)
- [salesperson\_active\_article\_statistics(导购员活动转发数据统计表)](#table-salesperson_active_article_statistics)
- [salesperson\_coupon\_statistics(导购员优惠券数据统计表)](#table-salesperson_coupon_statistics)
- [salesperson\_items\_shelves()](#table-salesperson_items_shelves)
- [salesperson\_leaderboard(导购排名)](#table-salesperson_leaderboard)
- [salesperson\_leaderboard\_distributor(导购店铺排名)](#table-salesperson_leaderboard_distributor)
- [salesperson\_notice(导购通知)](#table-salesperson_notice)
- [salesperson\_notice\_log(导购通知)](#table-salesperson_notice_log)
- [salesperson\_operator\_log(商家操作日志表)](#table-salesperson_operator_log)
- [salesperson\_profit\_statistics(导购员销售提成数据统计表)](#table-salesperson_profit_statistics)
- [salesperson\_rel\_coupon(导购员优惠券数据统计表)](#table-salesperson_rel_coupon)
- [salesperson\_rel\_notice(导购通知关联表)](#table-salesperson_rel_notice)
- [salesperson\_sales\_statistics(导购员销售额数据统计表)](#table-salesperson_sales_statistics)
- [salesperson\_signup\_log(导购到/签退记录)](#table-salesperson_signup_log)
- [salesperson\_task(导购任务表)](#table-salesperson_task)
- [salesperson\_task\_record(导购任务表)](#table-salesperson_task_record)
- [salesperson\_task\_record\_logs(导购任务表)](#table-salesperson_task_record_logs)
- [salesperson\_task\_rel\_distributor(导购任务表)](#table-salesperson_task_rel_distributor)
- [self\_delivery\_staff(自配送员工信息表)](#table-self_delivery_staff)
- [selfservice\_form\_setting(自助表单配置)](#table-selfservice_form_setting)
- [selfservice\_form\_template(自助表单模板)](#table-selfservice_form_template)
- [selfservice\_registration\_activity(报名问卷活动)](#table-selfservice_registration_activity)
- [selfservice\_registration\_activity\_rel\_shop(报名活动关联店铺)](#table-selfservice_registration_activity_rel_shop)
- [selfservice\_registration\_record(报名记录)](#table-selfservice_registration_record)
- [selfservice\_user\_daily\_record(用户日常数据记录表)](#table-selfservice_user_daily_record)
- [service\_orders(服务订单表)](#table-service_orders)
- [servicelabels(数值属性表)](#table-servicelabels)
- [shipping\_templates(运费模板表)](#table-shipping_templates)
- [shop\_comments(店铺评论表)](#table-shop_comments)
- [shop\_menu(商家和平台端菜单管理)](#table-shop_menu)
- [shop\_menu\_rel\_type(菜单类型关联)](#table-shop_menu_rel_type)
- [shop\_notice(店铺公告表)](#table-shop_notice)
- [shop\_rel\_salesperson(店铺管理员关联店铺表)](#table-shop_rel_salesperson)
- [shop\_salesperson(门店人员)](#table-shop_salesperson)
- [sms\_idiograph(短信签名表)](#table-sms_idiograph)
- [sms\_template(短信模板表)](#table-sms_template)
- [sources(小程序来源列表)](#table-sources)
- [statement\_details(结算单明细)](#table-statement_details)
- [statement\_period\_setting(结算周期设置)](#table-statement_period_setting)
- [statements(结算单)](#table-statements)
- [sub\_orders(服务类子订单表)](#table-sub_orders)
- [super\_admin\_accounts(平台账号表)](#table-super_admin_accounts)
- [superadmin\_wxapp\_template(小程序模板表)](#table-superadmin_wxapp_template)
- [supplier(供应商)](#table-supplier)
- [supplier\_items(商品表)](#table-supplier_items)
- [supplier\_items\_attr(新供应商商品属性表)](#table-supplier_items_attr)
- [supplier\_items\_commission(商品佣金费率)](#table-supplier_items_commission)
- [supplier\_order(供应商订单)](#table-supplier_order)
- [systemlink\_oms\_queuelog(联通oms通信日志)](#table-systemlink_oms_queuelog)
- [template\_orders(小程序开通表)](#table-template_orders)
- [theme\_member\_center\_share(会员中心分享信息表)](#table-theme_member_center_share)
- [theme\_pc\_template(pc页面装修)](#table-theme_pc_template)
- [theme\_pc\_template\_content(pc页面装修组件内容)](#table-theme_pc_template_content)
- [thirdparty\_saaserp\_log(联通saasErp通信日志)](#table-thirdparty_saaserp_log)
- [thirdparty\_shop\_bind(矩阵节点绑定)](#table-thirdparty_shop_bind)
- [trade(交易单表)](#table-trade)
- [trade\_rate(订单评价表)](#table-trade_rate)
- [trade\_rate\_reply(订单评价回复/评论表)](#table-trade_rate_reply)
- [transcript\_properties(成绩单考评项目表)](#table-transcript_properties)
- [transcripts(成绩单配置表)](#table-transcripts)
- [user\_deposit(用户储值金额表)](#table-user_deposit)
- [user\_signin(用户签到表)](#table-user_signin)
- [user\_signin\_logs(用户签到奖励记录表)](#table-user_signin_logs)
- [user\_signin\_rules(用户签到规则表)](#table-user_signin_rules)
- [user\_task\_activity(签到日志)](#table-user_task_activity)
- [user\_task\_activity\_rule(签到活动规则)](#table-user_task_activity_rule)
- [user\_task\_finish\_rule(活动规则完成任务)](#table-user_task_finish_rule)
- [user\_transcripts(用户成绩单记录表)](#table-user_transcripts)
- [wechat\_authorization(微信授权表(公众号,小程序))](#table-wechat_authorization)
- [wechat\_tags(微信粉丝标签表)](#table-wechat_tags)
- [wechat\_weapp(微信小程序提交审核表)](#table-wechat_weapp)
- [wechat\_weapp\_customize\_page(小程序自定义页面)](#table-wechat_weapp_customize_page)
- [wechat\_weapp\_setting(小程序模板装修表)](#table-wechat_weapp_setting)
- [wechat\_weapp\_template(小程序模板表)](#table-wechat_weapp_template)
- [wechatfans\_bind\_wechattag(粉丝关联标微信签表)](#table-wechatfans_bind_wechattag)
- [work\_wechat\_message(企业微信通知)](#table-work_wechat_message)
- [work\_wechat\_message\_manager\_template(企业微信管理员通知模板)](#table-work_wechat_message_manager_template)
- [work\_wechat\_message\_template(企业微信通知模板)](#table-work_wechat_message_template)
- [work\_wechat\_rel(企业微信用户关联表)](#table-work_wechat_rel)
- [work\_wechat\_rel\_logs(企业微信用户关联关系日志)](#table-work_wechat_rel_logs)
- [work\_wechat\_verify\_domain\_file(企业微信可信域名校验文件)](#table-work_wechat_verify_domain_file)
- [wsugc\_badge(角标)](#table-wsugc_badge)
- [wsugc\_comment(笔记评论)](#table-wsugc_comment)
- [wsugc\_comment\_like(评论点赞)](#table-wsugc_comment_like)
- [wsugc\_follower()](#table-wsugc_follower)
- [wsugc\_image\_tag(图片tag关联表)](#table-wsugc_image_tag)
- [wsugc\_message(消息)](#table-wsugc_message)
- [wsugc\_post(笔记)](#table-wsugc_post)
- [wsugc\_post\_badge(笔记角标)](#table-wsugc_post_badge)
- [wsugc\_post\_favorite(笔记收藏)](#table-wsugc_post_favorite)
- [wsugc\_post\_goods(笔记)](#table-wsugc_post_goods)
- [wsugc\_post\_image(笔记的图片)](#table-wsugc_post_image)
- [wsugc\_post\_like(笔记点赞)](#table-wsugc_post_like)
- [wsugc\_post\_reviewlog(笔记审核日志)](#table-wsugc_post_reviewlog)
- [wsugc\_post\_topic()](#table-wsugc_post_topic)
- [wsugc\_setting(ugc通用设置)](#table-wsugc_setting)
- [wsugc\_tag(图片tag)](#table-wsugc_tag)
- [wsugc\_topic(话题)](#table-wsugc_topic)
- [wx\_external\_config(外部小程序配置表)](#table-wx_external_config)
- [wx\_external\_routes(外部小程序路径表)](#table-wx_external_routes)
- [wxshops(微信门店表)](#table-wxshops)
- [youshu\_setting(有数参数设置表)](#table-youshu_setting)

<a name="table-Hfpay_withdraw_set"></a>
## Hfpay\_withdraw\_set

> **提现设置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_withdraw\_set\_id  | 汇付提现配置表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| withdraw\_method  | 提现方式 1自动提现 2手动提现| INT | Yes | 1 | No |
| distributor\_money  | 店铺账号提现金额| VARCHAR(255) | Yes | 0 | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_withdraw\_set\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-activate_log"></a>
## activate\_log

> **激活表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 激活id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| resource\_id  | 资源包id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| eid  | 企业id| VARCHAR(255) | Yes | NULL | No |
| passport\_uid  | | VARCHAR(255) | Yes | NULL | No |
| active\_code  | 激活码| VARCHAR(255) | No | NULL | No |
| active\_type  | 激活类型| VARCHAR(255) | No | NULL | No |
| active\_status  | 激活状态| VARCHAR(255) | No | NULL | No |
| activeAt  | 激活时间| BIGINT | Yes | NULL | No |
| expiredAt  | 过期时间| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-adapay_alipay_industry_category"></a>
## adapay\_alipay\_industry\_category

> **支付宝行业分类**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 分类id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| category\_name  | 分类名称| VARCHAR(100) | Yes | NULL | No |
| parent\_id  | 父级id, 0为顶级| BIGINT | Yes | 0 | No |
| category\_level  | 分类等级| INT | Yes | 1 | No |
| alipay\_cls\_id  | 行业分类ID| BIGINT | No | NULL | No |
| alipay\_category\_id  | 支付宝经营类目| VARCHAR(20) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-adapay_bank_codes"></a>
## adapay\_bank\_codes

> **银行代码**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| bank\_name  | 银行名称| VARCHAR(100) | Yes | NULL | No |
| bank\_code  | 银行代码| VARCHAR(50) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_bank\_name | bank\_name | No |
| idx\_bank\_code | bank\_code | No |

<a name="table-adapay_corp_member"></a>
## adapay\_corp\_member

> **企业用户对象**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| app\_id  | 应用app\_id| VARCHAR(100) | Yes |  | No |
| order\_no  | 请求订单号| VARCHAR(64) | Yes |  | No |
| member\_id  | member\_id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| dealer\_id  | 经销商id| BIGINT | No | 0 | No |
| distributor\_id  | 店铺id| BIGINT | No | 0 | No |
| operator\_id  | 操作者id| INT | No | 0 | No |
| name  | 企业名称| VARCHAR(100) | Yes |  | No |
| prov\_code  | 省份编码| VARCHAR(10) | No |  | No |
| area\_code  | 地区编码| VARCHAR(10) | Yes |  | No |
| social\_credit\_code  | 统一社会信用码| VARCHAR(32) | Yes |  | No |
| social\_credit\_code\_expires  | 统一社会信用证有效期| VARCHAR(32) | Yes |  | No |
| business\_scope  | 经营范围| VARCHAR(800) | Yes |  | No |
| legal\_person  | 法人姓名| VARCHAR(500) | Yes |  | No |
| legal\_cert\_id  | 法人身份证号码| VARCHAR(255) | Yes |  | No |
| legal\_cert\_id\_expires  | 法人身份证有效期| VARCHAR(16) | Yes |  | No |
| legal\_mp  | 法人手机号| VARCHAR(255) | Yes |  | No |
| address  | 企业地址| VARCHAR(300) | Yes |  | No |
| zip\_code  | 邮编| VARCHAR(10) | No |  | No |
| telphone  | 企业电话| VARCHAR(30) | No |  | No |
| email  | 企业邮箱| VARCHAR(100) | No |  | No |
| attach\_file  | 上传附件| VARCHAR(300) | No |  | No |
| attach\_file\_name  | 附件文件名| VARCHAR(300) | No |  | No |
| confirm\_letter\_file  | 经销商确认函附件| VARCHAR(300) | No |  | No |
| confirm\_letter\_file\_name  | 经销商确认函附件文件名| VARCHAR(300) | No |  | No |
| bank\_code  | 银行代码，如果需要自动开结算账户，本字段必填| VARCHAR(30) | No |  | No |
| bank\_acct\_type  | 银行账户类型：1-对公；2-对私，如果需要自动开结算账户，本字段必填| VARCHAR(10) | Yes |  | No |
| card\_no  | 银行卡号，如果需要自动开结算账户，本字段必填| VARCHAR(255) | Yes |  | No |
| card\_name  | 银行卡对应的户名，如果需要自动开结算账户，本字段必填；若银行账户类型是对公，必须与企业名称一致| VARCHAR(100) | Yes |  | No |
| audit\_state  | 审核状态，状态包括：A-待审核；B-审核失败；C-开户失败；D-开户成功但未创建结算账户；E-开户和创建结算账户成功| VARCHAR(50) | No |  | No |
| audit\_desc  | 审核结果描述| VARCHAR(200) | No |  | No |
| status  | 当前交易状态| VARCHAR(50) | No |  | No |
| error\_info  | 错误描述| VARCHAR(500) | No |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_no | order\_no | No |
| idx\_name | name | No |
| idx\_company\_id | company\_id | No |
| idx\_card\_no | card\_no | No |
| idx\_member\_id | member\_id | No |

<a name="table-adapay_div_fee"></a>
## adapay\_div\_fee

> **分账金额表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| trade\_id  | 交易单号| VARCHAR(64) | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| company\_id  | 企业ID| VARCHAR(255) | Yes | NULL | No |
| distributor\_id  | 店铺ID| VARCHAR(255) | No | NULL | No |
| operator\_type  | 操作者类型:distributor-店铺;dealer-经销;admin:超级管理员| VARCHAR(255) | Yes | NULL | No |
| pay\_fee  | 支付金额| INT UNSIGNED | Yes | 0 | No |
| div\_fee  | 当前用户的分账金额，以分为单位| INT UNSIGNED | No | 0 | No |
| adapay\_member\_id  | 汇付账号关联ID| INT | No | 0 | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_distributor\_id | distributor\_id | No |
| ix\_order\_id | order\_id | No |
| ix\_trade\_id | trade\_id | No |
| ix\_list | company\_id, adapay\_member\_id | No |

<a name="table-adapay_draw_cash"></a>
## adapay\_draw\_cash

> **adapay提现表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| operator\_id  | 提现账号id| INT | No | 0 | No |
| operator\_type  | 操作账号类型:distributor-店铺;dealer-经销;admin:超级管理员| VARCHAR(255) | Yes | NULL | No |
| operator  | 操作人| VARCHAR(255) | No | NULL | No |
| app\_id  | 应用app\_id| VARCHAR(100) | Yes | NULL | No |
| order\_no  | 请求订单号| VARCHAR(64) | Yes | NULL | No |
| cash\_id  | 取现对象 id| VARCHAR(64) | No | NULL | No |
| bank\_card\_id  | 提现银行卡号| VARCHAR(100) | No | NULL | No |
| bank\_card\_name  | 银行卡对应的户名| VARCHAR(100) | No | NULL | No |
| cash\_type  | 取现类型：T1-T+1取现；D1-D+1取现；D0-即时取现| VARCHAR(10) | Yes | NULL | No |
| cash\_amt  | 取现金额，必须大于0，人民币为分| VARCHAR(255) | Yes | NULL | No |
| adapay\_member\_id  | 汇付账号id| VARCHAR(255) | Yes | NULL | No |
| status  | 提现状态| VARCHAR(255) | Yes | NULL | No |
| request\_params  | 请求参数 json| LONGTEXT | Yes | NULL | No |
| response\_params  | 回调参数 json| LONGTEXT | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| remark  | 备注| VARCHAR(255) | No | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_no | order\_no | No |
| idx\_adapay\_member\_id | adapay\_member\_id | No |

<a name="table-adapay_entry_apply"></a>
## adapay\_entry\_apply

> **开户申请表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_name  | 用户名| VARCHAR(64) | Yes | NULL | No |
| company\_id  | 企业ID| VARCHAR(255) | Yes | NULL | No |
| entry\_id  | 开户进件ID| VARCHAR(255) | Yes | NULL | No |
| apply\_type  | 申请类型:dealer;distributor| VARCHAR(255) | Yes | NULL | No |
| address  | 所属地区| VARCHAR(255) | No | NULL | No |
| comments  | 审批意见| LONGTEXT | No | NULL | No |
| is\_sms  | 是否短信提醒: 1:是  0:否| VARCHAR(20) | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| status  | WAIT\_APPROVE;APPROVED;REJECT| VARCHAR(20) | No | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-adapay_member"></a>
## adapay\_member

> **实名用户对象**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| app\_id  | 应用app\_id| VARCHAR(100) | Yes |  | No |
| location  | 用户地址| VARCHAR(200) | No |  | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| pid  | 父ID| BIGINT | Yes | 0 | No |
| is\_update  | 是否审核成功后修改 1:是  0:否| INT | Yes | 0 | No |
| operator\_id  | 操作者id| INT | No | 0 | No |
| operator\_type  | 操作者类型:distributor-店铺;dealer-经销;promoter-推广员| VARCHAR(255) | Yes | NULL | No |
| email  | 用户邮箱| VARCHAR(100) | No |  | No |
| member\_type  | 账户类型| VARCHAR(20) | No | person | No |
| gender  | 性别，为空时表示未填写| VARCHAR(50) | No |  | No |
| nickname  | 用户昵称| VARCHAR(50) | No |  | No |
| tel\_no  | 用户手机号| VARCHAR(255) | No |  | No |
| user\_name  | 用户姓名| VARCHAR(500) | No |  | No |
| cert\_type  | 证件类型，仅支持：00-身份证| VARCHAR(10) | No | 00 | No |
| cert\_id  | 证件号| VARCHAR(255) | No |  | No |
| is\_sms  | 是否短信提醒: 1:是  0:否| VARCHAR(20) | No | NULL | No |
| audit\_state  | 审核状态，状态包括：A-待审核；B-审核失败；C-开户失败；D-开户成功但未创建结算账户；E-开户和创建结算账户成功| VARCHAR(50) | No |  | No |
| audit\_desc  | 审核结果描述| VARCHAR(500) | No |  | No |
| status  | 当前交易状态| VARCHAR(50) | No |  | No |
| error\_info  | 错误描述| VARCHAR(500) | No |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |
| valid  | 是否点过结算中心| TINYINT(1) | No | 0 | No |
| is\_created  | 会员是否创建成功| TINYINT(1) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_tel\_no | tel\_no | No |
| idx\_user\_name | user\_name | No |
| idx\_company\_id | company\_id | No |
| idx\_cert\_id | cert\_id | No |
| idx\_pid | pid | No |
| idx\_operator\_id | operator\_id | No |
| idx\_audit\_state | audit\_state | No |

<a name="table-adapay_member_update_log"></a>
## adapay\_member\_update\_log

> **adapay子账户修改log(审核成功后修改)**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| VARCHAR(255) | Yes | NULL | No |
| app\_id  | 应用app\_id| VARCHAR(100) | Yes |  | No |
| member\_id  | adapay\_member的主键id(汇付id)| VARCHAR(255) | Yes | NULL | No |
| data  | 修改数据 json| LONGTEXT | Yes | NULL | No |
| audit\_state  | 审核状态，状态包括：A-待审核；B-审核失败；C-开户失败；D-开户成功但未创建结算账户；E-开户和创建结算账户成功| VARCHAR(50) | No |  | No |
| audit\_desc  | 审核结果描述| VARCHAR(500) | No |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_app\_id | app\_id | No |
| idx\_member\_id | member\_id | No |

<a name="table-adapay_merchant_entry"></a>
## adapay\_merchant\_entry

> **adapay开户进件**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| request\_id  | 请求ID| VARCHAR(100) | Yes | NULL | No |
| usr\_phone  | 注册手机号| VARCHAR(255) | Yes | NULL | No |
| cont\_name  | 联系人姓名| VARCHAR(500) | Yes | NULL | No |
| cont\_phone  | 联系人手机号码| VARCHAR(255) | Yes | NULL | No |
| customer\_email  | 电子邮箱| VARCHAR(100) | Yes | NULL | No |
| mer\_name  | 商户名，小微商户填负责人姓名| VARCHAR(50) | Yes | NULL | No |
| mer\_short\_name  | 商户名简称| VARCHAR(50) | Yes | NULL | No |
| license\_code  | 营业执照编码，如三证合一传三证合一码，企业时必填| VARCHAR(50) | No | NULL | No |
| reg\_addr  | 注册地址| VARCHAR(100) | Yes | NULL | No |
| cust\_addr  | 经营地址| VARCHAR(100) | Yes | NULL | No |
| cust\_tel  | 商户电话| VARCHAR(255) | Yes | NULL | No |
| mer\_start\_valid\_date  | 商户有效日期（始），格式 YYYYMMDD （若开户企业类商户，必填）| VARCHAR(30) | No | NULL | No |
| mer\_valid\_date  | 商户有效日期（至），格式 YYYYMMDD（若为长期有效，固定为“20991231”;若开户企业类商户，必填）| VARCHAR(30) | No | NULL | No |
| legal\_name  | 法人/负责人 姓名| VARCHAR(500) | Yes | NULL | No |
| legal\_type  | 法人/负责人证件类型，0-身份证| VARCHAR(10) | Yes | NULL | No |
| legal\_idno  | 法人/负责人证件号码| VARCHAR(255) | Yes | NULL | No |
| legal\_mp  | 法人/负责人手机号| VARCHAR(255) | Yes | NULL | No |
| legal\_start\_cert\_id\_expires  | 法人/负责人身份证有效期（始），格式 YYYYMMDD| VARCHAR(30) | Yes | NULL | No |
| legal\_id\_expires  | 法人/负责人身份证有效期（至），格式 YYYYMMDD| VARCHAR(30) | Yes | NULL | No |
| card\_id\_mask  | 结算银行卡号| VARCHAR(255) | Yes | NULL | No |
| bank\_code  | 结算银行卡所属银行code| VARCHAR(20) | Yes | NULL | No |
| card\_name  | 结算银行卡开户姓名| VARCHAR(500) | Yes | NULL | No |
| bank\_acct\_type  | 结算银行账户类型，1 : 对公， 2 : 对私。小微只能是对私| VARCHAR(5) | Yes | NULL | No |
| prov\_code  | 结算银行卡省份编码| VARCHAR(10) | Yes | NULL | No |
| area\_code  | 结算银行卡地区编码| VARCHAR(10) | Yes | NULL | No |
| rsa\_public\_key  | 商户rsa 公钥| LONGTEXT | No | NULL | No |
| entry\_mer\_type  | 商户类型：1-企业；2-小微| VARCHAR(10) | Yes | NULL | No |
| test\_api\_key  | 测试API Key| VARCHAR(255) | No | NULL | No |
| live\_api\_key  | 生产API Key| VARCHAR(255) | No | NULL | No |
| login\_pwd  | 初始密码| VARCHAR(1024) | No | NULL | No |
| app\_id\_list  | 应用ID列表| LONGTEXT | No | NULL | No |
| sign\_view\_url  | 合同查看地址| VARCHAR(1024) | No | NULL | No |
| is\_sms  | 是否短信提醒: 1:是  0:否| VARCHAR(20) | No | NULL | No |
| status  | 接口调用状态，succeeded - 成功 failed - 失败 pending - 处理中| VARCHAR(20) | No | NULL | No |
| error\_msg  | 错误描述| VARCHAR(500) | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_request\_id | request\_id | No |

<a name="table-adapay_merchant_resident"></a>
## adapay\_merchant\_resident

> **adapay商户入驻**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| request\_id  | 请求ID| VARCHAR(100) | Yes | NULL | No |
| sub\_api\_key  | 商户开户进件返回的API Key| VARCHAR(255) | Yes | NULL | No |
| fee\_type  | 费率类型：01-标准费率线上，02-标准费率线下| VARCHAR(10) | Yes | NULL | No |
| app\_id  | 商户开户进件返回的应用ID| VARCHAR(255) | Yes | NULL | No |
| wx\_category  | 微信经营类目（与支付宝二选一）| VARCHAR(50) | No | NULL | No |
| alipay\_category  | 支付宝经营类目（与微信二选一）| VARCHAR(50) | No | NULL | No |
| cls\_id  | 行业分类| VARCHAR(50) | No | NULL | No |
| model\_type  | 入驻模式：1-服务商模式| VARCHAR(10) | Yes | NULL | No |
| mer\_type  | 商户种类，1-政府机构,2-国营企业,3-私营企业,4-外资企业,5-个体工商户,7-事业单位,8-小微| VARCHAR(10) | Yes | NULL | No |
| province\_code  | 省份编码| VARCHAR(20) | Yes | NULL | No |
| city\_code  | 城市编码| VARCHAR(20) | Yes | NULL | No |
| district\_code  | 区县编码| VARCHAR(20) | Yes | NULL | No |
| add\_value\_list  | 支付渠道配置信息| LONGTEXT | Yes | NULL | No |
| adapay\_fee\_mode  | 总商户 手续费扣除方式 I:内扣 O:外扣| VARCHAR(20) | Yes | NULL | No |
| status  | 接口调用状态，succeeded - 成功 failed - 失败 pending - 处理中| VARCHAR(20) | Yes | NULL | No |
| alipay\_stat  | 支付宝入驻结果：S-成功，F-失败| VARCHAR(20) | No | NULL | No |
| alipay\_stat\_msg  | 支付宝入驻错误描述| VARCHAR(500) | No | NULL | No |
| wx\_stat  | 微信入驻结果：S-成功，F-失败| VARCHAR(20) | No | NULL | No |
| wx\_stat\_msg  | 微信入驻错误描述| VARCHAR(500) | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_request\_id | request\_id | No |

<a name="table-adapay_operation_log"></a>
## adapay\_operation\_log

> **adapay操作日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| operator\_id  | 日志实际操作者ID| BIGINT | Yes | 0 | No |
| rel\_id  | 关联ID,店铺类型为分店ID，经销商为主经销商账号operator\_id| BIGINT | Yes | 0 | No |
| log\_type  | merchant-主商户;distributor-店铺;dealer-经销| VARCHAR(50) | Yes | NULL | No |
| content  | 日志内容| VARCHAR(255) | Yes |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_id | company\_id, rel\_id | No |
| idx\_log\_type | log\_type | No |

<a name="table-adapay_paymemt_confirm"></a>
## adapay\_paymemt\_confirm

> **adapay支付确认表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单id| VARCHAR(255) | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | No | NULL | No |
| payment\_id  | Adapay生成的支付对象id 对应order表的transaction\_id| VARCHAR(255) | No | NULL | No |
| payment\_confirmation\_id  | 支付确认id| VARCHAR(255) | No | NULL | No |
| order\_no  | 支付确认请求订单号| VARCHAR(255) | No | NULL | No |
| confirm\_amt  | 确认金额 单位：元| VARCHAR(255) | No | NULL | No |
| div\_members  | 分账对象信息列表 json| LONGTEXT | No | NULL | No |
| status  | 交易状态| VARCHAR(255) | No | NULL | No |
| request\_params  | 请求参数 json| LONGTEXT | No | NULL | No |
| response\_params  | 响应参数 json| LONGTEXT | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_id | order\_id | No |
| idx\_order\_no | order\_no | No |
| distributor\_id | distributor\_id | No |

<a name="table-adapay_payment_reverse"></a>
## adapay\_payment\_reverse

> **adapay支付撤销表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单id| VARCHAR(255) | Yes | NULL | No |
| payment\_id  | Adapay生成的支付对象id 对应order表的transaction\_id| VARCHAR(255) | Yes | NULL | No |
| payment\_reverse\_id  | 支付撤销id| VARCHAR(255) | No | NULL | No |
| app\_id  | 应用app\_id| VARCHAR(255) | Yes | NULL | No |
| order\_no  | 支付撤销请求订单号| VARCHAR(255) | Yes | NULL | No |
| reverse\_amt  | 撤销金额 单位：元| VARCHAR(255) | Yes | NULL | No |
| status  | 状态| VARCHAR(255) | Yes | NULL | No |
| request\_params  | 请求参数 json| LONGTEXT | Yes | NULL | No |
| response\_params  | 响应参数 json| LONGTEXT | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_id | order\_id | No |
| idx\_order\_no | order\_no | No |

<a name="table-adapay_regions"></a>
## adapay\_regions

> **省市编码(四位码)**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| area\_name  | 名称| VARCHAR(50) | Yes | NULL | No |
| pid  | 父级ID| BIGINT | Yes | NULL | No |
| area\_code  | 编码| VARCHAR(50) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_area\_name | area\_name | No |
| idx\_area\_code | area\_code | No |

<a name="table-adapay_regions_third"></a>
## adapay\_regions\_third

> **省市区编码(六位码或九位码)**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| area\_name  | 名称| VARCHAR(50) | Yes | NULL | No |
| pid  | 父级ID| BIGINT | Yes | NULL | No |
| area\_code  | 编码| VARCHAR(50) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_area\_name | area\_name | No |
| idx\_area\_code | area\_code | No |

<a name="table-adapay_settle_account"></a>
## adapay\_settle\_account

> **结算账户**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| app\_id  | 应用app\_id| VARCHAR(100) | No |  | No |
| settle\_account\_id  | 由 Adapay 生成的结算账户对象 id| VARCHAR(100) | No |  | No |
| member\_id  | member\_id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| channel  | 目前仅支持：bank\_account（银行卡）| VARCHAR(50) | No | bank_account | No |
| card\_id  | 银行卡号，如果需要自动开结算账户，本字段必填| VARCHAR(255) | No |  | No |
| card\_name  | 银行卡对应的户名，如果需要自动开结算账户，本字段必填；若银行账户类型是对公，必须与企业名称一致| VARCHAR(500) | No |  | No |
| cert\_id  | 证件号| VARCHAR(255) | No |  | No |
| cert\_type  | 证件类型，仅支持：00-身份证| VARCHAR(10) | No | 00 | No |
| tel\_no  | 用户手机号| VARCHAR(255) | No |  | No |
| bank\_code  | 银行编码，详见附录 银行代码，银行账户类型对公时，必填| VARCHAR(30) | No |  | No |
| bank\_name  | 开户银行名称| VARCHAR(30) | No |  | No |
| bank\_acct\_type  | 银行账户类型：1-对公；2-对私，如果需要自动开结算账户，本字段必填| VARCHAR(10) | Yes |  | No |
| prov\_code  | 省份编码, 银行账户类型为对公时，必填| VARCHAR(10) | No |  | No |
| area\_code  | 地区编码, 银行账户类型为对公时，必填| VARCHAR(10) | No |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_member\_id | member\_id | No |
| idx\_card\_id | card\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_cert\_id | cert\_id | No |
| idx\_settle\_account\_id | settle\_account\_id | No |

<a name="table-adapay_sms_log"></a>
## adapay\_sms\_log

> **adapay短信提醒日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| VARCHAR(255) | Yes | NULL | No |
| usr\_phone  | 发送手机号| VARCHAR(255) | Yes | NULL | No |
| rel\_id  | 如果type(提醒类型)为1或2 此字段为开户的member\_id,如果type(提醒类型)为3 此字段为dealer\_id| VARCHAR(255) | Yes | NULL | No |
| type  | 提醒类型 总商户开户提醒:1  子商户开户提醒:2  重置密码提醒:3| VARCHAR(255) | Yes | NULL | No |
| content  | 发送内容| LONGTEXT | Yes | NULL | No |
| status  | 发送状态 1:成功  0:失败| VARCHAR(255) | No | NULL | No |
| error\_info  | 错误信息| LONGTEXT | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_rel\_id | rel\_id | No |
| ix\_usr\_phone | usr\_phone | No |

<a name="table-adapay_submit_license"></a>
## adapay\_submit\_license

> **adapay提交商户证照**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| sub\_api\_key  | 渠道商下商户的apiKey| VARCHAR(255) | Yes | NULL | No |
| social\_credit\_code\_id  | 统一社会信用代码的pic\_id，企业商户必填，小微商户不填| VARCHAR(255) | No | NULL | No |
| legal\_certId\_front\_id  | 法人身份证正面的pic\_id| VARCHAR(255) | Yes | NULL | No |
| legal\_cert\_id\_back\_id  | 法人身份证反面的pic\_id| VARCHAR(255) | Yes | NULL | No |
| account\_opening\_permit\_id  | 开户许可证图片的pic\_id| VARCHAR(255) | Yes | NULL | No |
| business\_add  | 若入驻的费率类型为线上时，该字段必填，请传入商户的业务网址或者商城地址| VARCHAR(500) | No | NULL | No |
| store\_id  | 门店的pic\_id，若入驻的费率类型为线下时，该字段必填| VARCHAR(255) | No | NULL | No |
| transaction\_test\_record\_id  | 商户在业务网址或商城地址上测试的交易记录截图的pic\_id| VARCHAR(255) | No | NULL | No |
| web\_pic\_id  | 网站截图的pic\_id| VARCHAR(255) | No | NULL | No |
| lease\_contract\_id  | 租赁合同的pic\_id，如经营场所照片无法体现经营内容时上传| VARCHAR(255) | No | NULL | No |
| settle\_account\_certificate\_id  | 结算账号开户证明图片的pic\_id| VARCHAR(255) | No | NULL | No |
| buss\_support\_materials\_id  | 业务场景证明材料pic\_id，如经营场所照片无法体现经营内容时上传| VARCHAR(255) | No | NULL | No |
| icp\_registration\_license\_id  | icp备案许可证明或者许可证编码的pic\_id| VARCHAR(255) | No | NULL | No |
| industry\_qualify\_doc\_type  | 行业资质文件类型：1游戏类，2直播类，3小说图书类，4其他| VARCHAR(255) | No | NULL | No |
| industry\_qualify\_doc\_license\_id  | 行业资质文件的pic\_id| VARCHAR(255) | No | NULL | No |
| shareholder\_info\_list  | 股东信息| LONGTEXT | No | NULL | No |
| is\_sms  | 是否短信提醒: 1:是  0:否| VARCHAR(20) | No | NULL | No |
| audit\_status  | W -&gt; 待补充，I -&gt; 初始，P -&gt; 通过，R -&gt; 拒绝| VARCHAR(255) | No | NULL | No |
| audit\_desc  | 审核拒绝原因| VARCHAR(500) | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-adapay_upload_license"></a>
## adapay\_upload\_license

> **adapay上传商户证照**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| sub\_api\_key  | 渠道商下商户的apiKey| VARCHAR(255) | Yes | NULL | No |
| file\_url  | 文件路径| LONGTEXT | Yes | NULL | No |
| file\_type  | 图片类型，01：三证合一码，02：法人/小微负责人身份证正面，03：法人/小微负责人身份证反面，04：门店，05：开户许可证/小微负责人银行卡正面照，06：股东身份证正面，07：股东身份证反面，08：结算账号开户证明，09：网站截图，10：行业资质文件，11：icp备案许可证明或者许可证编码，12：租赁合同，13：交易测试记录，14：业务场景证明材料| VARCHAR(10) | Yes | NULL | No |
| pic\_id  | Adapay系统生成的图片id，作为 提交商户证照 接口的请求参数上送至Adapay| VARCHAR(255) | Yes | NULL | No |
| error\_msg  | 错误描述| VARCHAR(500) | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-adapay_withdraw_set"></a>
## adapay\_withdraw\_set

> **提现设置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 提现配置表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| isAuto  | 是否支持自动提现| TINYINT(1) | Yes | NULL | No |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| distributor\_id  | 经销商 id| BIGINT | Yes | NULL | No |
| cash\_amt  | 取现金额，必须大于0，人民币为元| VARCHAR(255) | No | NULL | No |
| cash\_type  | 取现方式 T0：T0取现; T1：T1取现 D1：D1取现| VARCHAR(255) | Yes | NULL | No |
| rule  | 提现规则| LONGTEXT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-adapay_wx_business_category"></a>
## adapay\_wx\_business\_category

> **微信经营类目**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| fee\_type  | 费率类型| VARCHAR(10) | Yes | NULL | No |
| fee\_type\_name  | 费率类型名称| VARCHAR(50) | Yes | NULL | No |
| merchant\_type\_name  | 商户种类名称| VARCHAR(50) | Yes | NULL | No |
| business\_category\_id  | 微信经营类目id| VARCHAR(50) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_merchant\_type\_name | merchant\_type\_name | No |
| idx\_business\_category\_id | business\_category\_id | No |

<a name="table-aftersales"></a>
## aftersales

> **售后主表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| aftersales\_bn  | 售后单号| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| salesman\_id  | 导购员id| BIGINT | No | 0 | No |
| item\_bn  | 商品编码| VARCHAR(255) | No | NULL | No |
| shop\_id  | 门店id| BIGINT | Yes | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| aftersales\_type  | 售后服务类型| VARCHAR(255) | Yes | NULL | No |
| aftersales\_status  | 售后状态| INT | Yes | 0 | No |
| progress  | 处理进度| INT | Yes | 0 | No |
| refund\_fee  | 应退总金额，单位(分)| INT UNSIGNED | Yes | NULL | No |
| refund\_point  | 应退总积分| INT UNSIGNED | Yes | NULL | No |
| reason  | 申请售后原因| VARCHAR(300) | Yes | NULL | No |
| description  | 申请描述| VARCHAR(300) | No | NULL | No |
| evidence\_pic  | 图片凭证信息| LONGTEXT | No | NULL | No |
| refuse\_reason  | 拒绝原因| LONGTEXT | No | NULL | No |
| memo  | 售后备注| VARCHAR(300) | No | NULL | No |
| sendback\_data  | 消费者提交退货物流信息| JSON | No | NULL | No |
| sendconfirm\_data  | 商家重新发货物流信息| JSON | No | NULL | No |
| third\_data  | 百胜等第三方返回的数据| VARCHAR(255) | No | NULL | No |
| aftersales\_address  | 售后回寄地址信息| JSON | No | NULL | No |
| distributor\_remark  | 店务端商家备注| VARCHAR(255) | Yes |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |
| contact  | 联系人| VARCHAR(500) | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| is\_partial\_cancel  | 是否部分取消订单退款| TINYINT(1) | No | 0 | No |
| return\_type  | 退货方式：logistics寄回 offline到店退| VARCHAR(20) | Yes | logistics | No |
| return\_distributor\_id  | 退货门店ID| BIGINT UNSIGNED | Yes | 0 | No |
| self\_delivery\_operator\_id  | 自配送员id| BIGINT | No | 0 | No |
| freight  | 退款运费| INT UNSIGNED | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | aftersales\_bn | Yes |
| idx\_aftersales\_bn | aftersales\_bn | No |
| idx\_order\_id | order\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_merchant\_id | merchant\_id | No |

<a name="table-aftersales_detail"></a>
## aftersales\_detail

> **售后明细子表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| detail\_id  | 售后明细ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| aftersales\_bn  | 售后单号| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | Yes | NULL | No |
| sub\_order\_id  | 订单明细表id| BIGINT | Yes | NULL | No |
| goods\_id  | 产品id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| item\_bn  | 商品编码| VARCHAR(255) | No | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| order\_item\_type  | 订单商品类型,normal:正常商品，gift: 赠品, plus\_buy: 加价购商品| VARCHAR(255) | Yes | normal | No |
| item\_pic  | 商品图片| VARCHAR(255) | No | NULL | No |
| num  | 售后数量| INT UNSIGNED | Yes | NULL | No |
| refund\_fee  | 应退总金额，单位(分)| INT UNSIGNED | Yes | NULL | No |
| refund\_point  | 积分支付应退款积分| INT | No | 0 | No |
| aftersales\_type  | 售后服务类型| VARCHAR(255) | Yes | NULL | No |
| progress  | 处理进度| INT | Yes | 0 | No |
| aftersales\_status  | 售后状态| INT | Yes | 0 | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |
| auto\_refuse\_time  | 售后自动驳回时间| VARCHAR(255) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | detail\_id | Yes |
| idx\_aftersales\_bn | aftersales\_bn | No |
| idx\_order\_id | order\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_company\_order\_sub | company\_id, order\_id, sub\_order\_id | No |

<a name="table-aftersales_offline_refund"></a>
## aftersales\_offline\_refund

> **线下转账退款**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| refund\_bn  | 申请退款单号| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| refund\_fee  | 应退金额，以分为单位，非积分支付| INT UNSIGNED | Yes | NULL | No |
| bank\_account\_name  | 收款账户名称| VARCHAR(50) | Yes | NULL | No |
| bank\_account\_no  | 收款银行账号| VARCHAR(30) | Yes | NULL | No |
| bank\_name  | 收款开户银行| VARCHAR(100) | Yes | NULL | No |
| refund\_account\_name  | 退款账户名| VARCHAR(100) | No |  | No |
| refund\_account\_bank  | 退款银行| VARCHAR(100) | No |  | No |
| refund\_account\_no  | 退款账号| VARCHAR(100) | No |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_refund\_bn | refund\_bn | No |
| idx\_order\_id | order\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-aftersales_refund"></a>
## aftersales\_refund

> **退款表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| refund\_bn  | 申请退款单号| BIGINT | Yes | NULL | No |
| aftersales\_bn  | 售后单号| BIGINT | No | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| trade\_id  | 支付单号| VARCHAR(64) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商id| BIGINT | Yes | 0 | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| refund\_type  | 退款类型| VARCHAR(255) | Yes | 0 | No |
| refund\_channel  | 退款渠道| VARCHAR(255) | Yes | NULL | No |
| refund\_status  | 退款状态| VARCHAR(255) | Yes | READY | No |
| refund\_fee  | 应退金额，以分为单位，非积分支付| INT UNSIGNED | Yes | NULL | No |
| refunded\_fee  | 实退金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| refund\_point  | 应退积分，以分为单位| INT UNSIGNED | Yes | NULL | No |
| refunded\_point  | 实退积分| INT UNSIGNED | Yes | 0 | No |
| return\_point  | 退还(下单获得的)积分，以分为单位| INT UNSIGNED | Yes | NULL | No |
| return\_freight  | 是否退运费| INT | Yes | 0 | No |
| pay\_type  | 支付方式，同对应支付单| VARCHAR(255) | No |  | No |
| currency  | 货币类型| VARCHAR(16) | No | NULL | No |
| refunds\_memo  | 退款备注| VARCHAR(255) | No | NULL | No |
| refund\_success\_time  | 退款成功时间| BIGINT | No | NULL | No |
| refund\_id  | 商户返回退款单号| VARCHAR(50) | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |
| cur\_fee\_type  | 系统配置货币类型| VARCHAR(5) | No | CNY | No |
| cur\_fee\_rate  | 系统配置货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| cur\_fee\_symbol  | 系统配置货币符号| VARCHAR(255) | No | ￥ | No |
| cur\_pay\_fee  | 系统货币支付金额| VARCHAR(255) | Yes | NULL | No |
| hf\_order\_id  | hf\_order\_id| VARCHAR(255) | No | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| freight  | 退款运费| INT UNSIGNED | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | refund\_bn | Yes |
| idx\_aftersales\_bn | aftersales\_bn | No |
| idx\_order\_id | order\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_merchant\_id | merchant\_id | No |
| idx\_supplier\_id | supplier\_id | No |

<a name="table-ali_mini_app_setting"></a>
## ali\_mini\_app\_setting

> **支付宝小程序配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| setting\_id  | 配置id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 支付宝小程序appid| VARCHAR(64) | Yes | NULL | No |
| merchant\_private\_key  | 应用私钥| LONGTEXT | Yes | NULL | No |
| api\_sign\_method  | api加密类型| VARCHAR(64) | Yes | NULL | No |
| alipay\_cert\_path  | 支付宝公钥证书文件路径| LONGTEXT | No | NULL | No |
| alipay\_root\_cert\_path  | 支付宝根证书文件路径| LONGTEXT | No | NULL | No |
| merchant\_cert\_path  | 应用公钥证书文件路径| LONGTEXT | No | NULL | No |
| alipay\_public\_key  | 支付宝公钥字符串| LONGTEXT | No | NULL | No |
| notify\_url  | 支付类接口异步通知接收服务地址| VARCHAR(255) | No | NULL | No |
| encrypt\_key  | AES密钥| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | setting\_id | Yes |
| ix\_company\_id | company\_id | Yes |
| ix\_authorizer\_appid | authorizer\_appid | Yes |

<a name="table-aliyunsms_accesskey"></a>
## aliyunsms\_accesskey

> **AccessKey表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| accesskey\_id  | accesskey\_id| VARCHAR(255) | Yes | NULL | No |
| accesskey\_secret  | accesskey\_secret| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-aliyunsms_record"></a>
## aliyunsms\_record

> **短信发送记录**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| scene\_id  | 场景ID| INT | Yes | NULL | No |
| task\_id  | 任务ID| INT | Yes | NULL | No |
| template\_code  | 模板code| VARCHAR(255) | Yes | NULL | No |
| sms\_content  | 短信内容| VARCHAR(255) | No | NULL | No |
| template\_type  | 短信类型:0：验证码;1：短信通知;2：推广短信;| VARCHAR(255) | Yes | NULL | No |
| status  | 发送状态:1-发送中;2-发送失败;3-发送成功| VARCHAR(255) | Yes | NULL | No |
| biz\_id  | 发送回执ID| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-aliyunsms_scene"></a>
## aliyunsms\_scene

> **场景表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| scene\_name  | 场景名称| VARCHAR(255) | Yes | NULL | No |
| scene\_title  | 场景title| VARCHAR(255) | No | NULL | No |
| template\_type  | 短信类型: 0：验证码;1：短信通知;2：推广短信;3：国际/港澳台消息| VARCHAR(255) | Yes | NULL | No |
| status  | 状态| VARCHAR(255) | Yes | NULL | No |
| default\_template  | 默认模板| VARCHAR(255) | No | NULL | No |
| variables  | 模板变量| VARCHAR(500) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-aliyunsms_scene_item"></a>
## aliyunsms\_scene\_item

> **场景实例表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| scene\_id  | 场景ID| INT | Yes | NULL | No |
| sign\_id  | 签名ID| INT | Yes | NULL | No |
| sign\_name  | 签名名称| VARCHAR(255) | Yes | NULL | No |
| template\_id  | 模板ID| INT | Yes | NULL | No |
| template\_content  | 模板内容| LONGTEXT | Yes | NULL | No |
| status  | 0-未启用;1-已启用| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-aliyunsms_sign"></a>
## aliyunsms\_sign

> **短信签名表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| sign\_name  | 签名名称| VARCHAR(20) | Yes | NULL | No |
| sign\_source  | 签名来源| VARCHAR(2) | Yes | NULL | No |
| remark  | 签名申请说明| VARCHAR(255) | Yes | NULL | No |
| sign\_file  | 资质证明| LONGTEXT | No | NULL | No |
| delegate\_file  | 委托授权书| LONGTEXT | No | NULL | No |
| status  | 审核状态:0-审核中;1-审核通过;2-审核失败| VARCHAR(2) | Yes | NULL | No |
| reason  | 审核备注| VARCHAR(255) | No | NULL | No |
| third\_party  | 签名用途 1:他用;0:自用| INT | Yes | 0 | No |
| qualification\_id  | 资质ID| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-aliyunsms_task"></a>
## aliyunsms\_task

> **短信群发任务**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| task\_name  | 任务名称| VARCHAR(255) | Yes | NULL | No |
| sign\_id  | 签名ID| INT | Yes | NULL | No |
| template\_id  | 模板id| INT | Yes | NULL | No |
| template\_name  | 模板名称| VARCHAR(255) | Yes | NULL | No |
| user\_id  | 会员id| LONGTEXT | Yes | NULL | No |
| status  | 发送状态:1-等待中;2-发送成功;3-发送失败;4-已撤销| VARCHAR(255) | Yes | NULL | No |
| send\_at  | 发送时间| INT | Yes | NULL | No |
| total\_num  | 号码数量| INT | Yes | NULL | No |
| failed\_num  | 失败号码数量| INT | Yes | NULL | No |
| is\_send  | 是否已发送| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-aliyunsms_template"></a>
## aliyunsms\_template

> **模板表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 模板ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| template\_type  | 短信类型: 0：验证码;1：短信通知;2：推广短信;3：国际/港澳台消息| VARCHAR(255) | Yes | NULL | No |
| template\_name  | 模板名称| VARCHAR(255) | Yes | NULL | No |
| remark  | 模板申请说明| VARCHAR(255) | Yes | NULL | No |
| template\_content  | 模板内容| LONGTEXT | Yes | NULL | No |
| scene\_id  | 短信场景| INT | Yes | NULL | No |
| template\_code  | 模板编码| VARCHAR(255) | No | NULL | No |
| status  | 审核状态:0-审核中;1-审核通过;2-审核失败| VARCHAR(255) | Yes | NULL | No |
| reason  | 审核备注| VARCHAR(255) | No | NULL | No |
| related\_sign\_name  | 关联签名名称| VARCHAR(20) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-bspay_div_fee"></a>
## bspay\_div\_fee

> **分账金额表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| trade\_id  | 交易单号| VARCHAR(64) | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| company\_id  | 企业ID| VARCHAR(255) | Yes | NULL | No |
| distributor\_id  | 店铺ID| VARCHAR(255) | No | NULL | No |
| supplier\_id  | 供应商ID| BIGINT | Yes | 0 | No |
| operator\_type  | 操作者类型:distributor-店铺;dealer-经销;admin:超级管理员;supplier:经销商| VARCHAR(255) | Yes | NULL | No |
| pay\_fee  | 支付金额| INT UNSIGNED | Yes | 0 | No |
| div\_fee  | 当前用户的分账金额，以分为单位| INT UNSIGNED | No | 0 | No |
| huifu\_id  | 汇付ID| VARCHAR(255) | No |  | No |
| created  | 创建时间| INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_distributor\_id | distributor\_id | No |
| ix\_supplier\_id | supplier\_id | No |
| ix\_order\_id | order\_id | No |
| ix\_trade\_id | trade\_id | No |
| ix\_list | company\_id, huifu\_id | No |

<a name="table-bspay_entry_apply"></a>
## bspay\_entry\_apply

> **开户申请表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_name  | 用户名| VARCHAR(64) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| user\_id  | 开户进件ID| VARCHAR(255) | Yes | NULL | No |
| operator\_id  | 操作者id| INT | No | 0 | No |
| operator\_type  | 操作者类型:distributor-店铺;dealer-经销;promoter-推广员| VARCHAR(255) | Yes | NULL | No |
| user\_type  | 进件类型| VARCHAR(20) | Yes | indv | No |
| address  | 所属地区| VARCHAR(255) | No | NULL | No |
| comments  | 审批意见| LONGTEXT | No | NULL | No |
| status  | WAIT\_APPROVE;APPROVED;REJECT| VARCHAR(20) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_user\_id | user\_id | No |
| ix\_operator\_type | operator\_type | No |
| ix\_status | status | No |

<a name="table-bspay_paymemt_confirm"></a>
## bspay\_paymemt\_confirm

> **斗拱支付确认表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单id| VARCHAR(255) | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | No | NULL | No |
| payment\_id  | 斗拱生成的交易订单号 对应order表的transaction\_id| VARCHAR(255) | No | NULL | No |
| payment\_confirmation\_id  | 支付确认id| VARCHAR(255) | No | NULL | No |
| order\_no  | 支付确认请求订单号| VARCHAR(255) | No | NULL | No |
| confirm\_amt  | 确认金额 单位：元| VARCHAR(255) | No | NULL | No |
| div\_members  | 分账对象信息列表 json| LONGTEXT | No | NULL | No |
| status  | 交易状态| VARCHAR(255) | No | NULL | No |
| request\_params  | 请求参数 json| LONGTEXT | No | NULL | No |
| response\_params  | 响应参数 json| LONGTEXT | No | NULL | No |
| created  | 创建时间| INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_id | order\_id | No |
| idx\_order\_no | order\_no | No |
| distributor\_id | distributor\_id | No |

<a name="table-bspay_regions_third"></a>
## bspay\_regions\_third

> **省市区编码(六位码或九位码)**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| area\_name  | 名称| VARCHAR(50) | Yes | NULL | No |
| pid  | 父级ID| BIGINT | Yes | NULL | No |
| area\_code  | 编码| VARCHAR(50) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_area\_name | area\_name | No |
| idx\_area\_code | area\_code | No |

<a name="table-bspay_user_card"></a>
## bspay\_user\_card

> **用户结算账户**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| sys\_id  | 商户的huifu\_id| VARCHAR(255) | No |  | No |
| huifu\_id  | 汇付ID| VARCHAR(255) | No |  | No |
| user\_id  | 开户进件ID| BIGINT | Yes | NULL | No |
| req\_seq\_id  | 请求流水号| VARCHAR(64) | No |  | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| user\_type  | 进件类型| VARCHAR(20) | Yes | indv | No |
| card\_type  | 结算银行卡账户类型 0：对公，1：对私，2：对私非法人；| VARCHAR(10) | Yes | 0 | No |
| card\_name  | 结算银行卡持卡人姓名| VARCHAR(500) | Yes |  | No |
| card\_no  | 结算银行卡卡号| VARCHAR(100) | Yes |  | No |
| prov\_id  | 结算卡银行所在省| VARCHAR(12) | Yes |  | No |
| area\_id  | 结算卡银行所在市| VARCHAR(12) | Yes |  | No |
| bank\_code  | 结算卡银行号，对公必填| VARCHAR(12) | No |  | No |
| branch\_name  | 结算卡支行名称，对公时必填| VARCHAR(100) | No |  | No |
| cert\_no  | 结算卡持卡人身份证号，对私必填| VARCHAR(32) | No |  | No |
| cert\_validity\_type  | 结算卡持卡人身份证有效期类型 1:长期有效 0:非长期有效；| INT | No | 0 | No |
| cert\_begin\_date  | 结算卡持卡人证件有效期（起始） 日期格式：yyyyMMdd| VARCHAR(8) | Yes |  | No |
| cert\_end\_date  | 结算卡持卡人证件有效期（截止） 日期格式：yyyyMMdd;非长期有效时必填| VARCHAR(8) | No |  | No |
| mp  | 结算银行卡绑定手机号| VARCHAR(255) | No |  | No |
| apply\_no  | 申请单号| VARCHAR(30) | No |  | No |
| audit\_state  | 审核状态，状态包括：A-审核中；B-配置成功；C-配置失败| VARCHAR(50) | No |  | No |
| audit\_desc  | 审核结果描述| VARCHAR(200) | No |  | No |
| error\_info  | 错误描述| VARCHAR(500) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_user\_id | user\_id | No |
| idx\_card\_no | card\_no | No |
| idx\_company\_id | company\_id | No |
| idx\_huifu\_id | huifu\_id | No |

<a name="table-bspay_user_ent"></a>
## bspay\_user\_ent

> **企业用户对象**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| req\_seq\_id  | 请求流水号| VARCHAR(64) | No |  | No |
| sys\_id  | 商户的huifu\_id| VARCHAR(255) | Yes |  | No |
| huifu\_id  | 汇付ID| VARCHAR(255) | No |  | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| is\_update  | 是否审核成功后修改 1:是  0:否| INT | Yes | 0 | No |
| reg\_name  | 企业名称| VARCHAR(255) | Yes |  | No |
| license\_code  | 营业执照编号| VARCHAR(32) | Yes |  | No |
| license\_validity\_type  | 营业执照有效期类型 1:长期有效 0:非长期有效；| INT | No | 0 | No |
| license\_begin\_date  | 营业执照有效期起始日期 日期格式：yyyyMMdd| VARCHAR(8) | Yes |  | No |
| license\_end\_date  | 营业执照有效期结束日期 日期格式：yyyyMMdd;非长期有效时必填| VARCHAR(8) | No |  | No |
| reg\_prov\_id  | 注册地址(省)| VARCHAR(12) | No |  | No |
| reg\_area\_id  | 注册地址(市)| VARCHAR(12) | Yes |  | No |
| reg\_district\_id  | 注册地址(区)| VARCHAR(12) | Yes |  | No |
| reg\_detail  | 注册地址(详细信息)| VARCHAR(300) | Yes |  | No |
| legal\_name  | 法人姓名| VARCHAR(500) | Yes |  | No |
| legal\_cert\_no  | 法人身份证号码| VARCHAR(255) | Yes |  | No |
| legal\_cert\_validity\_type  | 法人身份证有效期类型 1:长期有效 0:非长期有效；| INT | No | 0 | No |
| legal\_cert\_begin\_date  | 法人身份证有效期开始日期| VARCHAR(8) | Yes |  | No |
| legal\_cert\_end\_date  | 法人身份证有效期截止日期 日期格式：yyyyMMdd;非长期有效时必填| VARCHAR(8) | No |  | No |
| contact\_name  | 联系人姓名| VARCHAR(500) | Yes |  | No |
| contact\_mobile  | 联系人手机| VARCHAR(255) | Yes |  | No |
| ent\_type  | 公司类型 1:政府机构 2:国营企业 3:私营企业 4:外资企业 5:个体工商户 6:其它组织 7:事业单位 8:集体经济| INT | Yes | 1 | No |
| audit\_state  | 审核状态，状态包括：A-待审核；B-审核失败；C-开户失败；D-开户成功但未创建结算账户；E-开户和创建结算账户成功| VARCHAR(50) | No |  | No |
| audit\_desc  | 审核结果描述| VARCHAR(200) | No |  | No |
| error\_info  | 错误描述| VARCHAR(500) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_req\_seq\_id | req\_seq\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_sys\_id | sys\_id | No |
| idx\_huifu\_id | huifu\_id | No |
| idx\_audit\_state | audit\_state | No |

<a name="table-bspay_user_indv"></a>
## bspay\_user\_indv

> **个人用户**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| req\_seq\_id  | 请求流水号| VARCHAR(64) | No |  | No |
| sys\_id  | 商户的huifu\_id| VARCHAR(255) | No |  | No |
| huifu\_id  | 汇付ID| VARCHAR(255) | No |  | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| is\_update  | 是否审核成功后修改 1:是  0:否| INT | Yes | 0 | No |
| name  | 个人姓名| VARCHAR(500) | Yes |  | No |
| cert\_no  | 个人身份证号码| VARCHAR(255) | Yes |  | No |
| cert\_validity\_type  | 个人身份证有效期类型 1:长期有效 0:非长期有效；| INT | No | 0 | No |
| cert\_begin\_date  | 个人身份证有效期开始日期| VARCHAR(8) | Yes |  | No |
| cert\_end\_date  | 个人身份证有效期截止日期 日期格式：yyyyMMdd;非长期有效时必填| VARCHAR(8) | No |  | No |
| mobile\_no  | 手机号| VARCHAR(255) | Yes |  | No |
| audit\_state  | 审核状态，状态包括：A-待审核；B-审核失败；C-开户失败；D-开户成功但未创建结算账户；E-开户和创建结算账户成功| VARCHAR(50) | No | A | No |
| audit\_desc  | 审核结果描述| VARCHAR(500) | No |  | No |
| error\_info  | 错误描述| VARCHAR(500) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_sys\_id | sys\_id | No |
| idx\_huifu\_id | huifu\_id | No |
| idx\_audit\_state | audit\_state | No |

<a name="table-bspay_user_update_log"></a>
## bspay\_user\_update\_log

> **用户进件修改log(审核成功后修改)**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| sys\_id  | sys\_id| VARCHAR(100) | Yes |  | No |
| huifu\_id  | 汇付ID| VARCHAR(255) | No |  | No |
| user\_type  | 进件类型| VARCHAR(20) | Yes | indv | No |
| user\_id  | 用户表的主键id| VARCHAR(255) | Yes | NULL | No |
| data  | 修改数据 json| LONGTEXT | Yes | NULL | No |
| audit\_state  | 审核状态，状态包括：A-待审核；B-审核失败；C-开户失败；D-开户成功但未创建结算账户；E-开户和创建结算账户成功| VARCHAR(50) | No | A | No |
| audit\_desc  | 审核结果描述| VARCHAR(500) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_sys\_id | sys\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_huifu\_id | huifu\_id | No |

<a name="table-business_rep_user"></a>
## business\_rep\_user

> **业务员关联会员**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| relation\_id  | 关系ID（自增主键）| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| business\_rep\_id  | 业务员ID（外键，关联到业务员表）| VARCHAR(255) | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| assigned\_date  | 指定日期（即业务员开始服务该用户的日期）| DATE | Yes | NULL | No |
| description  | 关系描述（可选，用于记录特殊说明）| LONGTEXT | No | NULL | No |
| create\_time  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | relation\_id | Yes |
| idx\_user\_id | user\_id | No |
| user\_bussiness\_id | user\_id, business\_rep\_id | Yes |

<a name="table-business_representative"></a>
## business\_representative

> **业务员**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| business\_rep\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | | BIGINT | Yes | NULL | No |
| name  | | VARCHAR(100) | Yes | NULL | No |
| gender  | | VARCHAR(6) | No | NULL | No |
| age  | | INT | No | NULL | No |
| hire\_date  | | DATE | Yes | NULL | No |
| department\_id  | | INT | No | NULL | No |
| job\_title  | | VARCHAR(50) | Yes | NULL | No |
| sales\_performance  | | NUMERIC(10, 2) | Yes | 0.00 | No |
| customer\_relations\_score  | | NUMERIC(5, 2) | Yes | 0.00 | No |
| is\_active  | | TINYINT(1) | Yes | 1 | No |
| create\_time  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | business\_rep\_id | Yes |
| idx\_user\_id | user\_id | No |
| user\_bussiness\_id | user\_id, business\_rep\_id | Yes |

<a name="table-card_package"></a>
## card\_package

> **卡券包**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| package\_id  | 卡券包ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| title  | 标题| VARCHAR(10) | Yes |  | No |
| package\_describe  | 描述| VARCHAR(20) | Yes |  | No |
| limit\_count  | 卡券包限领次数| INT | Yes | NULL | No |
| get\_num  | 被领取数量| INT | Yes | 0 | No |
| row\_status  | 行数据是否有效| INT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | package\_id | Yes |

<a name="table-card_package_items"></a>
## card\_package\_items

> **卡券包关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| package\_id  | 卡券包ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| card\_id  | 优惠券卡ID| BIGINT | Yes | NULL | No |
| give\_num  | 发送数量| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_companyid | company\_id | No |
| idx\_packageid | package\_id | No |

<a name="table-card_package_receive"></a>
## card\_package\_receive

> **卡券包领取记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| receive\_id  | 主键ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| package\_id  | 卡券包ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| receive\_type  | 领取类型，vip\_grade/grade/template vip等级/等级/卡券模版| VARCHAR(20) | Yes | NULL | No |
| receive\_status  | 1/2/3 领取中/领取成功/领取失败| INT | Yes | NULL | No |
| front\_show  | 前端弹框是否展示过| INT | Yes | NULL | No |
| receive\_time  | 领取时间| INT | Yes | NULL | No |
| success\_count  | 成功领取卡券数量| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | receive\_id | Yes |
| idx\_companyid | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_front\_show | front\_show | No |

<a name="table-card_package_receive_details"></a>
## card\_package\_receive\_details

> **卡券包领取记录详情表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| receive\_id  | 用户领取表主键ID| BIGINT | Yes | NULL | No |
| package\_id  | 卡券包ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| card\_id  | 卡券ID| BIGINT | Yes | NULL | No |
| message  | 领取描述| VARCHAR(100) | Yes | NULL | No |
| receive\_status  | 1/2/3 领取中/领取成功/领取失败| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_companyid | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_receive\_id | receive\_id | No |

<a name="table-card_package_receive_record"></a>
## card\_package\_receive\_record

> **等级卡券包领取记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| grade\_id  | 等级id| BIGINT | Yes | NULL | No |
| trigger\_type  | 领取类型，vip\_grade/grade vip等级/等级| VARCHAR(20) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_companyid | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-card_package_trigger"></a>
## card\_package\_trigger

> **卡券包触发关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| package\_id  | 卡券包ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| trigger\_type  | 触发类型| VARCHAR(15) | Yes | NULL | No |
| association\_id  | 关联ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_companyid | company\_id | No |
| idx\_type | trigger\_type | No |

<a name="table-chinaumspay_division"></a>
## chinaumspay\_division

> **银联商务支付分账流水**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| total\_fee  | 订单金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| actual\_fee  | 订单实际金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| commission\_rate\_fee  | 收单手续费金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| division\_fee  | 分账金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |

<a name="table-chinaumspay_division_detail"></a>
## chinaumspay\_division\_detail

> **银联商务支付分账流水明细**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| division\_id  | 分账流水ID| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| total\_fee  | 订单金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| actual\_fee  | 订单实际金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| commission\_rate  | 收单手续费费率| DOUBLE PRECISION | Yes | NULL | No |
| commission\_rate\_fee  | 收单手续费金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| division\_fee  | 分账金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |
| idx\_division\_id | division\_id | No |

<a name="table-chinaumspay_division_error_log"></a>
## chinaumspay\_division\_error\_log

> **银联商务支付分账错误日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| division\_id  | 分账流水ID| BIGINT | Yes | NULL | No |
| upload\_detail\_id  | 上传明细ID| BIGINT | Yes | NULL | No |
| type  | 类型 division:分账;transfer:划付;| VARCHAR(50) | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| status  | 错误状态 0:未处理、1:处理中、2:成功、3:部分成功、4:失败| VARCHAR(20) | No | NULL | No |
| error\_desc  | 错误描述| LONGTEXT | No | NULL | No |
| is\_resubmit  | 是否重新提交| TINYINT(1) | No |  | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |
| idx\_division\_id | division\_id | No |
| idx\_type | type | No |

<a name="table-chinaumspay_division_upload_detail"></a>
## chinaumspay\_division\_upload\_detail

> **银联商务支付sftp上传明细**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| division\_id  | 分账流水ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| file\_type  | 文件类型 division:分账;transfer:划付;| VARCHAR(50) | Yes | NULL | No |
| detail  | 分账明细| VARCHAR(255) | Yes | NULL | No |
| times  | 上传次数| INT UNSIGNED | Yes | 0 | No |
| backsucc\_fee  | 回盘成功金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| rate\_fee  | 银联商务该笔指令收取的业务处理费，以分为单位| INT UNSIGNED | Yes | 0 | No |
| back\_status  | 回盘状态 0:未处理、1:处理中、2:成功、3:部分成功、4:失败| VARCHAR(255) | No | NULL | No |
| back\_status\_msg  | 回盘状态描述| VARCHAR(255) | No | NULL | No |
| chinaumspay\_id  | 银商内部ID| VARCHAR(255) | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |
| idx\_division\_id | division\_id | No |
| idx\_distributor\_id | distributor\_id | No |

<a name="table-chinaumspay_division_upload_log"></a>
## chinaumspay\_division\_upload\_log

> **银联商务支付上传文件日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| file\_type  | 文件类型 division:分账;transfer:划付;| VARCHAR(50) | Yes | NULL | No |
| local\_file\_path  | 本地文件路径| VARCHAR(50) | Yes | NULL | No |
| remote\_file\_path  | 远程文件路径| VARCHAR(50) | Yes | NULL | No |
| file\_name  | 文件名| VARCHAR(50) | Yes | NULL | No |
| file\_content  | 文件内容| LONGTEXT | Yes | NULL | No |
| back\_status  | 回盘状态 0:未回盘;1:已回盘;| VARCHAR(255) | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |

<a name="table-community_activity"></a>
## community\_activity

> **社区拼团活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | 活动id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示该活动为平台活动| INT | Yes | 0 | No |
| chief\_id  | 团长ID| BIGINT | Yes | NULL | No |
| activity\_name  | 活动名称| VARCHAR(255) | Yes | NULL | No |
| activity\_pics  | 活动图片| LONGTEXT | Yes | NULL | No |
| activity\_desc  | 活动简介| VARCHAR(255) | Yes | NULL | No |
| activity\_intro  | 活动详细介绍| LONGTEXT | Yes | NULL | No |
| start\_time  | 开始时间| INT | Yes | NULL | No |
| end\_time  | 结束时间| INT | Yes | NULL | No |
| activity\_status  | 活动状态 private私有 public公开 protected隐藏 success确认成团 fail成团失败| VARCHAR(255) | Yes | NULL | No |
| delivery\_status  | 发货状态。可选值有 DONE—已发货;PENDING—待发货;SUCCESS-已收货| VARCHAR(255) | Yes | PENDING | No |
| delivery\_time  | 发货时间| INT | No | NULL | No |
| aftersales\_setting  | 售后配置 ban禁止售后| VARCHAR(255) | Yes | ban | No |
| created\_at  | | INT | Yes | NULL | No |
| updated\_at  | | INT | No | NULL | No |
| share\_image\_url  | 分享图片| LONGTEXT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_chief\_id | chief\_id | No |
| ix\_activity\_name | activity\_name | No |
| ix\_start\_time | start\_time | No |
| ix\_end\_time | end\_time | No |
| ix\_activity\_status | activity\_status | No |

<a name="table-community_activity_item"></a>
## community\_activity\_item

> **社区拼团活动商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| goods\_id  | 商品spu ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品sku ID| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| item\_spec\_desc  | 商品规格描述| VARCHAR(255) | No | NULL | No |
| item\_brief  | 商品描述| VARCHAR(255) | No | NULL | No |
| item\_pics  | 商品图片| LONGTEXT | No | NULL | No |
| price  | 销售价,单位为‘分’| INT | Yes | NULL | No |
| cost\_price  | 成本价,单位为‘分’| INT | No | 0 | No |
| market\_price  | 原价,单位为‘分’| INT | Yes | NULL | No |
| store  | 库存数量| INT | Yes | NULL | No |
| created\_at  | | INT | Yes | NULL | No |
| updated\_at  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_activity\_id | activity\_id | No |
| ix\_item\_id | item\_id | No |

<a name="table-community_activity_ziti"></a>
## community\_activity\_ziti

> **社区拼团活动自提表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| ziti\_id  | 自提ID| BIGINT | Yes | NULL | No |
| condition\_num  | 成团数量| INT | Yes | NULL | No |
| remark  | 备注| VARCHAR(255) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_activity\_id | activity\_id | No |
| ix\_ziti\_id | ziti\_id | No |

<a name="table-community_cart"></a>
## community\_cart

> **社区团购购物车**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| cart\_id  | 购物车ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| chief\_id  | 团长id| BIGINT | Yes | NULL | No |
| activity\_id  | 活动id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| num  | 商品数量| BIGINT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | cart\_id | Yes |

<a name="table-community_chief"></a>
## community\_chief

> **社区拼团团长表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| chief\_id  | 团长id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| chief\_name  | 团长名称| VARCHAR(255) | Yes | NULL | No |
| chief\_avatar  | 团长头像| VARCHAR(255) | Yes | NULL | No |
| chief\_mobile  | 团长手机号| VARCHAR(255) | Yes | NULL | No |
| chief\_desc  | 团长简介| VARCHAR(255) | Yes | NULL | No |
| chief\_intro  | 团长详细介绍| LONGTEXT | No | NULL | No |
| province  | 省| VARCHAR(255) | No | NULL | No |
| city  | 市| VARCHAR(255) | No | NULL | No |
| area  | 区| VARCHAR(255) | No | NULL | No |
| regions\_id  | 地区编号集合| JSON | No | NULL | No |
| regions  | 地区名称集合| JSON | No | NULL | No |
| address  | 具体地址| VARCHAR(500) | No | NULL | No |
| lng  | 地图纬度| VARCHAR(255) | No | NULL | No |
| lat  | 地图经度| VARCHAR(255) | No | NULL | No |
| user\_id  | 会员ID| BIGINT | No | 0 | No |
| created\_at  | | INT | Yes | NULL | No |
| updated\_at  | | INT | No | NULL | No |
| alipay\_name  | 团长提现的支付宝姓名| VARCHAR(255) | No | NULL | No |
| alipay\_account  | 团长提现的支付宝账号| VARCHAR(255) | No | NULL | No |
| bank\_name  | 银行名称| VARCHAR(255) | No | NULL | No |
| bankcard\_no  | 团长提现的银行卡号| VARCHAR(255) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | chief\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_chief\_mobile | chief\_mobile | No |
| ix\_user\_id | user\_id | No |

<a name="table-community_chief_apply_info"></a>
## community\_chief\_apply\_info

> **社区拼团团长申请表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| apply\_id  | 申请id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示平台的团长申请| INT | Yes | 0 | No |
| user\_id  | 会员ID| BIGINT | Yes | NULL | No |
| chief\_name  | 团长名称| VARCHAR(255) | Yes | NULL | No |
| chief\_mobile  | 团长手机号| VARCHAR(255) | Yes | NULL | No |
| extra\_data  | 附加信息| LONGTEXT | Yes | NULL | No |
| approve\_status  | 审批状态 0:未审批 1:同意 2:驳回| INT | Yes | 0 | No |
| refuse\_reason  | 拒绝原因| LONGTEXT | No | NULL | No |
| created\_at  | | INT | Yes | NULL | No |
| updated\_at  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | apply\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_chief\_mobile | chief\_mobile | No |
| ix\_user\_id | user\_id | No |

<a name="table-community_chief_cash_withdrawal"></a>
## community\_chief\_cash\_withdrawal

> **团长提现表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示平台的团长申请| INT | Yes | 0 | No |
| chief\_id  | 团长ID| BIGINT | Yes | NULL | No |
| account\_name  | 提现账号姓名| VARCHAR(255) | No | NULL | No |
| pay\_account  | 提现账号 微信为openid 支付宝为支付宝账号 银行卡为银行卡号| VARCHAR(255) | Yes | NULL | No |
| bank\_name  | 银行名称| VARCHAR(255) | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| money  | 提现金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| status  | 提现状态：apply-&gt;待处理 reject-&gt;拒绝 success-&gt;提现成功 process-&gt;处理中 failed-&gt;提现失败| VARCHAR(255) | Yes | NULL | No |
| remarks  | 备注| VARCHAR(255) | No | NULL | No |
| pay\_type  | 提现支付类型| VARCHAR(255) | Yes | NULL | No |
| wxa\_appid  | 提现的小程序appid| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-community_chief_distributor"></a>
## community\_chief\_distributor

> **社区拼团团长关联店铺表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| chief\_id  | 团长ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| bound\_time  | 绑定时间| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_chief\_id | chief\_id | No |
| ix\_distributor\_id | distributor\_id | No |

<a name="table-community_chief_ziti"></a>
## community\_chief\_ziti

> **社区拼团团长自提点管理表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| ziti\_id  | 自提点id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| chief\_id  | 团长ID| BIGINT | Yes | NULL | No |
| ziti\_name  | 自提点名称| VARCHAR(255) | Yes | NULL | No |
| province  | 省| VARCHAR(255) | No | NULL | No |
| city  | 市| VARCHAR(255) | No | NULL | No |
| area  | 区| VARCHAR(255) | No | NULL | No |
| regions\_id  | 地区编号集合| JSON | No | NULL | No |
| regions  | 地区名称集合| JSON | No | NULL | No |
| address  | 具体地址| VARCHAR(500) | No | NULL | No |
| lng  | 地图纬度| VARCHAR(255) | No | NULL | No |
| lat  | 地图经度| VARCHAR(255) | No | NULL | No |
| ziti\_contact\_user  | 自提点联系人| VARCHAR(255) | No | NULL | No |
| ziti\_contact\_mobile  | 自提点联系电话| VARCHAR(255) | No | NULL | No |
| ziti\_pics  | 自提点图片| VARCHAR(255) | No | NULL | No |
| is\_default  | 是否默认| TINYINT(1) | No |  | No |
| ziti\_status  | 自提点状态 success正常 fail作废| VARCHAR(255) | No | success | No |
| created\_at  | | INT | Yes | NULL | No |
| updated\_at  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | ziti\_id | Yes |
| ix\_chief\_id | chief\_id | No |
| ix\_is\_default | is\_default | No |
| ix\_ziti\_status | ziti\_status | No |

<a name="table-community_items"></a>
## community\_items

> **社区拼团商品池**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| goods\_id  | 商品ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示该商品为商城商品，否则为店铺自有商品| INT | Yes | 0 | No |
| min\_delivery\_num  | 起送量| INT | Yes | 0 | No |
| sort  | 商品排序| INT | Yes | 0 | No |
| created\_at  | | INT | Yes | NULL | No |
| updated\_at  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | goods\_id | Yes |
| ix\_goods\_id | goods\_id | No |

<a name="table-community_order_rel_activity"></a>
## community\_order\_rel\_activity

> **社区团购购物车**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| chief\_id  | 团长id| BIGINT | Yes | NULL | No |
| chief\_name  | 团长名称| VARCHAR(255) | Yes | NULL | No |
| chief\_avatar  | 团长头像| VARCHAR(255) | Yes | NULL | No |
| activity\_id  | 活动id| BIGINT | Yes | NULL | No |
| activity\_name  | 活动名称| VARCHAR(255) | Yes | NULL | No |
| ziti\_name  | 自提点名称| VARCHAR(255) | No | NULL | No |
| ziti\_address  | 具体地址| VARCHAR(500) | No | NULL | No |
| lng  | 地图纬度| VARCHAR(255) | No | NULL | No |
| lat  | 地图经度| VARCHAR(255) | No | NULL | No |
| ziti\_contact\_user  | 自提点联系人| VARCHAR(255) | No | NULL | No |
| ziti\_contact\_mobile  | 自提点联系电话| VARCHAR(255) | No | NULL | No |
| activity\_trade\_no  | 跟团号| INT | No | NULL | No |
| extra\_data  | 附加信息| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| rebate\_ratio  | 佣金比例| VARCHAR(20) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |

<a name="table-company_rel_dada"></a>
## company\_rel\_dada

> **商城关联达达同城配表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| source\_id  | 商户编号| VARCHAR(255) | No | NULL | No |
| enterprise\_name  | 企业全称| VARCHAR(255) | No | NULL | No |
| enterprise\_address  | 企业地址| VARCHAR(255) | No | NULL | No |
| mobile  | 商户手机号| VARCHAR(255) | No | NULL | No |
| city\_name  | 商户城市名称| VARCHAR(255) | No | NULL | No |
| contact\_name  | 联系人姓名| VARCHAR(255) | No | NULL | No |
| contact\_phone  | 联系人电话| VARCHAR(255) | No | NULL | No |
| email  | 邮箱地址| VARCHAR(255) | No | NULL | No |
| freight\_type  | 运费承担方:0:商家承担，1:买家承担| TINYINT(1) | Yes | 0 | No |
| status  | 开通状态:0:未开通过，1:已开通过| TINYINT(1) | Yes | 0 | No |
| is\_open  | 是否开启:0:未开启，1:已开启| TINYINT(1) | Yes | 0 | No |
| created  | 创建时间| INT | No | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-company_rel_delivery"></a>
## company\_rel\_delivery

> **商城关联配送配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| type  | 配送类型【1 商家自配-按整单计算】【2 商家自配-按距离计算】| TINYINT(1) | Yes | NULL | No |
| status  | 状态【1 启用】【0 禁用】| TINYINT(1) | Yes | NULL | No |
| rules  | json存储，运费规则| LONGTEXT | Yes | NULL | No |
| other\_params  | json存储，其他参数| LONGTEXT | Yes | NULL | No |
| created  | 创建时间| INT | No | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-company_rel_kuaizhen"></a>
## company\_rel\_kuaizhen

> **商城关联580快诊配置**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| client\_id  | client\_id 580提供| VARCHAR(255) | Yes | NULL | No |
| client\_secret  | client\_secret 580提供| VARCHAR(255) | Yes | NULL | No |
| online  | 是否上线:0:未开启，1:已开启| TINYINT(1) | Yes | 0 | No |
| is\_open  | 是否开启:0:未开启，1:已开启| TINYINT(1) | Yes | 0 | No |
| kuaizhen\_store\_id  | kuaizhen580门店ID| BIGINT | Yes | 0 | No |
| created  | 创建时间| INT | No | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-company_rel_logistics"></a>
## company\_rel\_logistics

> **商城物流启用表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | INT AUTO_INCREMENT | Yes | NULL | Yes |
| corp\_id  | 物流公司ID| SMALLINT | Yes | NULL | No |
| company\_id  | 公司ID| SMALLINT | Yes | NULL | No |
| corp\_code  | 物流公司代码| VARCHAR(255) | Yes | NULL | No |
| kuaidi\_code  | 快递100代码| VARCHAR(255) | Yes | NULL | No |
| corp\_name  | 物流公司简称| VARCHAR(255) | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| supplier\_id  | 供应商id| BIGINT UNSIGNED | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-company_rel_shansong"></a>
## company\_rel\_shansong

> **商城关联闪送应用配置信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| shop\_id  | 商户ID| VARCHAR(255) | Yes | NULL | No |
| client\_id  | App-key| VARCHAR(255) | Yes | NULL | No |
| app\_secret  | App-密钥| VARCHAR(255) | Yes | NULL | No |
| online  | 是否上线:0:未开启，1:已开启| TINYINT(1) | Yes | 0 | No |
| freight\_type  | 运费承担方:0:商家承担，1:买家承担| TINYINT(1) | Yes | 0 | No |
| is\_open  | 是否开启:0:未开启，1:已开启| TINYINT(1) | Yes | 0 | No |
| created  | 创建时间| INT | No | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-companys"></a>
## companys

> **公司表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 公司id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_name  | 公司名称| VARCHAR(255) | No | NULL | No |
| pc\_domain  | PC域名| VARCHAR(200) | No | NULL | No |
| h5\_domain  | H5域名| VARCHAR(200) | No | NULL | No |
| eid  | | VARCHAR(255) | No | NULL | No |
| passport\_uid  | | VARCHAR(255) | No | NULL | No |
| company\_admin\_operator\_id  | 公司管理员id| BIGINT | Yes | NULL | No |
| industry  | 所属行业| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| expiredAt  | 过期时间| BIGINT | No | NULL | No |
| is\_disabled  | 是否禁用| TINYINT(1) | Yes | 0 | No |
| third\_params  | 第三方特殊字段存储| JSON | No | NULL | No |
| salesman\_limit  | 导购员数量| INT | Yes | 20 | No |
| is\_open\_pc\_template  | 是否开启pc模板 1 开启 2不开启| INT | No | 1 | No |
| is\_open\_domain\_setting  | 是否开启域名配置 1 开启 2不开启| INT | No | 2 | No |
| menu\_type  | 菜单类型。2:&#039;b2c&#039;,3:&#039;platform&#039;,4:&#039;standard&#039;,5:&#039;in\_purchase&#039;| INT | Yes | 3 | No |
| deleted\_at  | | DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id | Yes |
| idx\_pc\_domain | pc\_domain | No |
| idx\_h5\_domain | h5\_domain | No |
| idx\_passportuid | passport\_uid | Yes |

<a name="table-companys_article"></a>
## companys\_article

> **文章表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| article\_id  | 文章id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| title  | 标题| VARCHAR(255) | Yes | NULL | No |
| summary  | 摘要| VARCHAR(255) | No | NULL | No |
| content  | 文章详细内容| LONGTEXT | Yes | NULL | No |
| sort  | 文章排序| INT | No | NULL | No |
| image\_url  | 文章封面| LONGTEXT | No | NULL | No |
| share\_image\_url  | 分享图片| LONGTEXT | No | NULL | No |
| release\_time  | 文章发布时间| INT | No | NULL | No |
| release\_status  | 文章发布状态| TINYINT(1) | Yes | 1 | No |
| author  | 作者| VARCHAR(255) | No | NULL | No |
| operator\_id  | 作者id| BIGINT | No | NULL | No |
| head\_portrait  | 作者头像| LONGTEXT | No | NULL | No |
| distributor\_id  | 分销商id| BIGINT | Yes | 0 | No |
| article\_type  | 文章类型，general:普通文章; bring:带货文章| VARCHAR(255) | No | general | No |
| category\_id  | 文章类目id| BIGINT | No | NULL | No |
| province  | 省| VARCHAR(255) | No | NULL | No |
| city  | 市| VARCHAR(255) | No | NULL | No |
| area  | 区| VARCHAR(255) | No | NULL | No |
| regions\_id  | 地区编号集合| JSON | No | NULL | No |
| regions  | 地区名称集合| JSON | No | NULL | No |
| is\_ai  | 是否AI生成，0表示人工创建，1表示AI生成| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | article\_id | Yes |

<a name="table-companys_article_category"></a>
## companys\_article\_category

> **文章类目表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| category\_id  | 文章类目id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| category\_name  | 类目名称| VARCHAR(50) | Yes | NULL | No |
| parent\_id  | 父级id, 0为顶级| BIGINT | Yes | 0 | No |
| category\_level  | 类目等级| INT | No | 1 | No |
| path  | 路径| VARCHAR(255) | No | 0 | No |
| sort  | 排序| BIGINT | No | 0 | No |
| category\_type  | 文章栏目类型，general:普通; bring:带货| VARCHAR(255) | No | bring | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | category\_id | Yes |

<a name="table-companys_currency_exchange_rate"></a>
## companys\_currency\_exchange\_rate

> **货币汇率**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 公司id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| title  | 货币描述| VARCHAR(255) | No | NULL | No |
| currency  | 货币英文缩写| VARCHAR(255) | No | NULL | No |
| symbol  | 货币符号| VARCHAR(255) | Yes | NULL | No |
| rate  | 货币汇率(与人民币)| DOUBLE PRECISION | Yes | NULL | No |
| is\_default  | 是否默认货币| TINYINT(1) | Yes | 0 | No |
| use\_platform  | 适用端。可选值为 service,normal| VARCHAR(255) | Yes | normal | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-companys_employee_rel_roles"></a>
## companys\_employee\_rel\_roles

> **员工绑定角色表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| role\_id  | 角色id| VARCHAR(32) | Yes | NULL | No |
| operator\_id  | 员工id| VARCHAR(32) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id, role\_id, operator\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-companys_operator_cart"></a>
## companys\_operator\_cart

> **导购员购物车**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| cart\_id  | 购物车ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| operator\_id  | 管理员id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| num  | 商品数量| BIGINT | Yes | 1 | No |
| is\_checked  | 购物车是否选中| TINYINT(1) | Yes | 1 | No |
| special\_type  | 商品特殊类型 drug 处方药 normal 普通商品| VARCHAR(255) | Yes | normal | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | cart\_id | Yes |
| idx\_item\_id | item\_id | No |
| idx\_operator\_id | operator\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-companys_operator_logs"></a>
## companys\_operator\_logs

> **商家操作日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | 0 | No |
| operator\_id  | 操作者id| INT | Yes | 0 | No |
| request\_uri  | 请求资源信息| VARCHAR(255) | No | NULL | No |
| ip  | ip地址| VARCHAR(255) | No | NULL | No |
| params  | 请求参数| JSON | No | NULL | No |
| operator\_name  | 操作内容| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| log\_type  | 操作日志类型| VARCHAR(255) | No | operator | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |

<a name="table-companys_operator_pending_order"></a>
## companys\_operator\_pending\_order

> **导购挂单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| pending\_id  | 挂单ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| operator\_id  | 管理员id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | 0 | No |
| pending\_type  | 挂起类型 cart:收银台 order:订单| VARCHAR(255) | Yes | cart | No |
| pending\_data  | 暂存数据| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | pending\_id | Yes |
| idx\_operator\_id | operator\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-companys_profit"></a>
## companys\_profit

> **分润记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| profit\_user\_id  | 分润类型id| BIGINT | Yes | NULL | No |
| profit\_user\_type  | 1 用户 2 店铺 3 区域经销商 4 总部| BIGINT | Yes | NULL | No |
| total\_fee  | 分润金额，以分为单位| BIGINT | No | NULL | No |
| frozen\_fee  | 冻结金额，以分为单位| BIGINT | No | NULL | No |
| withdrawals\_fee  | 可以提现金额，以分为单位| BIGINT | No | NULL | No |
| cashed\_fee  | 已提现金额，以分为单位| BIGINT | No | NULL | No |
| commissions  | 拉新提成（导购｜门店）| BIGINT | No | NULL | No |
| popularize\_commissions  | 推广提成（导购）| BIGINT | No | NULL | No |
| goods\_amount  | 货款（发货门店｜总部）| BIGINT | No | NULL | No |
| subsidy  | 补贴（经销商）| BIGINT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-companys_profit_log"></a>
## companys\_profit\_log

> **分润记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| profit\_user\_id  | 分润类型id| BIGINT | Yes | NULL | No |
| profit\_user\_type  | 1 导购 2 店铺 3 区域经销商 4 总部| BIGINT | Yes | NULL | No |
| profit\_type  | 1 拉新分润 2 推广提成 3 货款 4 补贴| BIGINT | Yes | NULL | No |
| status  | 资金状态 1 取消退款 2 售后退款 3 提现扣减 11 购物冻结 12 购物可体现| BIGINT | Yes | NULL | No |
| income\_fee  | 增加金额| BIGINT | No | NULL | No |
| outcome\_fee  | 扣减金额| BIGINT | No | NULL | No |
| remark  | 资金状态| VARCHAR(60) | Yes | NULL | No |
| params  | 冗余参数 例如 order\_id| JSON | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-companys_profit_statistics"></a>
## companys\_profit\_statistics

> **分润记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| date  | 分润月份| VARCHAR(20) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| profit\_user\_id  | 分润类型id| BIGINT | Yes | NULL | No |
| profit\_user\_type  | 1 用户 2 店铺 3 区域经销商 4 总部| BIGINT | Yes | NULL | No |
| withdrawals\_fee  | 提现金额，以分为单位| BIGINT | No | 0 | No |
| name  | 提现对象名称| VARCHAR(100) | No |  | No |
| params  | 提现对象名称| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-companys_protocol_update_log"></a>
## companys\_protocol\_update\_log

> **协议更新日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | 日志id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| type  | 协议类型,privacy:隐私政策,member\_register:注册协议| VARCHAR(30) | Yes | NULL | No |
| content  | 协议详细内容| LONGTEXT | No | NULL | No |
| digest  | 摘要| VARCHAR(64) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |

<a name="table-companys_regionauth"></a>
## companys\_regionauth

> **地区权限**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| regionauth\_id  | 地区id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| regionauth\_name  | 地区名称| VARCHAR(50) | No | NULL | No |
| state  | 数据状态(1正常，-1删除)| INT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | regionauth\_id | Yes |
| ix\_regionauth\_id | regionauth\_id | No |
| ix\_company\_id | company\_id | No |

<a name="table-companys_roles"></a>
## companys\_roles

> **员工角色表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| role\_id  | 角色id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id。为0则代表是平台添加的店铺角色| BIGINT | Yes | 0 | No |
| role\_name  | 角色名称| VARCHAR(32) | Yes | NULL | No |
| role\_source  | 角色平台来源,platform: 平台角色，distributor:店铺管理角色| VARCHAR(32) | Yes | platform | No |
| permission  | 权限,json数据| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | role\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-companys_saleman_customer_complaints"></a>
## companys\_saleman\_customer\_complaints

> **导购客诉表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键id| INT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 会员id| INT | Yes | NULL | No |
| company\_id  | | INT | Yes | NULL | No |
| user\_name  | 会员名| VARCHAR(255) | Yes | NULL | No |
| user\_mobile  | 会员手机号| VARCHAR(255) | Yes | NULL | No |
| saleman\_id  | 导购员id| INT | Yes | NULL | No |
| saleman\_name  | 导购员名| VARCHAR(255) | Yes | NULL | No |
| saleman\_avatar  | 导购员企业微信头像| VARCHAR(255) | No | NULL | No |
| saleman\_mobile  | 导购员手机号| VARCHAR(255) | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| saleman\_distribution\_name  | 导购员所在店铺名| VARCHAR(255) | Yes |  | No |
| complaints\_content  | 投诉内容| VARCHAR(255) | Yes | NULL | No |
| complaints\_images  | 投诉图片| LONGTEXT | No | NULL | No |
| reply\_status  | 回复状态:0未回复；1已回复| TINYINT(1) | Yes | 0 | No |
| reply\_content  | 回复内容，json数组，内含操作员id，操作员手机号，操作员名称，回复时间，回复内容| LONGTEXT | No | NULL | No |
| reply\_time  | 回复时间| INT | No | 0 | No |
| reply\_operator\_id  | 回复操作员id| INT | No | 0 | No |
| reply\_operator\_name  | 回复操作员名称| VARCHAR(255) | No |  | No |
| reply\_operator\_mobile  | 回复操作员手机号| VARCHAR(255) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-companys_saleperson_cart"></a>
## companys\_saleperson\_cart

> **导购员购物车**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| cart\_id  | 购物车ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| package\_items  | 关联商品id集合| VARCHAR(255) | Yes |  | No |
| num  | 商品数量| BIGINT | Yes | 1 | No |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| is\_checked  | 购物车是否选中| TINYINT(1) | Yes | 1 | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| special\_type  | 商品特殊类型 drug 处方药 normal 普通商品| VARCHAR(255) | Yes | normal | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | cart\_id | Yes |
| idx\_item\_id | item\_id | No |
| idx\_salesperson\_id | salesperson\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_is\_checked | is\_checked | No |

<a name="table-companys_sales_promotions"></a>
## companys\_sales\_promotions

> **导购促销单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| sales\_promotion\_id  | 促销单ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| unique\_key  | 促销单唯一key| VARCHAR(255) | Yes | NULL | No |
| promotion\_items  | 促销单内容| LONGTEXT | Yes | NULL | No |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | sales\_promotion\_id | Yes |
| idx\_salesperson\_id | salesperson\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_unique\_key | unique\_key | No |

<a name="table-companys_salesperson_statistics"></a>
## companys\_salesperson\_statistics

> **导购员销售额数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 激活id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| add\_date  | 统计日期 Ymd| INT | Yes | NULL | No |
| statistic\_title  | 统计数据描述，order\_pay\_num:订单支付数量,order\_pay\_fee:订单支付金额,order\_pay\_user\_num:订单支付会员数,vip\_user:新增vip会员数,svip\_user:新增svip会员数,add\_user:注册会员数,new\_guest\_divided:拉新提成,sales\_commission:销售提成| VARCHAR(255) | Yes | NULL | No |
| statistic\_type  | 统计类型，normal:实体订单,service:服务订单,member:会员| VARCHAR(255) | Yes | NULL | No |
| data\_value  | 统计数据| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_statistic\_type | statistic\_type | No |
| ix\_statistic\_title | statistic\_title | No |
| ix\_add\_date | add\_date | No |
| idx\_salespersonid\_adddate\_companyid\_statistictitle\_statistictype | salesperson\_id, add\_date, company\_id, statistic\_title, statistic\_type | No |

<a name="table-companys_setting"></a>
## companys\_setting

> **企业设置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| community\_config  | 社区相关设置| LONGTEXT | No | NULL | No |
| withdraw\_bank  | 提现支持银行类型| LONGTEXT | No | NULL | No |
| consumer\_hotline  | 客服电话| VARCHAR(255) | No | NULL | No |
| customer\_switch  | 客服开关| INT | Yes | 0 | No |
| fapiao\_config  | 发票相关设置| LONGTEXT | No | NULL | No |
| fapiao\_switch  | 发票开关| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id | Yes |

<a name="table-companys_statistics"></a>
## companys\_statistics

> **商城数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 激活id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| add\_date  | 统计日期 Ymd| INT | Yes | NULL | No |
| statistic\_title  | 统计数据描述，order\_pay\_num:订单支付数量,order\_pay\_fee:订单支付金额,order\_pay\_user\_num:订单支付会员数,vip\_user:新增vip会员数,svip\_user:新增svip会员数,add\_user:注册会员数| VARCHAR(255) | Yes | NULL | No |
| statistic\_type  | 统计类型，normal:实体订单,service:服务订单,member:会员| VARCHAR(255) | Yes | NULL | No |
| data\_value  | 统计数据| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_add\_date | add\_date | No |
| ix\_statistic\_type | statistic\_type | No |
| ix\_statistic\_title | statistic\_title | No |
| ix\_company\_id | company\_id | No |

<a name="table-companys_store_statistics"></a>
## companys\_store\_statistics

> **商城数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 激活id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| shop\_id  | 店铺id| BIGINT | Yes | NULL | No |
| add\_date  | 统计日期 Ymd| INT | Yes | NULL | No |
| statistic\_title  | 统计数据描述，order\_pay\_num:订单支付数量,order\_pay\_fee:订单支付金额,order\_pay\_user\_num:订单支付会员数,vip\_user:新增vip会员数,svip\_user:新增svip会员数,add\_user:注册会员数| VARCHAR(255) | Yes | NULL | No |
| statistic\_type  | 统计类型，normal:实体订单,service:服务订单,member:会员| VARCHAR(255) | Yes | NULL | No |
| data\_value  | 统计数据| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_statistic\_type | statistic\_type | No |
| ix\_statistic\_title | statistic\_title | No |
| ix\_add\_date | add\_date | No |
| ix\_shop\_id | shop\_id | No |

<a name="table-config_request_fields"></a>
## config\_request\_fields

> **配置信息, 配置传递的请求字段**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键id| INT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| INT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示该配置为平台创建| INT | Yes | 0 | No |
| module\_type  | 模块类型, 【1: 会员注册】【2: 团长申请】| SMALLINT | Yes | NULL | No |
| label  | 该请求字段的标识, 比如是mobile则表示为手机号| VARCHAR(50) | Yes | NULL | No |
| key\_name  | 前后端交互时需要被传递的key名，如果是手机号则是mobile| VARCHAR(50) | Yes | NULL | No |
| is\_open  | 是否启用, 【0 关闭】【1 开启】| TINYINT(1) | Yes | NULL | No |
| is\_required  | 是否必填, 【0 非必填】 【1 必填】| TINYINT(1) | Yes | NULL | No |
| is\_preset  | 是否是预设字段, 【0 非必填】 【1 必填】| TINYINT(1) | Yes | NULL | No |
| is\_edit  | 是否可修改, 【0 不可修改】 【1 可修改】| TINYINT(1) | Yes | NULL | No |
| field\_type  | 当前请求字段的类型, [1 文本] [2 数字] [3 日期] [4 单选项]| SMALLINT | Yes | NULL | No |
| validate\_condition  | 验证条件, json存储| LONGTEXT | Yes | NULL | No |
| alert\_required\_message  | 提示必填时的文案| VARCHAR(255) | Yes | NULL | No |
| alert\_validate\_message  | 提示验证时时的文案| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_module\_open | company\_id, module\_type, is\_open | No |

<a name="table-coupon_give_error_log"></a>
## coupon\_give\_error\_log

> **优惠券赠送失败记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| give\_log\_id  | 优惠券赠送失败记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| give\_id  | 优惠券赠送失败记录id| BIGINT | Yes | NULL | No |
| uid  | 赠送用户id| BIGINT | Yes | NULL | No |
| company\_id  | 商户id| BIGINT | Yes | NULL | No |
| card\_id  | 赠送优惠券id| BIGINT | Yes | NULL | No |
| note  | 失败原因记录| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | give\_log\_id | Yes |
| idx\_companyid | company\_id | No |
| idx\_giveid | give\_id | No |

<a name="table-coupon_give_log"></a>
## coupon\_give\_log

> **优惠券赠送表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| give\_log\_id  | 优惠券赠送失败记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 商户id| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| sender  | 发送者| VARCHAR(255) | Yes | NULL | No |
| number  | 赠送数量| BIGINT | Yes | NULL | No |
| error  | 失败数量| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | give\_log\_id | Yes |

<a name="table-crossborder_identity"></a>
## crossborder\_identity

> **跨境-身份证信息**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 设置id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| identity\_id  | 身份证| VARCHAR(18) | Yes | NULL | No |
| identity\_name  | 身份证姓名| VARCHAR(20) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_id | id | No |
| ix\_company\_id | company\_id | No |
| ix\_user\_id | user\_id | No |

<a name="table-crossborder_origincountry"></a>
## crossborder\_origincountry

> **跨境-产地国表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| origincountry\_id  | 产地国id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| state  | 数据状态(1正常，-1删除)| INT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| origincountry\_name  | 产地国名称| VARCHAR(255) | No | NULL | No |
| origincountry\_img\_url  | 产地国国旗| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | origincountry\_id | Yes |
| ix\_origincountry\_id | origincountry\_id | No |
| ix\_company\_id | company\_id | No |

<a name="table-crossborder_set"></a>
## crossborder\_set

> **跨境-设置**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 设置id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| tax\_rate  | 税率| VARCHAR(10) | Yes | NULL | No |
| quota\_tip  | 额度提醒| TEXT | No | NULL | No |
| logistics  | 跨境物流| VARCHAR(10) | Yes | NULL | No |
| crossborder\_show  | 跨境显示,0不显示，1显示| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_id | id | No |
| ix\_company\_id | company\_id | No |

<a name="table-crossborder_taxstrategy"></a>
## crossborder\_taxstrategy

> **跨境-税费策略**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 设置id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| taxstrategy\_name  | 规则名称| VARCHAR(255) | No | NULL | No |
| taxstrategy\_content  | 策略内容| LONGTEXT | No | NULL | No |
| state  | 数据状态(1正常，-1删除)| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_id | id | No |
| ix\_company\_id | company\_id | No |

<a name="table-custom_declare_order_result"></a>
## custom\_declare\_order\_result

> **订单附加信息提交信息接口请求结果表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| trade\_id  | 交易单号| VARCHAR(64) | Yes | NULL | No |
| state  | 状态码| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| transaction\_id  | 微信支付返回的订单号| VARCHAR(28) | Yes | NULL | No |
| sub\_order\_no  | 子订单号| VARCHAR(64) | No | NULL | No |
| sub\_order\_id  | 微信子订单号| VARCHAR(64) | No | NULL | No |
| modify\_time  | 最后更新时间| VARCHAR(14) | Yes | NULL | No |
| cert\_check\_result  | 订购人和支付人身份信息校验结果| VARCHAR(256) | Yes | NULL | No |
| verify\_department  | 验证机构| VARCHAR(16) | Yes | NULL | No |
| verify\_department\_trade\_id  | 验核机构交易流水号| VARCHAR(64) | Yes | NULL | No |
| create\_time  | 请求时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |

<a name="table-customs_data"></a>
## customs\_data

> **接收海关支付数据请求表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| session\_id  | 海关发起请求时，平台接收的会话ID| VARCHAR(255) | Yes | NULL | No |
| service\_time  | 调用时的系统时间| BIGINT | Yes | NULL | No |
| status  | 是否上报 0否 1是| TINYINT(1) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |

<a name="table-datacube_company_data"></a>
## datacube\_company\_data

> **商城数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| count\_date  | 日期| DATE | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| member\_count  | 新增会员数| INT | Yes | 0 | No |
| aftersales\_count  | 新增售后单数| INT | Yes | 0 | No |
| refunded\_count  | 新增退款额| INT | Yes | 0 | No |
| amount\_payed\_count  | 新增交易额| BIGINT | Yes | 0 | No |
| order\_count  | 新增订单数| INT | Yes | 0 | No |
| order\_payed\_count  | 新增已付款订单数| INT | Yes | 0 | No |
| gmv\_count  | 新增gmv| BIGINT | Yes | 0 | No |
| order\_class  | 订单种类,可选值有 employee\_purchase:内购订单| VARCHAR(255) | No | NULL | No |
| act\_id  | 活动ID| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_date\_company\_act | count\_date, company\_id, act\_id | Yes |

<a name="table-datacube_distributor_data"></a>
## datacube\_distributor\_data

> **商城门店数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| count\_date  | 日期| DATE | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 经销商ID| BIGINT | Yes | NULL | No |
| member\_count  | 新增会员数| INT | Yes | 0 | No |
| aftersales\_count  | 新增售后单数| INT | Yes | 0 | No |
| refunded\_count  | 新增退款额| INT | Yes | 0 | No |
| amount\_payed\_count  | 新增交易额| BIGINT | Yes | 0 | No |
| amount\_point\_payed\_count  | 新增交易额(积分)| BIGINT | Yes | 0 | No |
| order\_count  | 新增订单数| INT | Yes | 0 | No |
| order\_point\_count  | 新增订单数(积分)| INT | Yes | 0 | No |
| order\_payed\_count  | 新增已付款订单数| INT | Yes | 0 | No |
| order\_point\_payed\_count  | 新增已付款订单数(积分)| INT | Yes | 0 | No |
| gmv\_count  | 新增gmv| BIGINT | Yes | 0 | No |
| gmv\_point\_count  | 新增gmv(积分)| BIGINT | Yes | 0 | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_date\_distributor | count\_date, company\_id, distributor\_id | Yes |

<a name="table-datacube_goods_data"></a>
## datacube\_goods\_data

> **商品数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| count\_date  | 日期| DATE | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| sales\_count  | 新增销量| INT | Yes | 0 | No |
| fixed\_amount\_count  | 新增成交额(优惠前)| BIGINT | Yes | 0 | No |
| settle\_amount\_count  | 新增成交额(实付价)| BIGINT | Yes | 0 | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| order\_class  | 订单种类,可选值有 employee\_purchase:内购订单| VARCHAR(255) | No | NULL | No |
| act\_id  | 活动ID| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_date\_goods\_act | count\_date, company\_id, item\_id, act\_id | Yes |

<a name="table-datacube_merchant_data"></a>
## datacube\_merchant\_data

> **商户数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| count\_date  | 日期| DATE | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| member\_count  | 新增会员数| INT | Yes | 0 | No |
| aftersales\_count  | 新增售后单数| INT | Yes | 0 | No |
| refunded\_count  | 新增退款额| INT | Yes | 0 | No |
| amount\_payed\_count  | 新增交易额| BIGINT | Yes | 0 | No |
| amount\_point\_payed\_count  | 新增交易额(积分)| BIGINT | Yes | 0 | No |
| order\_count  | 新增订单数| INT | Yes | 0 | No |
| order\_point\_count  | 新增订单数(积分)| INT | Yes | 0 | No |
| order\_payed\_count  | 新增已付款订单数| INT | Yes | 0 | No |
| order\_point\_payed\_count  | 新增已付款订单数(积分)| INT | Yes | 0 | No |
| gmv\_count  | 新增gmv| BIGINT | Yes | 0 | No |
| gmv\_point\_count  | 新增gmv(积分)| BIGINT | Yes | 0 | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_date\_company | count\_date, company\_id, merchant\_id | Yes |

<a name="table-datacube_monitors"></a>
## datacube\_monitors

> **小程序页面监控**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| monitor\_id  | 监控id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| wxappid  | 小程序appid| VARCHAR(255) | Yes | NULL | No |
| nick\_name  | 小程序名称| VARCHAR(255) | Yes | NULL | No |
| page\_name  | 页面描述| VARCHAR(255) | Yes | NULL | No |
| monitor\_path  | 监控页面| VARCHAR(255) | Yes | NULL | No |
| monitor\_path\_params  | 监控页面的参数| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | monitor\_id | Yes |

<a name="table-datacube_relsources"></a>
## datacube\_relsources

> **小程序页面与来源关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| monitor\_id  | 监控id| BIGINT | Yes | NULL | No |
| source\_id  | 来源id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | monitor\_id, source\_id | Yes |

<a name="table-datacube_statistics"></a>
## datacube\_statistics

> **小程序页面与来源关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| monitor\_id  | 监控id| BIGINT | Yes | NULL | No |
| source\_id  | 来源id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| view\_num  | 浏览人数| BIGINT | Yes | 0 | No |
| entries\_num  | 参与人数| BIGINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | monitor\_id, source\_id | Yes |

<a name="table-deposit_recharge_agreement"></a>
## deposit\_recharge\_agreement

> **充值协议表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 企业ID| VARCHAR(255) | Yes | NULL | No |
| content  | 协议内容| LONGTEXT | Yes | NULL | No |
| create\_time  | 创建时间| VARCHAR(255) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id | Yes |

<a name="table-deposit_recharge_rule"></a>
## deposit\_recharge\_rule

> **储值规则，充值固定金额送钱或送礼品**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| INT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业ID| VARCHAR(255) | Yes | NULL | No |
| money  | 充值固定金额| VARCHAR(255) | Yes | NULL | No |
| rule\_type  | 充值规则类型| VARCHAR(255) | Yes | NULL | No |
| rule\_data  | 充值规则数据| VARCHAR(255) | Yes | NULL | No |
| create\_time  | 创建时间| VARCHAR(255) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-deposit_trade"></a>
## deposit\_trade

> **预存款交易记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| deposit\_trade\_id  | 储值流水号| VARCHAR(64) | Yes | NULL | No |
| company\_id  | 企业ID| VARCHAR(255) | Yes | NULL | No |
| member\_card\_code  | 充值会员卡号| VARCHAR(255) | Yes | NULL | No |
| shop\_id  | 门店ID| VARCHAR(255) | No | NULL | No |
| shop\_name  | 门店名称| VARCHAR(255) | No | NULL | No |
| user\_id  | 购买用户| VARCHAR(255) | Yes | NULL | No |
| mobile  | 购买用户手机号| VARCHAR(255) | Yes | NULL | No |
| open\_id  | 用户open\_id| VARCHAR(255) | No | NULL | No |
| money  | 充值金额/消费金额。 单位是分| VARCHAR(255) | Yes | NULL | No |
| trade\_type  | 交易类型充值或消费。consume:消费，recharge:充值| VARCHAR(16) | Yes | NULL | No |
| trade\_status  | 交易状态| VARCHAR(16) | Yes | NULL | No |
| transaction\_id  | 充值支付订单号| VARCHAR(255) | No | NULL | No |
| recharge\_rule\_id  | 充值满足活动规则ID| VARCHAR(255) | No | NULL | No |
| bank\_type  | 付款银行| VARCHAR(255) | No | NULL | No |
| authorizer\_appid  | 公众号的appid| VARCHAR(64) | No | NULL | No |
| pay\_type  | 充值支付方式| VARCHAR(64) | No | NULL | No |
| wxa\_appid  | 支付小程序的appid| VARCHAR(64) | No | NULL | No |
| detail  | 交易详情| VARCHAR(255) | Yes | NULL | No |
| time\_start  | 交易起始时间| VARCHAR(255) | Yes | NULL | No |
| time\_expire  | 交易结束时间| VARCHAR(255) | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(16) | Yes | CNY | No |
| cur\_fee\_type  | 系统配置货币类型| VARCHAR(5) | Yes | CNY | No |
| cur\_fee\_rate  | 系统配置货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| cur\_fee\_symbol  | 系统配置货币符号| VARCHAR(255) | Yes | ￥ | No |
| cur\_pay\_fee  | 系统货币支付金额| VARCHAR(255) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | deposit\_trade\_id | Yes |

<a name="table-distribution_basic_config"></a>
## distribution\_basic\_config

> **分销商基础配置**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | | BIGINT | Yes | NULL | No |
| is\_buy  | 是否可购买| TINYINT(1) | Yes | NULL | No |
| limit\_rebate  | 提现佣金限制，最少多少金额可提现| VARCHAR(255) | Yes | NULL | No |
| limit\_time  | 订单完成后多少天可提现| VARCHAR(255) | Yes | NULL | No |
| return\_name  | 退换货接收人| VARCHAR(255) | Yes | NULL | No |
| return\_address  | 退换货地址| VARCHAR(255) | Yes | NULL | No |
| return\_phone  | 退换货联系方式| VARCHAR(255) | Yes | NULL | No |
| is\_income\_tax  | 是否开启劳务所得税| VARCHAR(255) | Yes | NULL | No |
| income\_tax\_params  | 劳务所得税计算参数| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id | Yes |

<a name="table-distribution_cash_withdrawal"></a>
## distribution\_cash\_withdrawal

> **分销商佣金提现记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| VARCHAR(255) | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| distributor\_name  | 分销商真实姓名| VARCHAR(255) | Yes | NULL | No |
| open\_id  | 分销商open\_id| VARCHAR(255) | Yes | NULL | No |
| user\_id  | 会员ID| VARCHAR(255) | Yes | NULL | No |
| distributor\_mobile  | | VARCHAR(32) | Yes | NULL | No |
| money  | 提现金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| status  | 提现状态| VARCHAR(255) | Yes | NULL | No |
| remarks  | 备注| VARCHAR(255) | No | NULL | No |
| wxa\_appid  | 提现的小程序appid| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-distribution_distribute_logs"></a>
## distribution\_distribute\_logs

> **分销商佣金记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| distributor\_id  | 分销商id| BIGINT | Yes | NULL | No |
| distributor\_mobile  | | VARCHAR(32) | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| mobile  | 分销商手机号| VARCHAR(32) | No | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| pic  | 商品图片| VARCHAR(255) | No | NULL | No |
| num  | 购买商品数量| INT UNSIGNED | Yes | NULL | No |
| rebate  | 单个分销金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| total\_rebate  | 总分销金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| is\_close  | 是否已结算| TINYINT(1) | Yes |  | No |
| plan\_close\_time  | 计划结算时间| INT | Yes | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| rebatelog\_idx | order\_id, distributor\_id, item\_id | Yes |

<a name="table-distribution_distributor"></a>
## distribution\_distributor

> **店铺表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| distributor\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| is\_distributor  | 是否是主店铺| TINYINT(1) | Yes | 1 | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| mobile  | 店铺手机号| VARCHAR(255) | Yes | NULL | No |
| address  | 店铺地址| VARCHAR(255) | No | NULL | No |
| house\_number  | 详细地址，门牌号| VARCHAR(255) | No | NULL | No |
| name  | 店铺名称| VARCHAR(255) | Yes | NULL | No |
| auto\_sync\_goods  | 自动同步总部商品| TINYINT(1) | Yes |  | No |
| logo  | 店铺logo| VARCHAR(255) | No | NULL | No |
| contract\_phone  | 其他联系方式| VARCHAR(20) | Yes | 0 | No |
| banner  | 店铺banner| VARCHAR(255) | No | NULL | No |
| contact  | 联系人名称| VARCHAR(500) | No | NULL | No |
| is\_valid  | 店铺是否有效| VARCHAR(255) | Yes | true | No |
| lng  | 腾讯地图纬度| VARCHAR(255) | No | NULL | No |
| lat  | 腾讯地图经度| VARCHAR(255) | No | NULL | No |
| province  | | VARCHAR(255) | No | NULL | No |
| city  | | VARCHAR(255) | No | NULL | No |
| hour  | 营业时间| VARCHAR(150) | No | NULL | No |
| area  | | VARCHAR(255) | No | NULL | No |
| regions\_id  | 国家行政区划编码组合，逗号隔开| LONGTEXT | No | NULL | No |
| is\_domestic  | 是否是中国国内门店 1:国内(包含港澳台),2:非国内| SMALLINT | No | 1 | No |
| is\_direct\_store  | 是否为直营店 1:直营店,2:非直营店| SMALLINT | No | 1 | No |
| child\_count  | | INT | No | NULL | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| is\_default  | 门店id| INT | No | 0 | No |
| is\_audit\_goods  | 是否审核店铺商品| TINYINT(1) | No |  | No |
| is\_ziti  | 是否支持自提| TINYINT(1) | No |  | No |
| is\_delivery  | 是否支持配送| TINYINT(1) | No | 1 | No |
| is\_self\_delivery  | 是否支持自配送| TINYINT(1) | No |  | No |
| is\_open\_salesman  | 是否开启业务员| TINYINT(1) | No |  | No |
| regions  | 地区名称组合。json格式| LONGTEXT | No | NULL | No |
| review\_status  | 入驻审核状态，0未审核，1已审核| TINYINT(1) | No |  | No |
| source\_from  | 店铺来源，1管理端添加，2小程序申请入驻，3外部开放接口添加| INT | No | 1 | No |
| dealer\_id  | 经销商ID| INT | No | 0 | No |
| split\_ledger\_info  | 分账信息| VARCHAR(255) | No | NULL | No |
| bspay\_split\_ledger\_info  | 斗拱分账信息| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| shop\_code  | 店铺号| VARCHAR(255) | No | NULL | No |
| distributor\_self  | 是否是总店配置| INT | No | 0 | No |
| wechat\_work\_department\_id  | 企业微信的部门ID| INT | No | 0 | No |
| regionauth\_id  | 区域id| BIGINT | Yes | 0 | No |
| is\_open  | 是否开启分账| VARCHAR(255) | Yes | false | No |
| rate  | 平台服务费率| INT UNSIGNED | No | NULL | No |
| is\_dada  | 是否开启同城配（不仅限于达达）,0:未开启,1:已开启| TINYINT(1) | Yes | 0 | No |
| business  | 业务类型(食品小吃-1,饮料-2,鲜花绿植-3,文印票务-8,便利店-9,水果生鲜-13,同城电商-19, 医药-20,蛋糕-21,酒品-24,小商品市场-25,服装-26,汽修零配-27,数码家电-28,小龙虾-29,个人-50,火锅-51,个护美妆-53、母婴-55,家居家纺-57,手机-59,家装-61,其他-5)| SMALLINT | No | NULL | No |
| dada\_shop\_create  | 该门店在达达是否已创建,0:未创建,1:已创建| TINYINT(1) | Yes | 0 | No |
| shansong\_shop\_create  | 该门店在闪送是否已创建,0:未创建,1:已创建| TINYINT(1) | Yes | 0 | No |
| shansong\_store\_id  | 闪送店铺ID| BIGINT | No | NULL | No |
| introduce  | 店铺介绍| LONGTEXT | No | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| distribution\_type  | 店铺类型:0:自营,1:加盟| SMALLINT | Yes | 0 | No |
| is\_require\_subdistrict  | 下单是否需要选择街道社区| TINYINT(1) | No |  | No |
| is\_require\_building  | 下单是否需要填写楼栋门牌号| TINYINT(1) | No |  | No |
| delivery\_distance  | 配送距离| INT | Yes | 0 | No |
| offline\_aftersales  | 本店订单到店售后| INT | Yes | 0 | No |
| offline\_aftersales\_self  | 退货到本店退货点| INT | Yes | 0 | No |
| offline\_aftersales\_distributor\_id  | 本店订单到其他店铺售后| VARCHAR(255) | No | NULL | No |
| offline\_aftersales\_other  | 其他店铺订单到本店售后| INT | Yes | 0 | No |
| freight\_time  | 自配送预计需要的时间（小时）| INT | No | 2 | No |
| is\_refund\_freight  | 退款退货可退运费 1是 0否| INT | No | 0 | No |
| wdt\_shop\_no  | 旺店通门店编号| VARCHAR(30) | No | NULL | No |
| wdt\_shop\_id  | 旺店通门店ID| BIGINT | Yes | 0 | No |
| kuaizhen\_store\_id  | kuaizhen580门店ID| BIGINT | Yes | 0 | No |
| open\_divided  | 是否开启店铺隔离| BIGINT | Yes | 0 | No |
| jst\_shop\_id  | 聚水潭店铺编号| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | distributor\_id | Yes |
| ix\_is\_distributor | is\_distributor | No |
| ix\_shop\_id | shop\_id | No |
| ix\_company\_id\_shop\_code | company\_id, shop\_code | No |
| ix\_is\_ziti | is\_ziti | No |
| idx\_merchant\_id | merchant\_id | No |

<a name="table-distribution_distributor_geofence"></a>
## distribution\_distributor\_geofence

> **店铺围栏信息**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| config\_service\_local\_id  | 地图配置的本地主键ID| BIGINT | Yes | NULL | No |
| geofence\_id  | 第三方服务的围栏ID| BIGINT | Yes | NULL | No |
| geofence\_data  | json数据，第三方服务的围栏信息| LONGTEXT | Yes | NULL | No |
| status  | 状态【1 启用】【0 禁用】| SMALLINT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_distributor\_service | company\_id, distributor\_id, config\_service\_local\_id, status | No |

<a name="table-distribution_distributor_items"></a>
## distribution\_distributor\_items

> **店铺导购员表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| distributor\_id  | | BIGINT | Yes | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| default\_item\_id  | 默认商品ID| BIGINT | Yes | 0 | No |
| goods\_id  | 商品集合ID| BIGINT | Yes | 0 | No |
| is\_show  | 是否为列表默认展示| TINYINT(1) | Yes | 1 | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| store  | 商品库存| BIGINT | No | 0 | No |
| price  | 商品价格| BIGINT | No | 0 | No |
| is\_total\_store  | 是否为总部库存| TINYINT(1) | No | 1 | No |
| is\_can\_sale  | 是否在本店可售| TINYINT(1) | No | 1 | No |
| goods\_can\_sale  | 商品是否可售，有一个sku可售，那么商品就可售| TINYINT(1) | No | 1 | No |
| is\_self\_delivery  | 是否开启自提配送| TINYINT(1) | No |  | No |
| is\_express\_delivery  | 是否开启快递配送| TINYINT(1) | No |  | No |
| sales  | 商品销量| BIGINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_defaultitemid\_companyid | default\_item\_id, company\_id | No |
| idx\_companyid\_istotalstore\_goodscansale\_defaultitemid | company\_id, is\_total\_store, goods\_can\_sale, default\_item\_id | No |
| distributor\_items | distributor\_id, item\_id | Yes |

<a name="table-distribution_distributor_sales_count"></a>
## distribution\_distributor\_sales\_count

> **店铺销量表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| order\_item\_count  | 已经关闭售后的订单的商品数量| BIGINT | Yes | 0 | No |
| aftersales\_item\_count  | 已经关闭售后的订单的商品数量| BIGINT | Yes | 0 | No |
| year\_month\_time  | 统计的年月时间| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id\_distributor\_id\_time | company\_id, distributor\_id, year\_month\_time | No |

<a name="table-distribution_distributor_salesman"></a>
## distribution\_distributor\_salesman

> **店铺导购员表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| salesman\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| distributor\_id  | 上线店铺ID| BIGINT | Yes | NULL | No |
| company\_id  | 企业ID| BIGINT | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(32) | Yes | NULL | No |
| salesman\_name  | 姓名| VARCHAR(32) | Yes | NULL | No |
| child\_count  | 导购注册人员数量| INT | No | 0 | No |
| user\_id  | | VARCHAR(255) | No | NULL | No |
| is\_valid  | 是否有效| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | salesman\_id | Yes |

<a name="table-distribution_distributor_salesman_role"></a>
## distribution\_distributor\_salesman\_role

> **店铺权限表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| salesman\_role\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业ID| INT | Yes | NULL | No |
| role\_name  | 导购员角色名称| VARCHAR(32) | Yes | NULL | No |
| rule\_ids  | 导购员角色类型| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | salesman\_role\_id | Yes |

<a name="table-distribution_distributor_user"></a>
## distribution\_distributor\_user

> **会员对应的导购员信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| distributor\_id  | 店铺id| BIGINT | No | 0 | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| user\_id  | | BIGINT | Yes | NULL | No |
| salesman\_id  | 导购员ID| BIGINT | No | 0 | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| family  | 分销商名称| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_distributor\_id | distributor\_id | No |

<a name="table-distribution_distributor_white_list"></a>
## distribution\_distributor\_white\_list

> **店铺表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| distributor\_id  | 店铺id| BIGINT | Yes | 1 | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| mobile  | 店铺手机号| VARCHAR(50) | Yes | NULL | No |
| username  | 名称| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_distributor\_id | distributor\_id | No |
| ix\_mobile | mobile | No |

<a name="table-distribution_pickup_location"></a>
## distribution\_pickup\_location

> **店铺自提点**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 所属店铺id| BIGINT | Yes | NULL | No |
| rel\_distributor\_id  | 绑定店铺id| BIGINT | Yes | 0 | No |
| name  | 自提点名称| VARCHAR(255) | Yes | NULL | No |
| lng  | 纬度| VARCHAR(255) | No | NULL | No |
| lat  | 经度| VARCHAR(255) | No | NULL | No |
| province  | 省| VARCHAR(255) | No | NULL | No |
| city  | 市| VARCHAR(255) | No | NULL | No |
| area  | 区| VARCHAR(255) | No | NULL | No |
| address  | 地址| VARCHAR(255) | No | NULL | No |
| contract\_phone  | 联系电话| VARCHAR(20) | Yes | NULL | No |
| hours  | 营业时间| VARCHAR(255) | No | NULL | No |
| workdays  | 工作日：周一至周日-&gt;1-7，逗号分隔| VARCHAR(255) | No | , | No |
| wait\_pickup\_days  | 最长预约时间，天| VARCHAR(255) | No | 0 | No |
| latest\_pickup\_time  | 当前最晚提货时间| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_distributor\_id | distributor\_id | No |

<a name="table-distribution_shopScreen_advertisement"></a>
## distribution\_shopScreen\_advertisement

> **广告表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 广告id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| title  | 标题| VARCHAR(255) | Yes | NULL | No |
| thumb\_img  | 缩略图| LONGTEXT | Yes | NULL | No |
| sort  | 排序| INT | No | NULL | No |
| media\_url  | (图片/视频)地址| LONGTEXT | Yes | NULL | No |
| media\_type  | 类型| VARCHAR(255) | Yes | image | No |
| release\_time  | 发布时间| INT | No | NULL | No |
| release\_status  | 发布状态| TINYINT(1) | Yes |  | No |
| operator\_id  | 作者id| BIGINT | No | NULL | No |
| distributor\_id  | 分销商id| BIGINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-distribution_shopScreen_slider"></a>
## distribution\_shopScreen\_slider

> ****

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| slide\_id  | 轮播id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT | Yes | 0 | No |
| title  | 标题| VARCHAR(255) | Yes | NULL | No |
| sub\_title  | 副标题| VARCHAR(255) | Yes | NULL | No |
| style\_params  | 风格参数| LONGTEXT | Yes | NULL | No |
| desc\_status  | 图片描述状态11| TINYINT(1) | Yes |  | No |
| image\_list  | 轮播图列表| LONGTEXT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | slide\_id | Yes |

<a name="table-distributor_aftersales_address"></a>
## distributor\_aftersales\_address

> **店铺售后地址**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| address\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| province  | 省| VARCHAR(255) | Yes | NULL | No |
| city  | 市| VARCHAR(255) | Yes | NULL | No |
| area  | 区/县| VARCHAR(255) | Yes | NULL | No |
| regions\_id  | | LONGTEXT | Yes | NULL | No |
| regions  | | LONGTEXT | Yes | NULL | No |
| address  | 地址| VARCHAR(255) | Yes | NULL | No |
| lng  | 纬度| VARCHAR(255) | No | NULL | No |
| lat  | 经度| VARCHAR(255) | No | NULL | No |
| contact  | 联系人| VARCHAR(500) | No | NULL | No |
| mobile  | 联系人手机号| VARCHAR(255) | Yes | NULL | No |
| post\_code  | 邮政编码| INT | No | NULL | No |
| is\_default  | 默认地址, 1:是。2:不是| INT | Yes | 2 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| name  | 退货点名称| VARCHAR(255) | No | NULL | No |
| hours  | 营业时间| VARCHAR(50) | No | NULL | No |
| return\_type  | 退货方式：logistics寄回 offline到店退| VARCHAR(20) | Yes | logistics | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | address\_id | Yes |

<a name="table-distributor_rel_tags"></a>
## distributor\_rel\_tags

> **店铺关联标签表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id, company\_id, distributor\_id | Yes |

<a name="table-distributor_tags"></a>
## distributor\_tags

> **店铺标签库表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| tag\_name  | 标签名称| VARCHAR(50) | Yes | NULL | No |
| tag\_color  | 标签颜色| VARCHAR(50) | Yes | NULL | No |
| font\_color  | 字体颜色| VARCHAR(50) | Yes | NULL | No |
| description  | 标签描述| VARCHAR(255) | No | NULL | No |
| tag\_icon  | 标签icon| LONGTEXT | No | NULL | No |
| front\_show  | 前台是否显示 0 否 1 是| SMALLINT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id | Yes |

<a name="table-distributor_wechat_rel"></a>
## distributor\_wechat\_rel

> **店务端微信关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 微信用户关联表自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| app\_id  | 微信app\_id| VARCHAR(255) | No |  | No |
| app\_type  | 类型：wx[公众号],wxa[小程序]| VARCHAR(255) | Yes | wx | No |
| openid  | 微信openid| VARCHAR(255) | No |  | No |
| unionid  | 微信unionid| VARCHAR(255) | Yes |  | No |
| operator\_id  | 系统账户id| BIGINT | No | 0 | No |
| bound\_time  | 绑定时间| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_operator\_id | operator\_id | No |
| ix\_company\_operator | company\_id, app\_type, operator\_id | Yes |
| ix\_company\_wx\_user | company\_id, app\_id, openid | Yes |

<a name="table-distributor_work_wechat_rel"></a>
## distributor\_work\_wechat\_rel

> **店务端企业微信关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 企业微信用户关联表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| work\_userid  | 微信id| VARCHAR(255) | No |  | No |
| operator\_id  | 系统账户id| BIGINT | No | 0 | No |
| bound\_time  | 绑定时间| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_operator\_id | operator\_id | No |
| idx\_work\_userid | work\_userid | No |
| ix\_operator\_company | operator\_id, company\_id | Yes |
| ix\_workuser\_company | work\_userid, company\_id | Yes |

<a name="table-employee_purchase_activities"></a>
## employee\_purchase\_activities

> **员工内购活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 活动id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示商城的企业| INT | Yes | 0 | No |
| operator\_id  | 操作id| INT | Yes | 0 | No |
| name  | 活动名称| VARCHAR(50) | Yes | NULL | No |
| title  | 活动标题| VARCHAR(50) | Yes | NULL | No |
| pages\_template\_id  | 活动首页模版id| BIGINT | Yes | NULL | No |
| pic  | 活动图片| VARCHAR(255) | Yes | NULL | No |
| share\_pic  | 活动分享图片| VARCHAR(255) | Yes | NULL | No |
| enterprise\_id  | 参与企业ID| LONGTEXT | Yes | NULL | No |
| display\_time  | 活动展示(预热)时间| INT | Yes | NULL | No |
| employee\_begin\_time  | 员工开始购买时间| INT | Yes | NULL | No |
| employee\_end\_time  | 员工结束购买时间| INT | Yes | NULL | No |
| employee\_limitfee  | 员工额度，以分为单位| INT UNSIGNED | Yes | NULL | No |
| if\_relative\_join  | 亲友是否参与| TINYINT(1) | Yes |  | No |
| invite\_limit  | 员工邀请亲友上限| INT | No | 0 | No |
| relative\_begin\_time  | 亲友开始购买时间| INT | No | NULL | No |
| relative\_end\_time  | 亲友结束购买时间| INT | No | NULL | No |
| if\_share\_limitfee  | 亲友是否共享员工额度| TINYINT(1) | No |  | No |
| relative\_limitfee  | 家属额度，以分为单位| INT UNSIGNED | No | 0 | No |
| minimum\_amount  | 起定金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| close\_modify\_hours\_after\_activity  | 活动后数小时关闭修改| INT | Yes | 0 | No |
| status  | 状态 active:有效的 cancel:取消 pending:暂停 over:结束| VARCHAR(255) | Yes | active | No |
| if\_share\_store  | 是否共享库存| TINYINT(1) | Yes |  | No |
| price\_display\_config  | 价格展示配置| JSON | No | NULL | No |
| is\_discount\_description\_enabled  | 优惠说明开关| TINYINT(1) | Yes |  | No |
| discount\_description  | 优惠说明| VARCHAR(50) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |

<a name="table-employee_purchase_activity_enterprises"></a>
## employee\_purchase\_activity\_enterprises

> **活动参与企业表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| enterprise\_id  | 企业ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id, enterprise\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_activity\_id | activity\_id | No |
| idx\_enterprise\_id | enterprise\_id | No |

<a name="table-employee_purchase_activity_goods"></a>
## employee\_purchase\_activity\_goods

> **员工内购商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| goods\_id  | 商品ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id, goods\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_activity\_id | activity\_id | No |
| idx\_goods\_id | goods\_id | No |

<a name="table-employee_purchase_activity_items"></a>
## employee\_purchase\_activity\_items

> **员工内购商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| goods\_id  | 商品ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| activity\_price  | 活动价,单位为‘分’| INT | Yes | NULL | No |
| activity\_store  | 活动库存数量| INT | Yes | NULL | No |
| limit\_fee  | 每人限额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| limit\_num  | 每人限购数量| INT | Yes | 0 | No |
| sort  | 排序| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id, item\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_activity\_id | activity\_id | No |
| idx\_item\_id | item\_id | No |

<a name="table-employee_purchase_cart"></a>
## employee\_purchase\_cart

> **员工内购活动购物车**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| cart\_id  | 购物车ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| enterprise\_id  | 企业id| BIGINT | Yes | NULL | No |
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户ID| BIGINT | Yes | NULL | No |
| shop\_type  | 店铺类型；distributor:店铺，shop:门店，community:社区, mall:商城, drug 药品清单| VARCHAR(255) | No | distributor | No |
| shop\_id  | 店铺id 或者 社区id| BIGINT UNSIGNED | No | 0 | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| num  | 商品数量| BIGINT | Yes | 1 | No |
| is\_checked  | 购物车是否选中| TINYINT(1) | Yes | 1 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | cart\_id | Yes |
| idx\_enterprise\_activity\_item\_id | enterprise\_id, activity\_id, item\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-employee_purchase_employees"></a>
## employee\_purchase\_employees

> **企业员工表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示为商城的员工| INT | Yes | 0 | No |
| operator\_id  | 操作id| INT | Yes | 0 | No |
| name  | 姓名| VARCHAR(500) | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| account  | 登录账号| VARCHAR(500) | No | NULL | No |
| email  | 邮箱| VARCHAR(500) | No | NULL | No |
| auth\_code  | 校验码| VARCHAR(50) | No | NULL | No |
| enterprise\_id  | 企业id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | No | NULL | No |
| member\_mobile  | 会员手机号| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| disabled  | 失效| TINYINT(1) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_mobile | mobile | No |
| idx\_enterprise\_userid | enterprise\_id, user\_id | No |

<a name="table-employee_purchase_enterprise_email_box"></a>
## employee\_purchase\_enterprise\_email\_box

> **企业发件邮箱**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| enterprise\_id  | 企业白名单id| BIGINT | Yes | NULL | No |
| smtp\_port  | 端口号| VARCHAR(10) | Yes | NULL | No |
| relay\_host  | 服务器主机地址| VARCHAR(50) | Yes | NULL | No |
| user  | 服务器用户名| VARCHAR(50) | Yes | NULL | No |
| password  | 服务器密码| VARCHAR(50) | Yes | NULL | No |
| suffix  | 员工收件邮箱后缀| VARCHAR(50) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_enterprise\_id | enterprise\_id | No |

<a name="table-employee_purchase_enterprises"></a>
## employee\_purchase\_enterprises

> **企业表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示商城的企业| INT | Yes | 0 | No |
| operator\_id  | 操作id| INT | Yes | 0 | No |
| name  | 企业名称| VARCHAR(255) | Yes | NULL | No |
| enterprise\_sn  | 企业编码| VARCHAR(50) | Yes | NULL | No |
| logo  | 企业logo| LONGTEXT | No | NULL | No |
| qr\_code\_bg\_image  | 二维码背景图| LONGTEXT | No | NULL | No |
| is\_employee\_check\_enabled  | 是否验证员工白名单| TINYINT(1) | Yes |  | No |
| auth\_type  | 登录类型,mobile:手机号,account:账号,email:邮箱,qr\_code:二维码| VARCHAR(20) | Yes | NULL | No |
| disabled  | 禁用| TINYINT(1) | Yes | 0 | No |
| sort  | 排序| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_enterprise\_sn | enterprise\_sn | No |

<a name="table-employee_purchase_member_activity_aggregate"></a>
## employee\_purchase\_member\_activity\_aggregate

> **内购活动会员累计使用额度**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 活动id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| enterprise\_id  | 企业id| BIGINT | Yes | NULL | No |
| user\_id  | 会员ID| BIGINT | Yes | NULL | No |
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| aggregate\_fee  | 累计使用额度，以分为单位| INT UNSIGNED | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-employee_purchase_member_activity_items_aggregate"></a>
## employee\_purchase\_member\_activity\_items\_aggregate

> **内购活动商品会员累计使用额度**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 活动id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| enterprise\_id  | 企业id| BIGINT | Yes | NULL | No |
| user\_id  | 会员ID| BIGINT | Yes | NULL | No |
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| aggregate\_fee  | 累计使用额度，以分为单位| INT UNSIGNED | Yes | NULL | No |
| aggregate\_num  | 累计购买数量| INT UNSIGNED | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-employee_purchase_orders_rel_activity"></a>
## employee\_purchase\_orders\_rel\_activity

> **内购订单关联活动企业表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 购物车ID| BIGINT | Yes | NULL | No |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| enterprise\_id  | 企业id| BIGINT | Yes | NULL | No |
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户ID| BIGINT | Yes | NULL | No |
| if\_share\_store  | 是否共享库存| TINYINT(1) | Yes |  | No |
| close\_modify\_time  | 订单关闭修改时间| INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |
| idx\_enterprise\_id | enterprise\_id | No |
| idx\_activity\_id | activity\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-employee_purchase_relatives"></a>
## employee\_purchase\_relatives

> **企业员工家属表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id,为0时表示为商城的员工| INT | Yes | 0 | No |
| enterprise\_id  | 企业id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| member\_mobile  | 会员手机号| VARCHAR(255) | Yes | NULL | No |
| activity\_id  | 活动ID| BIGINT | Yes | NULL | No |
| employee\_id  | 员工id| BIGINT | Yes | NULL | No |
| employee\_user\_id  | 员工关联用户id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| disabled  | 失效| TINYINT(1) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| employee\_user\_id | employee\_user\_id | No |
| activity\_id | activity\_id | No |
| user\_id | user\_id | No |
| idx\_member\_mobile | member\_mobile | No |
| idx\_enterprise\_userid\_actid | enterprise\_id, user\_id, activity\_id | No |

<a name="table-espier_address"></a>
## espier\_address

> **地区表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 地区id| BIGINT | Yes | NULL | No |
| parent\_id  | 父级id| BIGINT | Yes | NULL | No |
| label  | 地区名称| VARCHAR(255) | Yes | NULL | No |
| path  | 路径| VARCHAR(255) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id, parent\_id | Yes |
| ix\_parent\_id | parent\_id | No |
| ix\_label | label | No |

<a name="table-espier_export_log"></a>
## espier\_export\_log

> **导出日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | 导出日志id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| file\_name  | 导出文件名称| VARCHAR(255) | No | NULL | No |
| file\_url  | 导出文件下载路径| LONGTEXT | No | NULL | No |
| export\_type  | 导出类型  member:会员导出,order:订单导出,right:权益导出| VARCHAR(255) | Yes | NULL | No |
| handle\_status  | 处理文件状态，可选值有，wait:等待处理,finish:处理完成,processing:处理中,fail:失败| VARCHAR(255) | Yes | NULL | No |
| error\_msg  | 失败原因| LONGTEXT | No | NULL | No |
| finish\_time  | 处理完成时间| BIGINT | No | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| operator\_id  | 账号id| BIGINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| supplier\_id  | 供应商id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |

<a name="table-espier_printer"></a>
## espier\_printer

> **打印机表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 公司id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| name  | 打印机名称| VARCHAR(255) | Yes | NULL | No |
| type  | 打印机类型 yilianyun 易连云| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| distributor\_id  | 关联店铺| VARCHAR(255) | Yes | NULL | No |
| app\_terminal  | 打印机终端号| VARCHAR(255) | Yes | NULL | No |
| app\_key  | 打印机秘钥| VARCHAR(255) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-espier_subdistrict"></a>
## espier\_subdistrict

> **街道社区表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| label  | 地区名称| VARCHAR(255) | Yes | NULL | No |
| parent\_id  | 父级id| BIGINT | Yes | NULL | No |
| distributor\_id  | 所属店铺id列表| VARCHAR(255) | Yes | , | No |
| province  | | VARCHAR(255) | No | NULL | No |
| city  | | VARCHAR(255) | No | NULL | No |
| area  | | VARCHAR(255) | No | NULL | No |
| regions\_id  | 国家行政区划编码组合，逗号隔开| LONGTEXT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_parent\_id | parent\_id | No |
| ix\_label | label | No |

<a name="table-espier_uploadefile"></a>
## espier\_uploadefile

> **上传文件日志ID**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 上传文件日志ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| operator\_id  | 操作者id| BIGINT | No | 0 | No |
| supplier\_id  | 供应商id| BIGINT | Yes | 0 | No |
| file\_name  | 上传文件名称| VARCHAR(255) | Yes | NULL | No |
| file\_type  | 上传文件类型| VARCHAR(255) | Yes | NULL | No |
| file\_size  | 上传文件大小| VARCHAR(255) | Yes | NULL | No |
| handle\_status  | 处理文件状态，可选值有，wait:等待处理| VARCHAR(255) | Yes | NULL | No |
| handle\_line\_num  | 处理文件行数| VARCHAR(255) | Yes | NULL | No |
| finish\_time  | 处理完成时间| BIGINT | No | NULL | No |
| handle\_message  | 处理错误文件| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| distributor\_id  | distributor\_id| BIGINT | No | 0 | No |
| left\_job\_num  | 剩余子任务数| INT | Yes | 0 | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-espier_uploadimages"></a>
## espier\_uploadimages

> **图片上传表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| image\_id  | 图片id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| storage  | 存储引擎，可选值有，image/videos| VARCHAR(50) | Yes | image | No |
| image\_name  | 图片名称| VARCHAR(255) | Yes | NULL | No |
| brief  | 图片简介| VARCHAR(255) | No |  | No |
| image\_cat\_id  | 图片分类id| BIGINT | Yes | 0 | No |
| image\_type  | 图片类型,可选值有 item:商品;aftersales:售后| VARCHAR(50) | No | item | No |
| image\_full\_url  | 图片完成地址| VARCHAR(255) | No | NULL | No |
| image\_url  | 图片标识, 不包含域名| VARCHAR(255) | Yes | NULL | No |
| disabled  | 图片失效| TINYINT(1) | Yes | 0 | No |
| distributor\_id  | 店铺id| BIGINT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| supplier\_id  | 供应商id| BIGINT | Yes | 0 | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | image\_id | Yes |

<a name="table-espier_uploadimages_cat"></a>
## espier\_uploadimages\_cat

> **图片分类表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| image\_cat\_id  | 图片分类id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| image\_cat\_name  | 图片分类名称| VARCHAR(255) | Yes | NULL | No |
| parent\_id  | 父分类id,顶级为0| BIGINT | Yes | 0 | No |
| image\_type  | 图片类型,可选值有 item:商品;| VARCHAR(255) | No | NULL | No |
| path  | 路径| VARCHAR(255) | Yes | NULL | No |
| sort  | 排序| BIGINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| supplier\_id  | 供应商id| BIGINT | Yes | 0 | No |
| distributor\_id  | 店铺id| BIGINT | No | 0 | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | image\_cat\_id | Yes |

<a name="table-goods_items_rel_cats"></a>
## goods\_items\_rel\_cats

> **商品和分类关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| category\_id  | 商品分类id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id, category\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_category\_id | category\_id | No |
| ix\_created | created | No |

<a name="table-hfpay_bank_card"></a>
## hfpay\_bank\_card

> **汇付取现银行卡表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_bank\_card\_id  | 汇付取现银行卡表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT | No | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| user\_cust\_id  | 用户客户号| VARCHAR(255) | No | NULL | No |
| card\_type  | 绑卡类型| VARCHAR(255) | No | NULL | No |
| bank\_id  | 银行代号| VARCHAR(255) | No | NULL | No |
| bank\_name  | 银行名称| VARCHAR(255) | No | NULL | No |
| card\_num  | 银行卡号| VARCHAR(255) | No | NULL | No |
| bind\_card\_id  | 汇付绑定id| VARCHAR(255) | No | NULL | No |
| is\_cash  | 是否取现卡| VARCHAR(255) | No | 1 | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_bank\_card\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-hfpay_cash_record"></a>
## hfpay\_cash\_record

> **汇付取现记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_cash\_record\_id  | 汇付取现记录表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT | No | 0 | No |
| order\_id  | 订单号| VARCHAR(255) | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | 0 | No |
| operator\_id  | 操作人ID| BIGINT | No | 0 | No |
| user\_cust\_id  | 汇付商户客户号| VARCHAR(255) | No | NULL | No |
| trans\_amt  | 取现金额| INT | Yes | NULL | No |
| cash\_type  | 取现方式 T0：T0取现; T1：T1取现 D1：D1取现| VARCHAR(255) | Yes | NULL | No |
| bind\_card\_id  | 取现绑卡| VARCHAR(255) | No | NULL | No |
| real\_trans\_amt  | 实际到账金额| INT | No | NULL | No |
| fee\_amt  | 取现手续费| INT | No | NULL | No |
| cash\_status  | 取现状态 0 未提交 1已提交 2取现成功 3取现失败| INT | Yes | 0 | No |
| resp\_code  | 汇付接口返回码| VARCHAR(255) | No | NULL | No |
| resp\_desc  | 汇付接口返回码描述| VARCHAR(255) | No | NULL | No |
| hf\_order\_id  | 汇付接口请求order\_id| VARCHAR(255) | No | NULL | No |
| hf\_order\_date  | 汇付接口请求order\_date| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_cash\_record\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-hfpay_company_statistics_day"></a>
## hfpay\_company\_statistics\_day

> **平台分账数据统计**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_company\_day\_id  | 汇付平台分账数据统计| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | company\_id| INT | Yes | NULL | No |
| type  | type 1全部数据 2平台数据 3非平台数据| INT | Yes | NULL | No |
| date  | 日期| INT | Yes | NULL | No |
| income  | 总计收入| INT | No | NULL | No |
| disburse  | 总计支出| INT | No | NULL | No |
| withdrawal  | 总计提现| INT | No | NULL | No |
| balance  | 余额| INT | No | NULL | No |
| withdrawal\_balance  | 可提现余额| INT | No | NULL | No |
| unsettled\_funds  | 未结算资金| INT | No | NULL | No |
| refund  | 合计退款| INT | No | NULL | No |
| settlement\_funds  | 已结算资金| INT | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_company\_day\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-hfpay_distributor_statistics_day"></a>
## hfpay\_distributor\_statistics\_day

> **店铺分账数据统计**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hf\_distributor\_day\_id  | 汇付店铺分账数据统计| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | company\_id| INT | Yes | NULL | No |
| distributor\_id  | 店铺id| INT | Yes | NULL | No |
| date  | 日期| INT | Yes | NULL | No |
| income  | 总计收入| INT | No | NULL | No |
| disburse  | 总计支出| INT | No | NULL | No |
| withdrawal  | 总计提现| INT | No | NULL | No |
| balance  | 余额| INT | No | NULL | No |
| withdrawal\_balance  | 可提现余额| INT | No | NULL | No |
| unsettled\_funds  | 未结算资金| INT | No | NULL | No |
| refund  | 合计退款| INT | No | NULL | No |
| settlement\_funds  | 已结算资金| INT | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hf\_distributor\_day\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-hfpay_distributor_transaction_statistics"></a>
## hfpay\_distributor\_transaction\_statistics

> **店铺交易统计统计**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 店铺交易统计统计| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | company\_id| INT | Yes | NULL | No |
| distributor\_id  | 店铺id| INT | Yes | NULL | No |
| date  | 日期| INT | Yes | NULL | No |
| order\_count  | 交易总笔数| INT | Yes | 0 | No |
| order\_total\_fee  | 总计交易金额| INT | Yes | 0 | No |
| order\_refund\_count  | 已退款总笔数| INT | Yes | 0 | No |
| order\_refund\_total\_fee  | 退款总金额| INT | Yes | 0 | No |
| order\_refunding\_count  | 在退总笔数| INT | Yes | 0 | No |
| order\_refunding\_total\_fee  | 在退总金额| INT | Yes | 0 | No |
| order\_profit\_sharing\_charge  | 已结算手续费| INT | Yes | 0 | No |
| order\_total\_charge  | 总手续费| INT | Yes | 0 | No |
| order\_refund\_total\_charge  | 总退款手续费| INT | Yes | 0 | No |
| order\_un\_profit\_sharing\_total\_charge  | 未结算手续费（包含已退款）| INT | Yes | 0 | No |
| order\_un\_profit\_sharing\_refund\_total\_charge  | 未结算已退款手续费| INT | Yes | 0 | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id\_distributor\_id | company\_id, distributor\_id | No |

<a name="table-hfpay_enterapply"></a>
## hfpay\_enterapply

> **入驻信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_enterapply\_id  | 入驻信息表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT | No | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| user\_cust\_id  | 汇付客户号| VARCHAR(255) | No | NULL | No |
| acct\_id  | 汇付子账户| VARCHAR(255) | No | NULL | No |
| apply\_type  | 入驻类型| VARCHAR(1) | No | NULL | No |
| corp\_license\_type  | 企业证照类型| VARCHAR(1) | No | NULL | No |
| corp\_name  | 企业名称| VARCHAR(100) | No | NULL | No |
| business\_code  | 营业执照注册号| VARCHAR(100) | No | NULL | No |
| institution\_code  | 组织机构代码| VARCHAR(100) | No | NULL | No |
| tax\_code  | 税务登记证号| VARCHAR(100) | No | NULL | No |
| social\_credit\_code  | 统一社会信用代码| VARCHAR(100) | No | NULL | No |
| license\_start\_date  | 证照起始日期| VARCHAR(30) | No | NULL | No |
| license\_end\_date  | 证照结束日期| VARCHAR(30) | No | NULL | No |
| controlling\_shareholder  | 实际控股人| VARCHAR(255) | No | NULL | No |
| legal\_name  | 法人姓名| VARCHAR(60) | No | NULL | No |
| legal\_id\_card\_type  | 法人证件类型| VARCHAR(2) | No | NULL | No |
| legal\_id\_card  | 法人证件号码| VARCHAR(30) | No | NULL | No |
| legal\_cert\_start\_date  | 法人证件起始日期| VARCHAR(60) | No | NULL | No |
| legal\_cert\_end\_date  | 法人证件结束日期| VARCHAR(60) | No | NULL | No |
| legal\_mobile  | 法人手机号码| VARCHAR(20) | No | NULL | No |
| contact\_name  | 企业联系人姓名| VARCHAR(30) | No | NULL | No |
| contact\_mobile  | 企业联系人手机号| VARCHAR(20) | No | NULL | No |
| contact\_email  | 联系人邮箱| VARCHAR(30) | No | NULL | No |
| bank\_acct\_name  | 开户银行账户名| VARCHAR(30) | No | NULL | No |
| bank\_id  | 开户银行| VARCHAR(30) | No | NULL | No |
| bank\_name  | 开户银行名称| VARCHAR(30) | No | NULL | No |
| bank\_acct\_num  | 开户银行账号| VARCHAR(30) | No | NULL | No |
| bank\_acct\_num\_imgz  | 银行卡正面照| VARCHAR(255) | No | NULL | No |
| bank\_acct\_num\_imgz\_local  | 本地银行卡正面照| VARCHAR(255) | No | NULL | No |
| bank\_acct\_num\_imgf  | 法人银行卡反面照| VARCHAR(255) | No | NULL | No |
| bank\_acct\_num\_imgf\_local  | 本地银行卡反面照| VARCHAR(255) | No | NULL | No |
| bank\_prov  | 开户银行省份| VARCHAR(30) | No | NULL | No |
| bank\_prov\_name  | 开户银行省份名称| VARCHAR(30) | No | NULL | No |
| bank\_area  | 开户银行地区| VARCHAR(30) | No | NULL | No |
| bank\_area\_name  | 开户银行地区名称| VARCHAR(30) | No | NULL | No |
| bank\_branch  | 企业开户银行的支行名称| VARCHAR(30) | No | NULL | No |
| solo\_name  | 个体户名称| VARCHAR(30) | No | NULL | No |
| solo\_business\_address  | 个体户经营地址| VARCHAR(150) | No | NULL | No |
| solo\_reg\_address  | 个体户注册地址| VARCHAR(150) | No | NULL | No |
| solo\_fixed\_telephone  | 个体户固定电话| VARCHAR(30) | No | NULL | No |
| business\_scope  | 经营范围| VARCHAR(255) | No | NULL | No |
| occupation  | 职业| VARCHAR(80) | No | NULL | No |
| contact\_cert\_num  | 联系人证件号| VARCHAR(30) | No | NULL | No |
| open\_license\_no  | 开户许可证核准号| VARCHAR(60) | No | NULL | No |
| user\_name  | 用户姓名| VARCHAR(30) | No | NULL | No |
| id\_card\_type  | 证件类型| VARCHAR(2) | No | NULL | No |
| id\_card  | 身份证号| VARCHAR(30) | No | NULL | No |
| user\_mobile  | 手机号| VARCHAR(20) | No | NULL | No |
| hf\_order\_id  | 汇付订单号| VARCHAR(255) | No | NULL | No |
| hf\_order\_date  | 汇付订单日期| VARCHAR(255) | No | NULL | No |
| hf\_apply\_id  | 汇付开户申请号| VARCHAR(255) | No | NULL | No |
| status  | 状态| VARCHAR(255) | No | 1 | No |
| business\_code\_img  | 营业执照注册号图片| VARCHAR(255) | No | NULL | No |
| business\_code\_img\_local  | 本地营业执照注册号图片| VARCHAR(255) | No | NULL | No |
| institution\_code\_img  | 组织机构代码图片| VARCHAR(255) | No | NULL | No |
| institution\_code\_img\_local  | 本地组织机构代码图片| VARCHAR(255) | No | NULL | No |
| tax\_code\_img  | 税务登记证号图片| VARCHAR(255) | No | NULL | No |
| tax\_code\_img\_local  | 本地税务登记证号图片| VARCHAR(255) | No | NULL | No |
| social\_credit\_code\_img  | 统一社会信用代码图片| VARCHAR(255) | No | NULL | No |
| social\_credit\_code\_img\_local  | 本地统一社会信用代码图片| VARCHAR(255) | No | NULL | No |
| legal\_card\_imgz  | 法人身份证正面照| VARCHAR(255) | No | NULL | No |
| legal\_card\_imgz\_local  | 本地法人身份证正面照| VARCHAR(255) | No | NULL | No |
| legal\_card\_imgf  | 法人身份证反面照| VARCHAR(255) | No | NULL | No |
| legal\_card\_imgf\_local  | 本地法人身份证反面照| VARCHAR(255) | No | NULL | No |
| bank\_acct\_img  | 开户银行许可证图片| VARCHAR(255) | No | NULL | No |
| bank\_acct\_img\_local  | 本地开户银行许可证图片| VARCHAR(255) | No | NULL | No |
| resp\_code  | 汇付响应码| VARCHAR(255) | No | NULL | No |
| resp\_desc  | 汇付响应码描述| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_enterapply\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-hfpay_ledger_config"></a>
## hfpay\_ledger\_config

> **分账配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_ledger\_config\_id  | 分账配置表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| is\_open  | 是否开启分账| VARCHAR(255) | Yes | false | No |
| business\_type  | 分账业务模式| VARCHAR(255) | Yes | 1 | No |
| agent\_number  | 代理商商户号| VARCHAR(255) | No | NULL | No |
| provider\_number  | 服务商渠道号| VARCHAR(255) | No | NULL | No |
| rate  | 平台服务费率| INT UNSIGNED | Yes | NULL | No |
| app\_id  | 绑定的微信小程序appid| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_ledger\_config\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-hfpay_merchant_payment"></a>
## hfpay\_merchant\_payment

> **汇付平台转账记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_merchant\_payment\_id  | 汇付取现银行卡表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| rel\_scene\_id  | 业务场景值id| BIGINT | Yes | NULL | No |
| rel\_scene\_name  | 业务场景值名称| VARCHAR(255) | Yes | NULL | No |
| mer\_cust\_id  | 汇付平台客户号| VARCHAR(255) | Yes | NULL | No |
| user\_cust\_id  | 汇付客户号| VARCHAR(255) | Yes | NULL | No |
| acct\_id  | 汇付账户号| VARCHAR(255) | Yes | NULL | No |
| trans\_amt  | 转账金额| BIGINT | Yes | NULL | No |
| status  | 状态 0 未提交 1转账成功 2转账失败| INT | Yes | 0 | No |
| hf\_order\_id  | 汇付接口请求order\_id| VARCHAR(255) | No | NULL | No |
| hf\_order\_date  | 汇付接口请求order\_date| VARCHAR(255) | No | NULL | No |
| resp\_code  | 汇付接口返回码| VARCHAR(255) | No | NULL | No |
| resp\_desc  | 汇付接口返回码描述| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_merchant\_payment\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_rel\_scene\_id\_rel\_scene\_name | rel\_scene\_id, rel\_scene\_name | No |

<a name="table-hfpay_trade_record"></a>
## hfpay\_trade\_record

> **汇付记账表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| hfpay\_trade\_record\_id  | 汇付记账表| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | company\_id| INT | No | NULL | No |
| distributor\_id  | 店铺id| VARCHAR(255) | No | NULL | No |
| trade\_id  | 业务id| VARCHAR(255) | No | NULL | No |
| outer\_order\_id  | 订单id| VARCHAR(255) | No | NULL | No |
| form\_user\_id  | 用户| VARCHAR(255) | No | NULL | No |
| target\_user\_id  | 对象id| VARCHAR(255) | No | NULL | No |
| trade\_time  | 时间戳| VARCHAR(255) | No | NULL | No |
| trade\_type  | 交易类型| INT | No | NULL | No |
| fin\_type  | 财务科目| VARCHAR(255) | No | NULL | No |
| income  | 收入| INT | No | NULL | No |
| outcome  | 支出| INT | No | NULL | No |
| is\_clean  | 结算状态 0未结算 1已结算| INT | No | 0 | No |
| clean\_time  | 结算时间| INT | No | NULL | No |
| message  | 描述| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | hfpay\_trade\_record\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-icbc_pay_log"></a>
## icbc\_pay\_log

> **工商银行接口日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业ID| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| unique\_key  | 唯一ID| VARCHAR(64) | No |  | No |
| log\_type  | 日志类型| VARCHAR(20) | No | NULL | No |
| log\_data  | 日志内容| LONGTEXT | No | NULL | No |
| api\_res  | 请求结果| LONGTEXT | No | NULL | No |
| add\_time  | 创建时间| DATETIME | No | NULL | No |
| modify\_time  | 更新时间| DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_id | order\_id | No |
| idx\_unique\_key | unique\_key | No |
| idx\_add\_time | add\_time | No |

<a name="table-item_keywords"></a>
## item\_keywords

> **商品热门关键词表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| content  | 内容| VARCHAR(255) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-items"></a>
## items

> **商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| item\_type  | 商品类型，services：服务商品，normal: 普通商品| VARCHAR(15) | Yes | services | No |
| item\_category  | 商品主类目| VARCHAR(15) | No | null | No |
| consume\_type  | 核销类型，every：每个物料都要核销(例如3个物料要核销3次)，all：所有物料作为一个整体核销一次(例如3个物料只需要核销1次)| VARCHAR(15) | Yes | every | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| item\_bn  | 商品编号| VARCHAR(255) | Yes | NULL | No |
| barcode  | 商品条形码| LONGTEXT | Yes | NULL | No |
| brief  | 简洁的描述| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| price  | 销售价,单位为‘分’| INT | Yes | NULL | No |
| cost\_price  | 成本价,单位为‘分’| INT | No | 0 | No |
| item\_unit  | 商品计量单位| VARCHAR(255) | No | NULL | No |
| special\_type  | 商品特殊类型 drug 处方药 normal 普通商品| VARCHAR(255) | No | normal | No |
| item\_address\_province  | 产地省| VARCHAR(255) | No | NULL | No |
| item\_address\_city  | 产地市| VARCHAR(255) | No | NULL | No |
| regions\_id  | 产地地区id| VARCHAR(255) | No | NULL | No |
| regions  | 产地地区| LONGTEXT | No | NULL | No |
| store  | 库存| INT | No | NULL | No |
| sales  | 销量| INT | No | 0 | No |
| rebate\_conf  | 分销配置| JSON | No | NULL | No |
| rebate  | 推广商品 1已选择 0未选择 2申请加入 3拒绝| INT | No | NULL | No |
| rebate\_type  | 分佣计算方式| VARCHAR(255) | No | default | No |
| approve\_status  | 商品状态 onsale 前台可销售，offline\_sale前端不展示，instock 不可销售, only\_show 前台仅展示| VARCHAR(255) | Yes | NULL | No |
| audit\_status  | 审核状态 submitting待提交 approved成功 processing审核中 rejected审核拒绝| VARCHAR(255) | No | approved | No |
| audit\_reason  | 审核拒绝原因| LONGTEXT | No | NULL | No |
| market\_price  | 原价,单位为‘分’| INT | Yes | NULL | No |
| goods\_function  | 商品功能| VARCHAR(255) | No | NULL | No |
| goods\_series  | 商品系列| VARCHAR(255) | No | NULL | No |
| goods\_color  | 商品颜色| VARCHAR(255) | No | NULL | No |
| goods\_brand  | 商品品牌| VARCHAR(255) | No | NULL | No |
| is\_default  | 商品是否为默认商品| TINYINT(1) | No | 1 | No |
| default\_item\_id  | 默认商品ID| BIGINT | No | 0 | No |
| goods\_id  | 产品ID| BIGINT | No | 0 | No |
| nospec  | 商品是否为单规格| VARCHAR(255) | No | true | No |
| weight  | 商品重量| DOUBLE PRECISION | No | 0 | No |
| sort  | 商品排序| INT | Yes | 0 | No |
| is\_epidemic  | 是否为疫情需要登记的商品  1:是 0:否| INT | No | 0 | No |
| templates\_id  | 运费模板id| INT | No | NULL | No |
| pics  | 图片| JSON | Yes | NULL | No |
| pics\_create\_qrcode  | 图片是否生成小程序码| JSON | No | NULL | No |
| video\_type  | 视频类型 local:本地视频 tencent:腾讯视频| VARCHAR(255) | Yes | local | No |
| videos  | 视频| LONGTEXT | No | NULL | No |
| video\_pic\_url  | 视频封面图| LONGTEXT | No | NULL | No |
| intro  | 图文详情| LONGTEXT | No | NULL | No |
| purchase\_agreement  | 购买协议| LONGTEXT | No | NULL | No |
| is\_show\_specimg  | 详情页是否显示规格图片| TINYINT(1) | Yes |  | No |
| enable\_agreement  | 开启购买协议| TINYINT(1) | Yes |  | No |
| date\_type  | 有效期的类型, DATE\_TYPE\_FIX\_TIME\_RANGE:指定日期范围内, DATE\_TYPE\_FIX\_TERM:固定天数后| VARCHAR(255) | No | NULL | No |
| begin\_date  | 有效期开始时间| INT | No | NULL | No |
| end\_date  | 有效期结束时间| INT | No | NULL | No |
| fixed\_term  | 有效期的有效天数| INT | No | NULL | No |
| brand\_logo  | 品牌图片| VARCHAR(1024) | No | NULL | No |
| is\_point  | 是否积分兑换 true可以 false不可以| TINYINT(1) | No |  | No |
| point  | 积分个数| INT | No | 0 | No |
| distributor\_id  | 店铺id,为0时表示该商品为商城商品，否则为店铺自有商品| INT | Yes | 0 | No |
| volume  | 商品体积| DOUBLE PRECISION | No | NULL | No |
| item\_source  | 商品来源:mall:主商城;distributor:店铺自有;openapi:开放接口;| VARCHAR(255) | Yes | mall | No |
| brand\_id  | 品牌id| INT | No | 0 | No |
| tax\_rate  | 税率, 百分之～/100| INT | Yes | NULL | No |
| crossborder\_tax\_rate  | 跨境税率，百分比，小数点2位| VARCHAR(10) | Yes | NULL | No |
| profit\_type  | 分润类型, 默认为0配置分润,1主类目分润,2商品指定分润(比例),3商品指定分润(金额)| INT | No | 0 | No |
| origincountry\_id  | 产地国id| BIGINT | Yes | 0 | No |
| taxstrategy\_id  | 税费策略id| BIGINT | Yes | 0 | No |
| taxation\_num  | 计税单位份数| INT | Yes | 0 | No |
| profit\_fee  | 分润金额,单位为分 冗余字段| INT | No | 0 | No |
| type  | 商品类型，0普通，1跨境商品，可扩展| INT | Yes | 0 | No |
| is\_profit  | 是否支持分润| TINYINT(1) | No |  | No |
| is\_medicine  | 是否为药品，0否 1是| SMALLINT | Yes | 0 | No |
| is\_prescription  | 是否为处方药，0否 1是| SMALLINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| is\_gift  | 是否为赠品| TINYINT(1) | No |  | No |
| is\_package  | 是否为打包产品| TINYINT(1) | No |  | No |
| tdk\_content  | tdk详情| LONGTEXT | No | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| supplier\_item\_id  | 供应商商品id| INT | Yes | 0 | No |
| is\_market  | 供应商控制商品是否可售，0不可售，1可售| INT | Yes | 1 | No |
| goods\_bn  | 产品编号| VARCHAR(255) | No | NULL | No |
| supplier\_goods\_bn  | 供应商货号| VARCHAR(255) | No | NULL | No |
| audit\_date  | 商品审核时间| INT | No | NULL | No |
| start\_num  | 起订量| INT | No | 0 | No |
| delivery\_time  | 发货时间，如2，表示2天发货| INT | No | 0 | No |
| is\_taobao  | 是否淘宝商品| INT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_default\_item\_id | default\_item\_id | No |
| ix\_supplier\_item\_id | supplier\_item\_id | No |
| ix\_item\_category | item\_category | No |
| ix\_item\_bn | item\_bn | No |
| ix\_goods\_id | goods\_id | No |
| ix\_is\_default | is\_default | No |
| ix\_is\_medicine | is\_medicine | No |
| ix\_is\_prescription | is\_prescription | No |
| ix\_default\_item\_list | company\_id, default\_item\_id, approve\_status, item\_type, item\_category | No |

<a name="table-items_attribute_values"></a>
## items\_attribute\_values

> **商品属性值表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| attribute\_value\_id  | 商品属性值id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| attribute\_id  | 商品属性ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| shop\_id  | 店铺ID，如果为0则表示总部| BIGINT | Yes | NULL | No |
| attribuattribute\_valuete\_name  | 商品属性值| VARCHAR(255) | Yes | NULL | No |
| sort  | 商品属性排序，越大越在前| VARCHAR(15) | Yes | NULL | No |
| image\_url  | 图片| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| oms\_value\_id  | oms商品属性值id| BIGINT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | attribute\_value\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_attribute\_id | attribute\_id | No |
| ix\_attribuattribute\_valuete\_name | attribuattribute\_valuete\_name | No |

<a name="table-items_attributes"></a>
## items\_attributes

> **商品属性表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| attribute\_id  | 商品属性id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| shop\_id  | 店铺ID，如果为0则表示总部| BIGINT | Yes | 0 | No |
| attribute\_type  | 商品属性类型 unit单位，brand品牌，item\_params商品参数, item\_spec规格| VARCHAR(15) | Yes | NULL | No |
| attribute\_show  | 属性展示方式 select 下拉 input 平铺| VARCHAR(15) | No | NULL | No |
| attribute\_name  | 商品属性名称| VARCHAR(255) | Yes | NULL | No |
| attribute\_memo  | 商品属性备注| VARCHAR(255) | No | NULL | No |
| attribute\_sort  | 商品属性排序，越大越在前| VARCHAR(15) | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | No | 0 | No |
| is\_show  | 是否用于筛选| VARCHAR(15) | Yes | NULL | No |
| is\_image  | 属性是否需要配置图片| VARCHAR(255) | Yes | NULL | No |
| image\_url  | 图片| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| attribute\_code  | oms 规格编码| VARCHAR(32) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | attribute\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_attribute\_type | attribute\_type | No |
| ix\_attribute\_name | attribute\_name | No |

<a name="table-items_barcode"></a>
## items\_barcode

> **商品条形码表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| barcode  | 商品条形码| VARCHAR(50) | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| default\_item\_id  | 默认商品id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id, barcode | Yes |
| ix\_item\_id | item\_id | No |

<a name="table-items_category"></a>
## items\_category

> **商品分类表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| category\_id  | 商品分类id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| category\_name  | 分类名称| VARCHAR(50) | Yes | NULL | No |
| category\_code  | 分类编码| VARCHAR(50) | No | NULL | No |
| parent\_id  | 父级id, 0为顶级| BIGINT | Yes | 0 | No |
| category\_level  | 商品分类等级| INT | No | 1 | No |
| is\_main\_category  | 是否为商品主类目| TINYINT(1) | No |  | No |
| path  | 路径| VARCHAR(255) | No | 0 | No |
| distributor\_id  | 店铺ID| BIGINT | No | 0 | No |
| commission\_ratio  | 佣金比例| INT | Yes | 0 | No |
| sort  | 排序| BIGINT | No | 0 | No |
| goods\_params  | 商品参数| LONGTEXT | No | NULL | No |
| goods\_spec  | 商品规格| LONGTEXT | No | NULL | No |
| image\_url  | 分类图片链接| LONGTEXT | No | NULL | No |
| crossborder\_tax\_rate  | 跨境税率，百分比，小数点2位| VARCHAR(10) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| customize\_page\_id  | 自定义模板id| BIGINT | No | 0 | No |
| category\_id\_taobao  | 淘宝分类id| BIGINT | No | 0 | No |
| parent\_id\_taobao  | 淘宝父级分类ID| BIGINT | No | 0 | No |
| taobao\_category\_info  | 淘宝分类信息行| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | category\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_distributor\_id | distributor\_id | No |
| ix\_parent\_id | parent\_id | No |
| ix\_is\_main\_category | is\_main\_category | No |

<a name="table-items_category_profit"></a>
## items\_category\_profit

> **商品分润配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| category\_id  | 商品ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| profit\_type  | 分佣计算方式| VARCHAR(255) | No | default | No |
| profit\_conf  | 分销配置| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | category\_id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-items_commission"></a>
## items\_commission

> **商品佣金配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| rel\_id  | 关联ID| BIGINT | Yes | NULL | No |
| type  | 数据类型 goods:SPU,item:SKU| VARCHAR(255) | No | goods | No |
| commission\_type  | 佣金计算方式 1:按照比例,2:按照填写金额| VARCHAR(255) | No | 1 | No |
| commission\_conf  | 佣金| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_rel\_id | rel\_id | No |
| ix\_type | type | No |

<a name="table-items_medicine"></a>
## items\_medicine

> **商品药品数据表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| medicine\_type  | 药品分类:0为西药，1为中成药，3为其他| SMALLINT | Yes | NULL | No |
| common\_name  | 通用名（重要，具体请查看《同步药品信息规范指引》文档）| VARCHAR(255) | Yes | NULL | No |
| dosage  | 剂型| VARCHAR(255) | Yes |  | No |
| spec  | 规格（重要，具体请查看《同步药品信息规范指引》文档）| VARCHAR(255) | Yes | NULL | No |
| packing\_spec  | 包装规格| VARCHAR(255) | Yes |  | No |
| manufacturer  | 生产厂家| VARCHAR(255) | Yes | NULL | No |
| approval\_number  | 批准文号| VARCHAR(255) | Yes | NULL | No |
| unit  | 最小售卖单位| VARCHAR(255) | Yes | NULL | No |
| is\_prescription  | 是否处方药（1为是，0为否）| SMALLINT | Yes | NULL | No |
| special\_common\_name  | 特殊通用名| VARCHAR(255) | Yes |  | No |
| special\_spec  | 特殊规格| VARCHAR(255) | Yes |  | No |
| audit\_status  | 审核状态，0不需要审核（非处方药），1未审核，2审核通过，3审核不通过| SMALLINT | Yes | 1 | No |
| audit\_reason  | 审核不通过原因| VARCHAR(255) | Yes |  | No |
| item\_type  | 商品类型 normal普通商品 point积分商品| VARCHAR(255) | Yes | normal | No |
| use\_tip  | 处方药用药提示| VARCHAR(255) | Yes |  | No |
| symptom  | 处方药适用症状| VARCHAR(255) | Yes |  | No |
| max\_num  | 处方药单次下单最大购买数量| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_medicine\_type | medicine\_type | No |
| ix\_common\_name | common\_name | No |
| ix\_approval\_number | approval\_number | No |
| ix\_is\_prescription | is\_prescription | No |

<a name="table-items_profit"></a>
## items\_profit

> **商品分润配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| profit\_type  | 分佣计算方式 0商品不设置默认分润,1按照比例分润,2按照填写金额分润| VARCHAR(255) | No | 0 | No |
| profit\_conf  | 分销配置| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-items_recommend"></a>
## items\_recommend

> **商品推荐表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| main\_item\_id  | 主商品| BIGINT | Yes | NULL | No |
| item\_id  | 商品| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| brief  | 简洁的描述| VARCHAR(255) | No | NULL | No |
| pics  | 商品图片| LONGTEXT | Yes | NULL | No |
| price  | 价格,单位为‘分’| INT | Yes | NULL | No |
| market\_price  | 原价,单位为‘分’| INT | Yes | 0 | No |
| item\_spec\_desc  | 产品规格描述| VARCHAR(255) | No |  | No |
| sort  | 商品排序| INT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_main\_item\_id | main\_item\_id | No |

<a name="table-items_rel_attributes"></a>
## items\_rel\_attributes

> **商品关联属性表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| attribute\_sort  | 商品属性排序| INT | No | 0 | No |
| attribute\_id  | 商品属性id| BIGINT | Yes | NULL | No |
| attribute\_type  | 商品属性类型 unit单位，brand品牌，item\_params商品参数, item\_spec规格| VARCHAR(15) | Yes | NULL | No |
| attribute\_value\_id  | 商品属性值id| BIGINT | No | NULL | No |
| custom\_attribute\_value  | 自定义属性名称| VARCHAR(255) | No | NULL | No |
| image\_url  | 规格自定义图片| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_item\_id | item\_id | No |
| ix\_attribute\_type | attribute\_type | No |

<a name="table-items_rel_point_access"></a>
## items\_rel\_point\_access

> **商品和积分获取设置关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| point  | 积分| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id | Yes |
| ix\_itemid\_companyid | company\_id, item\_id | No |

<a name="table-items_rel_tags"></a>
## items\_rel\_tags

> **商品关联标签表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id, company\_id, item\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_item\_id | item\_id | No |
| ix\_tag\_id | tag\_id | No |

<a name="table-items_rel_type"></a>
## items\_rel\_type

> **商品数值属性关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| label\_id  | 数值属性ID| BIGINT | Yes | NULL | No |
| label\_name  | 数值属性名称| VARCHAR(255) | Yes | NULL | No |
| label\_price  | 价格,单位为‘分’| INT | Yes | NULL | No |
| num\_type  | 会员数值属性类型，plus：加，minux：减，multiple：乘| VARCHAR(30) | Yes | NULL | No |
| num  | 数值属性值，例如买了50个次卡，就是填50；赠送了10个经验，就是填10| BIGINT | Yes | NULL | No |
| is\_not\_limit\_num  | 限制核销次数,1:不限制；2:限制| INT | Yes | 2 | No |
| limit\_time  | 有效期，例如30天| BIGINT | Yes | 0 | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id, label\_id | Yes |

<a name="table-items_tags"></a>
## items\_tags

> **商品标签库表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| tag\_name  | 标签名称| VARCHAR(50) | Yes | NULL | No |
| tag\_color  | 标签颜色| VARCHAR(50) | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | No | 0 | No |
| font\_color  | 字体颜色| VARCHAR(50) | Yes | NULL | No |
| description  | 标签描述| VARCHAR(255) | No | NULL | No |
| tag\_icon  | 标签icon| LONGTEXT | No | NULL | No |
| front\_show  | 前台是否显示 0 否 1 是| SMALLINT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_tag\_id | tag\_id | No |

<a name="table-kaquan_card_related"></a>
## kaquan\_card\_related

> **卡券库存统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| card\_id  | 卡券id| VARCHAR(40) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| title  | 卡券名,最大9个汉字| VARCHAR(27) | Yes | NULL | No |
| quantity  | 卡券总库存| INT | No | 0 | No |
| get\_num  | 被领取数量| INT | No | 0 | No |
| consume\_num  | 被核销数量| INT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | card\_id, company\_id | Yes |

<a name="table-kaquan_discount_cards"></a>
## kaquan\_discount\_cards

> **优惠券信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| card\_id  | 卡券id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| card\_type  | 卡券类型，可选值有，discount:折扣券;cash:代金券;gift:兑换券;new\_gift:兑换券(新)| VARCHAR(16) | Yes | NULL | No |
| brand\_name  | 商户名称| VARCHAR(36) | No | NULL | No |
| logo\_url  | 卡券商户 logo| VARCHAR(255) | No | NULL | No |
| title  | 卡券名,最大9个汉字| VARCHAR(27) | Yes | NULL | No |
| color  | 券颜色值| VARCHAR(16) | Yes | NULL | No |
| notice  | 卡券使用提醒,最大16汉字| VARCHAR(48) | No | NULL | No |
| description  | 卡券使用说明| LONGTEXT | Yes | NULL | No |
| date\_type  | 有效期的类型| VARCHAR(255) | Yes | NULL | No |
| begin\_date  | 有效期开始时间| INT | No | NULL | No |
| end\_date  | 有效期结束时间| INT | No | NULL | No |
| fixed\_term  | 有效期的有效天数| INT | No | NULL | No |
| grade\_ids  | 指定会员id| VARCHAR(255) | Yes |  | No |
| vip\_grade\_ids  | 指定付费会员id| VARCHAR(255) | Yes |  | No |
| kq\_status  | 卡券状态 0:正常 1:暂停 2:关闭| INT | Yes | 0 | No |
| lock\_time  | 兑换商品后的锁定时间| INT | Yes | 0 | No |
| send\_begin\_time  | 发放开始时间| INT | No | NULL | No |
| send\_end\_time  | 发放结束时间| INT | No | NULL | No |
| service\_phone  | 客服电话| VARCHAR(15) | No | NULL | No |
| center\_title  | 卡券顶部居中的按钮，仅在卡券状态正常(可以核销)时显示| VARCHAR(255) | No | NULL | No |
| center\_sub\_title  | 显示在入口下方的提示语| VARCHAR(255) | No | NULL | No |
| center\_url  | 顶部居中的url| VARCHAR(255) | No | NULL | No |
| custom\_url\_name  | 自定义跳转外链的入口名字| VARCHAR(15) | No | NULL | No |
| custom\_url  | 自定义跳转的URL| VARCHAR(255) | No | NULL | No |
| custom\_url\_sub\_title  | 显示在入口右侧的提示语| VARCHAR(18) | No | NULL | No |
| promotion\_url\_name  | 营销场景的自定义入口名称| VARCHAR(15) | No | NULL | No |
| promotion\_url  | 营销场景的自定义入口url| VARCHAR(255) | No | NULL | No |
| promotion\_url\_sub\_title  | 营销入口右侧的提示语| VARCHAR(18) | No | NULL | No |
| get\_limit  | 每人可领券的数量限制| INT | No | NULL | No |
| use\_limit  | 每人可核销的数量限制| INT | No | NULL | No |
| can\_share  | 卡券领取页面是否可分享| VARCHAR(255) | No | false | No |
| can\_give\_friend  | 卡券是否可转赠| VARCHAR(255) | No | false | No |
| abstract  | 封面摘要| VARCHAR(255) | No | NULL | No |
| icon\_url\_list  | 封面图片| VARCHAR(255) | No | NULL | No |
| text\_image\_list  | 图文列表| LONGTEXT | No | NULL | No |
| time\_limit  | 使用时段限制| LONGTEXT | No | NULL | No |
| gift  | 兑换券兑换内容名称| VARCHAR(255) | No | NULL | No |
| default\_detail  | 优惠券优惠详情| VARCHAR(255) | No | NULL | No |
| discount  | 折扣券打折额度（百分比)| INT | No | 0 | No |
| least\_cost  | 代金券起用金额| INT | No | 0 | No |
| reduce\_cost  | 代金券减免金额 or 兑换券起用金额| INT | No | 0 | No |
| deal\_detail  | 团购券详情| VARCHAR(255) | No | NULL | No |
| accept\_category  | 指定可用的商品类目,代金券专用| VARCHAR(255) | No | NULL | No |
| reject\_category  | 指定不可用的商品类目,代金券专用| VARCHAR(255) | No | NULL | No |
| object\_use\_for  | 购买xx可用类型门槛，仅用于兑换| VARCHAR(255) | No | NULL | No |
| can\_use\_with\_other\_discount  | 是否可与其他优惠共享| VARCHAR(255) | No | false | No |
| use\_platform  | 优惠券适用平台（线上商城专用 or 门店专用）| VARCHAR(255) | No | store | No |
| quantity  | 卡券数量| INT | Yes | NULL | No |
| use\_all\_shops  | 是否适用所有门店| VARCHAR(255) | No | true | No |
| rel\_shops\_ids  | 适用的门店| LONGTEXT | No | NULL | No |
| use\_scenes  | 核销场景。可选值有，ONLINE:线上商城(兑换券不可使用);QUICK:快捷买单(兑换券不可使用);SWEEP:门店支付(扫码核销);SELF:到店支付(自助核销)| VARCHAR(255) | No | QUICK | No |
| self\_consume\_code  | 自助核销验证码| INT | No | 0 | No |
| receive  | 是否前台直接领取| VARCHAR(255) | No | true | No |
| distributor\_id  | 店铺id| LONGTEXT | No | , | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| most\_cost  | 代金券最高消费限额| INT | No | 0 | No |
| use\_bound  | 适用范围: 0:全场可用,1:指定商品可用,2:指定分类可用,3:指定商品标签可用,4:指定商品品牌可用| INT | Yes | 0 | No |
| tag\_ids  | 标签id集合| LONGTEXT | No | NULL | No |
| brand\_ids  | 品牌id集合| LONGTEXT | No | NULL | No |
| apply\_scope  | 适用范围| LONGTEXT | No | NULL | No |
| card\_code  | 优惠券模板ID-第三方使用| VARCHAR(255) | No | NULL | No |
| card\_rule\_code  | 优惠券规则ID-第三方使用| VARCHAR(255) | No | NULL | No |
| source\_type  | 添加者类型：distributor| VARCHAR(20) | No | NULL | No |
| source\_id  | 添加者ID: 如店铺ID| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | card\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_source\_id | source\_id | No |

<a name="table-kaquan_rel_items"></a>
## kaquan\_rel\_items

> **卡券关联商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 筛选id(按item\_type区分为商品ID,标签ID等)| BIGINT | Yes | NULL | No |
| card\_id  | 优惠券id| BIGINT | Yes | NULL | No |
| item\_type  | 筛选类型,可选值有normal:普通商品,tag:标签,brand:品牌,category:主类目| VARCHAR(255) | Yes | normal | No |
| is\_show  | 是否为列表默认展示| TINYINT(1) | Yes | 1 | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| use\_limit  | 兑换上限| INT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id, card\_id, item\_type | Yes |
| idx\_card\_id | card\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-kaquan_rel_member_tags"></a>
## kaquan\_rel\_member\_tags

> **卡券关联用户标签表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| card\_id  | 卡券id| BIGINT | Yes | NULL | No |
| tag\_id  | 用户标签id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | card\_id, tag\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_tag\_id | tag\_id | No |

<a name="table-kaquan_salesperson_give_coupons"></a>
## kaquan\_salesperson\_give\_coupons

> **导购员发放给用户优惠券记录**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| salesperson\_name  | 导购员名称| VARCHAR(255) | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| user\_name  | 会员名称| VARCHAR(255) | Yes |  | No |
| coupons\_id  | 优惠券id| BIGINT | Yes | NULL | No |
| coupons\_name  | 优惠券名称| VARCHAR(255) | Yes | NULL | No |
| number  | 发送优惠券数量| INT | Yes | 0 | No |
| status  | 发放优惠券状态，1成功，0失败| INT | Yes | 1 | No |
| fail\_reason  | 失败原因| VARCHAR(255) | No | NULL | No |
| give\_time  | 发送优惠券时间| INT | Yes | NULL | No |
| updated  | 修改时间| INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-kaquan_user_discount"></a>
## kaquan\_user\_discount

> **用户领取的优惠券表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 用户的唯一标识| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| card\_id  | 微信用户领取的卡券 id | BIGINT | Yes | NULL | No |
| code  | 卡券 code 序列号| VARCHAR(30) | Yes | NULL | No |
| source\_type  | 卡券来源类型，可选值有 local:本地卡券,wechat:微信卡券| VARCHAR(30) | Yes | local | No |
| status  | 用户领取的优惠券使用状态{1:未使用,2:已核销,3:已转赠,5:已过期,6:作废,10:已使用(兑换券)};| INT | No | 1 | No |
| card\_type  | 优惠券类型,可选值有 discount:折扣券，cash:代金券，new\_gift:兑换券| VARCHAR(255) | No | 1 | No |
| use\_platform  | 优惠券适用平台（mall:线上商城专用, store:门店专用）| VARCHAR(255) | No | store | No |
| begin\_date  | 有效期开始时间| INT | Yes | NULL | No |
| end\_date  | 有效期结束时间| INT | Yes | NULL | No |
| get\_date  | 优惠券获取时间| INT | Yes | NULL | No |
| title  | 卡券名,最大9个汉字| VARCHAR(27) | Yes | NULL | No |
| color  | 券颜色值| VARCHAR(16) | Yes | NULL | No |
| discount  | 折扣券打折额度（百分比)| INT | No | 0 | No |
| least\_cost  | 代金券起用金额| INT | No | 0 | No |
| reduce\_cost  | 代金券减免金额 or 兑换券起用金额| INT | No | 0 | No |
| rel\_shops\_ids  | 门店shop\_id;线下门店时,必填;| LONGTEXT | No | NULL | No |
| rel\_item\_ids  | 使用商品| LONGTEXT | No | NULL | No |
| rel\_distributor\_ids  | 使用商品| LONGTEXT | No | NULL | No |
| consume\_source  | 核销来源| VARCHAR(255) | No | NULL | No |
| get\_outer\_str  | 领取场景值| VARCHAR(255) | No | NULL | No |
| location\_name  | 核销卡券的门店名称| VARCHAR(255) | No | NULL | No |
| staff\_open\_id  | 卡券核销员| VARCHAR(255) | No | NULL | No |
| verify\_code  | 自助核销的验证码| VARCHAR(255) | No | NULL | No |
| remark\_amount  | 自助核销时备注金额| VARCHAR(255) | No | NULL | No |
| consume\_outer\_str  | 核销渠道| VARCHAR(255) | No | NULL | No |
| trans\_id  | 微信支付交易订单号,买单核销专用| VARCHAR(255) | No | NULL | No |
| fee  | 实付金额,买单核销专用| VARCHAR(255) | No | NULL | No |
| original\_fee  | 应付金额,买单核销专用| VARCHAR(255) | No | NULL | No |
| location\_id  | 当前卡券核销的门店ID| VARCHAR(255) | No | NULL | No |
| use\_scenes  | 可被核销的方式| VARCHAR(255) | No | QUICK | No |
| most\_cost  | 代金券最高消费限额| INT | No | 0 | No |
| use\_condition  | 使用条件字段| LONGTEXT | No | NULL | No |
| is\_give\_by\_friend  | 是否为转赠领取| TINYINT(1) | No |  | No |
| old\_code  | 转赠之后,旧的 code 序列号| VARCHAR(255) | No | NULL | No |
| friend\_open\_id  | 转赠卡券时接收方 open\_id| VARCHAR(255) | No | NULL | No |
| is\_return\_back  | 转赠时是否退回| TINYINT(1) | No |  | No |
| is\_chat\_room  | 是否群转赠| TINYINT(1) | No |  | No |
| salesperson\_id  | 导购id| BIGINT | No | NULL | No |
| use\_limited  | 是否可以多次使用,仅记录无业务| INT | No | 0 | No |
| remain\_times  | 剩余使用次数,仅记录无业务| INT | No | 1 | No |
| use\_bound  | 适用范围: 0:全场可用,1:指定商品可用,2:指定分类可用,3:指定商品标签可用,4:指定商品品牌可用| INT | Yes | 0 | No |
| rel\_category\_ids  | 可使用的类目| LONGTEXT | No | NULL | No |
| apply\_scope  | 适用范围| LONGTEXT | No | NULL | No |
| used\_time  | 兑换券使用时间| INT | Yes | 0 | No |
| expired\_time  | 兑换券过期时间| INT | Yes | 0 | No |
| activity\_name  | 参与活动名称| VARCHAR(100) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_code | code | No |
| idx\_source\_type | source\_type | No |
| idx\_userid\_status\_companyid | user\_id, status, company\_id | No |
| idx\_userid\_enddate | user\_id, end\_date | No |
| idx\_status\_expiredtime | status, expired\_time | No |
| idx\_cardid\_companyid\_userid | card\_id, company\_id, user\_id | No |

<a name="table-kaquan_user_discount_logs"></a>
## kaquan\_user\_discount\_logs

> **优惠券核销记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 用户的唯一标识| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| username  | 姓名| VARCHAR(500) | No | NULL | No |
| card\_id  | 微信用户领取的卡券 id | BIGINT | Yes | NULL | No |
| code  | 卡券 code 序列号| VARCHAR(30) | Yes | NULL | No |
| title  | 卡券名,最大9个汉字| VARCHAR(27) | Yes | NULL | No |
| card\_type  | 优惠券类型，可选值有 discount 折扣券;cash:代金券;gift:兑换券| VARCHAR(255) | Yes | NULL | No |
| shop\_name  | 核销卡券的门店名称| VARCHAR(255) | No | NULL | No |
| used\_time  | 核销时间| INT | Yes | NULL | No |
| used\_status  | 核销状态；consume:核销，callback:回退| VARCHAR(255) | No | NULL | No |
| used\_order  | 核销订单| VARCHAR(255) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-kaquan_vip_grade"></a>
## kaquan\_vip\_grade

> **付费会员等级库表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| vip\_grade\_id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| INT | Yes | NULL | No |
| grade\_name  | 等级名称| VARCHAR(255) | Yes | NULL | No |
| lv\_type  | 等级类型,可选值有 vip:普通vip;svip:进阶vip| VARCHAR(255) | Yes | NULL | No |
| guide\_title  | 购买引导文本| VARCHAR(255) | No | NULL | No |
| is\_default  | 购买引导文本| TINYINT(1) | Yes |  | No |
| default\_grade  | 是否默认等级| TINYINT(1) | No |  | No |
| is\_disabled  | 是否禁用| TINYINT(1) | No |  | No |
| background\_pic\_url  | 商家自定义会员卡背景图| VARCHAR(1024) | No | NULL | No |
| price\_list  | 阶段价格表| LONGTEXT | No | NULL | No |
| privileges  | 会员权益| LONGTEXT | No | NULL | No |
| description  | 详细说明| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| external\_id  | 外部唯一标识，外部调用方自定义的值| VARCHAR(50) | Yes |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | vip\_grade\_id | Yes |
| idx\_companyid\_created | company\_id, created | No |

<a name="table-kaquan_vip_grade_order"></a>
## kaquan\_vip\_grade\_order

> **付费会员等级卡**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| vip\_grade\_id  | 付费会员卡等级ID| INT | Yes | NULL | No |
| lv\_type  | 等级类型| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| INT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| mobile  | 用户手机号| VARCHAR(255) | No | NULL | No |
| title  | 会员卡标题| VARCHAR(255) | No | NULL | No |
| price  | 付款金额| INT UNSIGNED | Yes | NULL | No |
| card\_type  | 购买的卡片类型,可选值有  monthly:30天月度卡;quarter:30天季度卡;year:365天年度卡| JSON | Yes | NULL | No |
| discount  | 折扣额度| INT | Yes | 0 | No |
| shop\_id  | 门店id| BIGINT UNSIGNED | Yes | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| source\_id  | 订单来源id| BIGINT | No | NULL | No |
| monitor\_id  | 订单监控页面id| BIGINT | No | NULL | No |
| order\_status  | 订单状态,可选值有 DONE—订单完成;NOTPAY—未支付;CANCEL—已取消| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |
| source\_type  | 订单来源,可选值有 sale:购买;receive:领取;admin:后台手动续期;gift:赠送| VARCHAR(255) | Yes | sale | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |

<a name="table-kaquan_vip_rel_user"></a>
## kaquan\_vip\_rel\_user

> **付费会员的等级卡表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| INT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| vip\_type  | 会员类型| VARCHAR(255) | No | NULL | No |
| vip\_grade\_id  | 会员等级id| BIGINT | No | NULL | No |
| end\_date  | 会员到期时间| VARCHAR(255) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| inx\_company\_id | company\_id | No |
| inx\_user\_id | user\_id | No |
| inx\_vip\_grade\_id | vip\_grade\_id | No |

<a name="table-kaquan_wechat_card"></a>
## kaquan\_wechat\_card

> **关联微信卡券**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| card\_id  | 会员卡id| BIGINT | Yes | NULL | No |
| wechat\_card\_id  | 微信会员卡id| VARCHAR(40) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | card\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_wechat\_card\_id | wechat\_card\_id | No |

<a name="table-logistics"></a>
## logistics

> **物流公司表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| corp\_id  | 物流公司ID| SMALLINT AUTO_INCREMENT | Yes | NULL | Yes |
| corp\_code  | 快递鸟代码| VARCHAR(255) | Yes | NULL | No |
| kuaidi\_code  | 快递100代码| VARCHAR(255) | Yes | NULL | No |
| full\_name  | 物流公司全名| VARCHAR(255) | Yes | NULL | No |
| corp\_name  | 物流公司简称| VARCHAR(255) | Yes | NULL | No |
| order\_sort  | 排序| SMALLINT | Yes | 99 | No |
| custom  | 是否自定义| TINYINT(1) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| phone  | 物流公司电话| VARCHAR(20) | No | NULL | No |
| logo  | logo| VARCHAR(255) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | corp\_id | Yes |

<a name="table-lucky_draw_activity"></a>
## lucky\_draw\_activity

> **抽奖表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 抽奖id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| area\_id  | 区域id| BIGINT | Yes | NULL | No |
| begin\_time  | 开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 结束时间| BIGINT | Yes | NULL | No |
| cost\_type  | 消耗类型，1互动分2积分| BIGINT | Yes | NULL | No |
| cost\_value  | 具体的消耗值| BIGINT | Yes | NULL | No |
| limit\_total  | 活动期限内总限制| BIGINT | Yes | NULL | No |
| limit\_day  | 按天限制| BIGINT | Yes | NULL | No |
| activity\_type  | 活动类型，wheel为大转盘| VARCHAR(64) | No | NULL | No |
| activity\_name  | 活动名称| VARCHAR(255) | No | NULL | No |
| activity\_template\_config  | 活动模板配置| LONGTEXT | No | NULL | No |
| prize\_data  | 奖项配置| LONGTEXT | No | NULL | No |
| intro  | 活动说明| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-map_config"></a>
## map\_config

> **地图配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 地区id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| type  | 第三方类型【amap 高德地图】【tencent 腾讯地图】| VARCHAR(20) | Yes | NULL | No |
| app\_key  | 第三方控制台中生成的key| VARCHAR(255) | Yes |  | No |
| app\_secret  | 第三方控制台中生成的秘钥| VARCHAR(255) | Yes |  | No |
| is\_default  | 是否是默认的地图配置项| TINYINT(1) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-map_config_service"></a>
## map\_config\_service

> **地图配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 本地的唯一id，如果外部表要与该表做关联，需要使用该id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| config\_id  | 地图配置的id| BIGINT | Yes | NULL | No |
| type  | 服务的类型| SMALLINT | Yes | NULL | No |
| service\_id  | 第三方平台提供的服务id| VARCHAR(20) | Yes | NULL | No |
| service\_data  | json内容，第三方平台中的服务数据| LONGTEXT | Yes | NULL | No |
| status  | 状态【1 生效】【0 失效】| SMALLINT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_config\_type | company\_id, config\_id, type, status | No |

<a name="table-medication_personnel"></a>
## medication\_personnel

> **用药人信息**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| user\_family\_name  | 用药人姓名| VARCHAR(255) | Yes | NULL | No |
| user\_family\_id\_card  | 用药人身份证号| VARCHAR(255) | Yes |  | No |
| user\_family\_age  | 用药人年龄| INT | Yes | NULL | No |
| user\_family\_gender  | 用药人性别1-男，2-女| SMALLINT | Yes | NULL | No |
| user\_family\_phone  | 用药人手机号码| VARCHAR(255) | Yes | NULL | No |
| relationship  | 用药人与问诊人关系(1本人 2父母 3配偶 4子女 5其他)| SMALLINT | Yes | NULL | No |
| is\_default  | 是否默认| SMALLINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_user\_family\_id\_card | user\_family\_id\_card | No |
| idx\_is\_default | is\_default | No |

<a name="table-member_group"></a>
## member\_group

> **分组表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| group\_id  | 分组id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| group\_name  | 分组名| VARCHAR(255) | Yes | NULL | No |
| salesperson\_id  | 导购员| BIGINT | Yes | NULL | No |
| sort  | 排序| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | group\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_salesperson\_id | salesperson\_id | No |

<a name="table-member_outfit"></a>
## member\_outfit

> ****

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| member\_id  | | INT | Yes | NULL | No |
| model\_image  | | VARCHAR(255) | Yes | NULL | No |
| status  | | SMALLINT | Yes | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-member_outfit_log"></a>
## member\_outfit\_log

> ****

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| model\_id  | | BIGINT | No | NULL | No |
| member\_id  | | INT | Yes | NULL | No |
| item\_id  | | INT | No | NULL | No |
| request\_id  | | VARCHAR(64) | Yes | NULL | No |
| top\_garment\_url  | | VARCHAR(255) | No | NULL | No |
| bottom\_garment\_url  | | VARCHAR(255) | No | NULL | No |
| result\_url  | | VARCHAR(255) | No | NULL | No |
| status  | | SMALLINT | Yes | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| uniq\_92d9fff3427eb8a5 | request\_id | Yes |
| idx\_92d9fff37975b7e7 | model\_id | No |
| primary | id | Yes |

<a name="table-member_rel_group"></a>
## member\_rel\_group

> **会员分组表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| group\_id  | 分组id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_salesperson\_id | salesperson\_id | No |
| idx\_group\_id | group\_id | No |

<a name="table-member_remarks"></a>
## member\_remarks

> **会员备注表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| remarks\_id  | 主键id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| user\_id  | 导购员id| BIGINT | Yes | NULL | No |
| remarks  | 导购员会员备注内容| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | remarks\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_salesperson\_id | salesperson\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-membercard"></a>
## membercard

> **会员卡**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| brand\_name  | 商户名称| VARCHAR(36) | Yes | NULL | No |
| logo\_url  | 商户 logo| VARCHAR(255) | Yes | NULL | No |
| title  | 卡券名,最大9个汉字| VARCHAR(27) | Yes | NULL | No |
| color  | 券颜色值| VARCHAR(16) | Yes | NULL | No |
| code\_type  | 卡券码类型(CODE\_TYPE\_TEXT CODE\_TYPE\_BARCODE CODE\_TYPE\_QRCODE CODE\_TYPE\_ONLY\_QRCODE CODE\_TYPE\_ONLY\_BARCODE CODE\_TYPE\_NONE)| VARCHAR(48) | Yes | NULL | No |
| background\_pic\_url  | 会员卡背景图| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id | Yes |

<a name="table-membercard_grade"></a>
## membercard\_grade

> **会员卡等级表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| grade\_id  | 等级ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| VARCHAR(255) | Yes | NULL | No |
| grade\_name  | 等级名称| VARCHAR(255) | Yes | NULL | No |
| default\_grade  | 是否默认等级| TINYINT(1) | Yes |  | No |
| background\_pic\_url  | 商家自定义会员卡背景图| VARCHAR(1024) | No | NULL | No |
| promotion\_condition  | 升级条件| JSON | No | NULL | No |
| privileges  | 会员权益| JSON | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| third\_data  | 第三方数据| VARCHAR(255) | No | NULL | No |
| external\_id  | 外部唯一标识，外部调用方自定义的值| VARCHAR(50) | Yes |  | No |
| description  | 详细说明| LONGTEXT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | grade\_id | Yes |
| idx\_companyid | company\_id | No |

<a name="table-members"></a>
## members

> **会员主表，其他平台的会员本地化表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| user\_id  | 用户id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| grade\_id  | 等级id| BIGINT | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| region\_mobile  | 带区号的手机号| VARCHAR(50) | Yes | NULL | No |
| mobile\_country\_code  | 手机号的区号| VARCHAR(50) | Yes | NULL | No |
| password  | 密码| VARCHAR(255) | Yes | NULL | No |
| user\_card\_code  | 会员卡号| VARCHAR(255) | Yes | NULL | No |
| offline\_card\_code  | 线下会员卡号| VARCHAR(255) | No | NULL | No |
| authorizer\_appid  | 公众号的appid| VARCHAR(64) | No | NULL | No |
| wxa\_appid  | 小程序的appid| VARCHAR(64) | No | NULL | No |
| alipay\_appid  | 支付宝小程序appid| VARCHAR(64) | No | NULL | No |
| inviter\_id  | 推荐人id| BIGINT | No | NULL | No |
| source\_from  | 来源类型 default默认| VARCHAR(255) | No | default | No |
| source\_id  | 来源id| BIGINT | No | NULL | No |
| monitor\_id  | 监控页面id| BIGINT | No | NULL | No |
| latest\_source\_id  | 最近来源id| BIGINT | No | NULL | No |
| latest\_monitor\_id  | 最近监控页面id| BIGINT | No | NULL | No |
| remarks  | 会员备注| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| created\_year  | 创建年份| INT | No | 0 | No |
| created\_month  | 创建月份| INT | No | 0 | No |
| created\_day  | 创建日期| INT | No | 0 | No |
| updated  | | INT | Yes | NULL | No |
| disabled  | 是否禁用。0:可用；1:禁用| TINYINT(1) | Yes | 0 | No |
| use\_point  | 是否可以使用积分| TINYINT(1) | Yes | 0 | No |
| third\_data  | 第三方数据| VARCHAR(255) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | user\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_mobile | mobile | No |
| idx\_grade\_id | grade\_id | No |
| idx\_company\_id\_user\_card\_code | company\_id, user\_card\_code | No |
| mobile\_company | mobile, company\_id | Yes |

<a name="table-members_address"></a>
## members\_address

> **会员收货地址表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| address\_id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| username  | 收货人| VARCHAR(50) | Yes | NULL | No |
| telephone  | 手机号码| VARCHAR(20) | Yes | NULL | No |
| area  | 地区| VARCHAR(255) | No | NULL | No |
| province  | 地区：省| VARCHAR(255) | Yes | NULL | No |
| city  | 地区：市| VARCHAR(255) | Yes | NULL | No |
| county  | 地区：区| VARCHAR(255) | Yes | NULL | No |
| adrdetail  | 详细地址| VARCHAR(255) | Yes | NULL | No |
| postalCode  | 邮编| VARCHAR(20) | No | NULL | No |
| is\_def  | 是否默认地址| TINYINT(1) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| third\_data  | 第三方数据| VARCHAR(255) | No | NULL | No |
| lng  | 腾讯地图纬度| VARCHAR(255) | Yes |  | No |
| lat  | 腾讯地图经度| VARCHAR(255) | Yes |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | address\_id | Yes |
| idx\_user\_id | user\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-members_article_fav"></a>
## members\_article\_fav

> **会员心愿单收藏**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| fav\_id  | 收藏id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| article\_id  | 文章ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | fav\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-members_associations"></a>
## members\_associations

> **不同平台会员关联表，关联到members表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| unionid  | 第三方unionid| VARCHAR(40) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_type  | 用户类型，可选值有 wechat:微信;ali:支付宝| VARCHAR(30) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | user\_id, unionid, company\_id, user\_type | Yes |
| ind\_member\_id\_miss | unionid, company\_id, user\_type | No |

<a name="table-members_browse_history"></a>
## members\_browse\_history

> **会员浏览足迹**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| history\_id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | history\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_item\_id | item\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-members_delete_record"></a>
## members\_delete\_record

> **会员删除记录**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| created  | 创建时间| INT | No | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_mobile | mobile | No |
| idx\_user\_id | user\_id | No |

<a name="table-members_distribution_fav"></a>
## members\_distribution\_fav

> **会员店铺收藏**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| fav\_id  | 收藏id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | fav\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-members_info"></a>
## members\_info

> **会员详情信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| username  | 姓名| VARCHAR(500) | No | NULL | No |
| name  | 名称| VARCHAR(255) | No | NULL | No |
| avatar  | 头像| VARCHAR(255) | No | NULL | No |
| sex  | 性别。0 未知 1 男 2 女| SMALLINT | No | 0 | No |
| birthday  | 出生日期| VARCHAR(100) | No | NULL | No |
| address  | 家庭住址| VARCHAR(255) | No | NULL | No |
| email  | 常用邮箱| VARCHAR(100) | No | NULL | No |
| industry  | 从事行业| VARCHAR(255) | No | NULL | No |
| income  | 年收入| VARCHAR(50) | No | NULL | No |
| edu\_background  | 学历| VARCHAR(50) | No | NULL | No |
| habbit  | 爱好| JSON | No | NULL | No |
| have\_consume  | 是否有消费| TINYINT(1) | No |  | No |
| year  | 生日年份| INT | No | 0 | No |
| month  | 生日月份| INT | No | 0 | No |
| day  | 生日日期| INT | No | 0 | No |
| other\_params  | 其他参数，透传前端传递进来的参数| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | user\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-members_invoices"></a>
## members\_invoices

> **会员发票信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| invoices\_id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| invoices\_type  | 类型 personal 个人 ；corporate 企业 | VARCHAR(15) | Yes | NULL | No |
| name  | 名称| VARCHAR(255) | Yes | NULL | No |
| telephone  | 电话号码| VARCHAR(20) | No | NULL | No |
| tax\_number  | 税号| VARCHAR(255) | No | NULL | No |
| business\_address  | 单位地址| VARCHAR(255) | No | NULL | No |
| bank  | 开户银行| VARCHAR(255) | No | NULL | No |
| bank\_account  | 银行账号| VARCHAR(255) | No | NULL | No |
| is\_def  | 是否默认| TINYINT(1) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | invoices\_id | Yes |

<a name="table-members_items_fav"></a>
## members\_items\_fav

> **会员收藏商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| fav\_id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(100) | Yes | NULL | No |
| item\_image  | 商品图片| LONGTEXT | Yes | NULL | No |
| item\_price  | 价格,单位为‘分’| INT | Yes | NULL | No |
| item\_type  | 商品类型，normal: 普通商品 pointsmall:积分商城| VARCHAR(15) | Yes | normal | No |
| point  | 积分兑换价格,item\_type=pointsmall时必须| INT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | fav\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-members_msmsend_log"></a>
## members\_msmsend\_log

> **群发短信log**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | 用户id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| send\_to\_phones  | 收信手机号| LONGTEXT | Yes | NULL | No |
| sms\_content  | 短信内容| VARCHAR(256) | Yes | NULL | No |
| operator  | 操作员信息| VARCHAR(50) | Yes | NULL | No |
| status  | 状态| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |

<a name="table-members_offine_log"></a>
## members\_offine\_log

> **会员线下实体卡日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司\_ID| BIGINT | Yes | NULL | No |
| offline\_card\_code  | 实体卡\_编号| VARCHAR(255) | Yes | NULL | No |
| username  | 姓名| VARCHAR(50) | No | NULL | No |
| sex  | 性别。0 未知 1 男 2 女| SMALLINT | No | NULL | No |
| grade\_id  | 会员等级| VARCHAR(50) | No | NULL | No |
| birthday  | 出生日期| VARCHAR(100) | No | NULL | No |
| address  | 家庭住址| VARCHAR(255) | No | NULL | No |
| email  | 常用邮箱| VARCHAR(100) | No | NULL | No |
| created\_time  | 入会日期| VARCHAR(100) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-members_operate_log"></a>
## members\_operate\_log

> **管理员修改员工操作日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| operate\_type  | log类型，mobile：修改手机号,grade\_id:修改会员等级| VARCHAR(255) | Yes | NULL | No |
| remarks  | 操作备注| VARCHAR(255) | No | NULL | No |
| old\_data  | 修改前历史数据| LONGTEXT | No | NULL | No |
| new\_data  | 新修改的数据| LONGTEXT | Yes | NULL | No |
| operater  | 管理员描述| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-members_protocol_log"></a>
## members\_protocol\_log

> **会员隐私协议记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| digest  | 摘要| VARCHAR(64) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |
| idx\_user\_id | user\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-members_rel_shop"></a>
## members\_rel\_shop

> **店铺管理会员表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| shop\_id  | 店铺id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| shop\_type  | 店铺类型| VARCHAR(15) | Yes | shop | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_shop\_id | shop\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-members_rel_tags"></a>
## members\_rel\_tags

> **会员关联标签表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id, company\_id, user\_id | Yes |

<a name="table-members_subscribe_notice"></a>
## members\_subscribe\_notice

> **订阅通知**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| sub\_id  | 订阅id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| open\_id  | open\_id| VARCHAR(40) | Yes | NULL | No |
| source  | 订阅来源 wechat:微信 alipay:支付宝| VARCHAR(10) | Yes | wechat | No |
| rel\_id  | 关联id| BIGINT | No | NULL | No |
| sub\_type  | 订阅类型。可选值有 goods:商品缺货通知| VARCHAR(255) | Yes | goods | No |
| remarks  | 订阅备注| VARCHAR(255) | No | NULL | No |
| sub\_status  | 通知状态。可选值有 NO—未通知;SUCCESS-已通知;ERROR-通知失败| VARCHAR(255) | Yes | NO | No |
| err\_reason  | 通知失败原因| VARCHAR(255) | No | NULL | No |
| updated  | | INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| distributor\_id  | 店铺id| INT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | sub\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-members_tags"></a>
## members\_tags

> **会员标签库表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| tag\_name  | 标签名称| VARCHAR(50) | Yes | NULL | No |
| description  | 标签描述| VARCHAR(255) | No | NULL | No |
| tag\_icon  | 标签icon| LONGTEXT | No | NULL | No |
| saleman\_id  | 自定义标签添加人员id| INT | Yes | 0 | No |
| tag\_status  | 标签类型，online：线上发布, self: 私有自定义| VARCHAR(32) | Yes | online | No |
| category\_id  | 分类id| INT | Yes | 0 | No |
| self\_tag\_count  | 自定义标签下会员数量| INT | Yes | 0 | No |
| tag\_color  | 标签颜色| VARCHAR(50) | Yes | NULL | No |
| font\_color  | 字体颜色| VARCHAR(50) | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| source  | 标签来源,self:商户自定义，staff:系统固定员工tag| VARCHAR(255) | Yes | self | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_source | source | No |
| idx\_tag\_name | tag\_name | No |

<a name="table-members_tags_category"></a>
## members\_tags\_category

> **标签分类**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| category\_id  | 标签分类id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| category\_name  | 标签分类名称| VARCHAR(50) | Yes | NULL | No |
| sort  | 排序| BIGINT | Yes | 1 | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | category\_id | Yes |

<a name="table-members_wechat_fans"></a>
## members\_wechat\_fans

> **微信粉丝表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| unionid  | 第三方unionid| VARCHAR(40) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 公众号appid| VARCHAR(64) | Yes | NULL | No |
| subscribed  | 是否订阅| TINYINT(1) | No | NULL | No |
| open\_id  | open\_id| VARCHAR(40) | Yes | NULL | No |
| nickname  | 昵称| VARCHAR(255) | Yes | NULL | No |
| sex  | 性别。0 未知；1 男；2 女| SMALLINT | No | NULL | No |
| city  | 市| VARCHAR(255) | No | NULL | No |
| country  | 国| VARCHAR(255) | No | NULL | No |
| province  | 省| VARCHAR(255) | No | NULL | No |
| language  | 语言| VARCHAR(255) | No | NULL | No |
| headimgurl  | | VARCHAR(255) | No | NULL | No |
| subscribe\_time  | 订阅时间| INT | No | NULL | No |
| remark  | 备注| VARCHAR(255) | No | NULL | No |
| groupid  | | INT | No | NULL | No |
| tagids  | | VARCHAR(255) | No | NULL | No |
| tagpop  | 列表标签弹出框所需字段| TINYINT(1) | Yes |  | No |
| remarkpop  | 列表页备注弹出框所需字段| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | unionid | Yes |
| idx\_company\_id | company\_id | No |
| idx\_openid | open\_id | No |

<a name="table-members_wechatusers"></a>
## members\_wechatusers

> **微信会员表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 小程序或者公众号appid| VARCHAR(64) | Yes | NULL | No |
| open\_id  | open\_id| VARCHAR(40) | Yes | NULL | No |
| unionid  | union\_id| VARCHAR(40) | Yes | NULL | No |
| nickname  | 昵称| VARCHAR(500) | No | NULL | No |
| headimgurl  | 头像url| VARCHAR(255) | No | NULL | No |
| inviter\_id  | 来源id| INT | No | 0 | No |
| source\_from  | 来源类型 default默认| VARCHAR(255) | No | default | No |
| need\_transfer  | 是否需要迁移。0:不用迁移或迁移完成；1:需要迁移| TINYINT(1) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id, authorizer\_appid, open\_id, unionid | Yes |
| idx\_unionid | unionid | No |
| idx\_openid | open\_id | No |

<a name="table-members_whitelist"></a>
## members\_whitelist

> **会员白名单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| whitelist\_id  | 白名单id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| name  | 名称| VARCHAR(500) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | whitelist\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_mobile | mobile | No |
| mobile\_company | mobile, company\_id | Yes |

<a name="table-merchant"></a>
## merchant

> **商户表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| settlement\_apply\_id  | 入驻申请id| BIGINT | No | NULL | No |
| merchant\_name  | 商户名称| VARCHAR(255) | No | NULL | No |
| merchant\_type\_id  | 商户类型ID| BIGINT | Yes | NULL | No |
| settled\_type  | 商户入驻类型。enterprise:企业;soletrader:个体户| VARCHAR(255) | Yes |  | No |
| social\_credit\_code\_id  | 统一社会信用代码| VARCHAR(255) | No | NULL | No |
| province  | | VARCHAR(50) | No | NULL | No |
| city  | | VARCHAR(50) | No | NULL | No |
| area  | | VARCHAR(50) | No | NULL | No |
| regions\_id  | 国家行政区划编码组合，逗号隔开| LONGTEXT | No | NULL | No |
| address  | 详细地址| VARCHAR(255) | No | NULL | No |
| legal\_name  | 联系人| VARCHAR(500) | Yes | NULL | No |
| legal\_cert\_id  | 法人身份证号码| VARCHAR(255) | Yes |  | No |
| legal\_mobile  | 法人手机号码| VARCHAR(255) | No | NULL | No |
| email  | 联系邮箱| VARCHAR(255) | No | NULL | No |
| bank\_acct\_type  | 银行账户类型：1-对公；2-对私| VARCHAR(10) | Yes |  | No |
| card\_id\_mask  | 结算银行卡号| VARCHAR(255) | No | NULL | No |
| bank\_name  | 结算银行卡所属银行名称| VARCHAR(100) | No | NULL | No |
| bank\_mobile  | 银行预留手机号| VARCHAR(255) | No | NULL | No |
| license\_url  | 营业执照图片url| VARCHAR(255) | No | NULL | No |
| legal\_certid\_front\_url  | 法人手持身份证正面url| VARCHAR(255) | No | NULL | No |
| legal\_cert\_id\_back\_url  | 法人手持身份证反面url| VARCHAR(255) | No | NULL | No |
| bank\_card\_front\_url  | 结算银行卡正面url| VARCHAR(255) | No | NULL | No |
| contract\_url  | 合同url| VARCHAR(255) | No | NULL | No |
| settled\_succ\_sendsms  | 入驻成功发送时间  1:立即 2:商家H5确认入驻协议后| VARCHAR(10) | Yes | 1 | No |
| audit\_goods  | 是否需要平台审核商品 0:不需要 1:需要| TINYINT(1) | Yes | 1 | No |
| source  | 来源 admin:平台管理员;h5:h5入驻;| VARCHAR(30) | No | h5 | No |
| disabled  | 禁用| TINYINT(1) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_settlement\_apply\_id | settlement\_apply\_id | No |
| idx\_legal\_mobile | legal\_mobile | No |

<a name="table-merchant_settlement_apply"></a>
## merchant\_settlement\_apply

> **商户入驻申请表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| is\_agree\_agreement  | 是否同意入驻协议| TINYINT(1) | Yes |  | No |
| merchant\_type\_id  | 商户类型ID| BIGINT | Yes | 0 | No |
| settled\_type  | 入驻类型。enterprise:企业;soletrader:个体户| VARCHAR(255) | No |  | No |
| merchant\_name  | 商户名称| VARCHAR(255) | No | NULL | No |
| social\_credit\_code\_id  | 统一社会信用代码| VARCHAR(255) | No | NULL | No |
| province  | | VARCHAR(50) | No | NULL | No |
| city  | | VARCHAR(50) | No | NULL | No |
| area  | | VARCHAR(50) | No | NULL | No |
| regions\_id  | 国家行政区划编码组合，逗号隔开| LONGTEXT | No | NULL | No |
| address  | 详细地址| VARCHAR(255) | No | NULL | No |
| legal\_name  | 法人姓名| VARCHAR(50) | No | NULL | No |
| legal\_cert\_id  | 法人身份证号码| VARCHAR(255) | No |  | No |
| legal\_mobile  | 法人手机号码| VARCHAR(255) | No | NULL | No |
| bank\_acct\_type  | 银行账户类型：1-对公；2-对私| VARCHAR(10) | No |  | No |
| card\_id\_mask  | 结算银行卡号| VARCHAR(255) | No | NULL | No |
| bank\_name  | 结算银行卡所属银行名称| VARCHAR(100) | No | NULL | No |
| bank\_mobile  | 银行预留手机号| VARCHAR(255) | No | NULL | No |
| license\_url  | 营业执照图片url| VARCHAR(255) | No | NULL | No |
| legal\_certid\_front\_url  | 法人手持身份证正面url| VARCHAR(255) | No | NULL | No |
| legal\_cert\_id\_back\_url  | 法人手持身份证反面url| VARCHAR(255) | No | NULL | No |
| bank\_card\_front\_url  | 结算银行卡正面url| VARCHAR(255) | No | NULL | No |
| audit\_status  | 审核状态：1:审核中 2:审核成功 3:审核驳回| VARCHAR(10) | No | 1 | No |
| audit\_memo  | 审核备注| VARCHAR(500) | No | NULL | No |
| source  | 来源 admin:平台管理员;h5:h5入驻;| VARCHAR(30) | No | h5 | No |
| audit\_goods  | 是否需要平台审核商品 0:不需要 1:需要| TINYINT(1) | Yes | 1 | No |
| disabled  | 禁用| TINYINT(1) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_audit\_status | audit\_status | No |
| idx\_settled\_type | settled\_type | No |
| idx\_source | source | No |

<a name="table-merchant_type"></a>
## merchant\_type

> **商户类型表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| name  | 商户类型名称| VARCHAR(50) | Yes | NULL | No |
| parent\_id  | 父级id, 0为顶级| BIGINT | Yes | 0 | No |
| path  | 路径| VARCHAR(255) | No | 0 | No |
| sort  | 排序| BIGINT | No | 0 | No |
| is\_show  | 是否显示| TINYINT(1) | Yes |  | No |
| level  | 等级| INT | No | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_name | name | No |
| idx\_parent\_id | parent\_id | No |

<a name="table-offline_bank_account"></a>
## offline\_bank\_account

> **线下转账收款账户**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| bank\_account\_name  | 收款账户名称| VARCHAR(50) | Yes | NULL | No |
| bank\_account\_no  | 银行账号| VARCHAR(30) | Yes | NULL | No |
| bank\_name  | 开户银行| VARCHAR(100) | Yes | NULL | No |
| china\_ums\_no  | 银联号| VARCHAR(20) | Yes | NULL | No |
| pic  | 图片| VARCHAR(255) | Yes | NULL | No |
| remark  | 备注| VARCHAR(255) | Yes | NULL | No |
| is\_default  | 是否默认| TINYINT(1) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_is\_default | is\_default | No |

<a name="table-offline_payment"></a>
## offline\_payment

> **线下转账支付订单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| total\_fee  | 订单金额，以分为单位| BIGINT UNSIGNED | Yes | NULL | No |
| pay\_fee  | 支付金额，以分为单位| BIGINT UNSIGNED | Yes | NULL | No |
| check\_status  | 审核状态。可选值有 0 待处理;1 已审核;2 已拒绝;9 已取消| SMALLINT | Yes | 0 | No |
| bank\_account\_id  | 收款账户id| BIGINT | Yes | NULL | No |
| bank\_account\_name  | 收款账户名称| VARCHAR(50) | Yes | NULL | No |
| bank\_account\_no  | 银行账号| VARCHAR(30) | Yes | NULL | No |
| bank\_name  | 开户银行| VARCHAR(100) | Yes | NULL | No |
| china\_ums\_no  | 银联号| VARCHAR(20) | Yes | NULL | No |
| pay\_account\_name  | 付款账户名| VARCHAR(100) | No |  | No |
| pay\_account\_bank  | 付款银行| VARCHAR(100) | No |  | No |
| pay\_account\_no  | 付款账号| VARCHAR(100) | No |  | No |
| pay\_sn  | 付款流水单号| VARCHAR(100) | No |  | No |
| voucher\_pic  | 付款凭证图片| JSON | Yes | NULL | No |
| transfer\_remark  | 转账备注| VARCHAR(100) | No |  | No |
| operator\_name  | 审核人| VARCHAR(50) | No |  | No |
| remark  | 审核备注| VARCHAR(500) | No |  | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_create\_time | create\_time | No |
| idx\_check\_status | check\_status | No |

<a name="table-onecode_batchs"></a>
## onecode\_batchs

> **物品批次表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| batch\_id  | 批次ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| thing\_id  | 物品ID| BIGINT | Yes | NULL | No |
| batch\_number  | 批次编号| VARCHAR(255) | Yes | NULL | No |
| batch\_name  | 批次名称| VARCHAR(255) | Yes | NULL | No |
| batch\_quantity  | 批次件数| INT | Yes | NULL | No |
| show\_trace  | 前台是否可以查看流通信息| TINYINT(1) | Yes | 1 | No |
| trace\_info  | 流通信息| JSON | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | batch\_id | Yes |

<a name="table-onecode_things"></a>
## onecode\_things

> **物品表，一物一码的物**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| thing\_id  | 物品ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| thing\_name  | 物品名称| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| price  | 官方建议售价,单位为‘分’| INT | Yes | NULL | No |
| pic  | 图片| VARCHAR(255) | Yes | NULL | No |
| intro  | 图文详情| LONGTEXT | No | NULL | No |
| batch\_total\_count  | 总批次数| INT | Yes | NULL | No |
| batch\_total\_quantity  | 总件数| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | thing\_id | Yes |

<a name="table-openapi_developer"></a>
## openapi\_developer

> **openapi开发配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| developer\_id  | developer\_id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| app\_key  | app\_key| VARCHAR(255) | Yes | NULL | No |
| app\_secret  | app\_secret| VARCHAR(255) | Yes | NULL | No |
| external\_base\_uri  | 外部请求配置uri| VARCHAR(255) | Yes | NULL | No |
| external\_app\_key  | 外部请求配置app\_key| VARCHAR(255) | Yes | NULL | No |
| external\_app\_secret  | 外部请求配置app\_secret| VARCHAR(255) | Yes | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | developer\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-operator_bind_shop"></a>
## operator\_bind\_shop

> **员工关联门店表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| operator\_id  | | BIGINT | Yes | NULL | No |
| shop\_id  | | BIGINT | Yes | NULL | No |
| bind\_status  | | TINYINT(1) | Yes | NULL | No |
| is\_shopadmin  | | TINYINT(1) | Yes | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |
| deleted\_at  | | DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | operator\_id, shop\_id | Yes |
| idx\_shop\_id | shop\_id | No |

<a name="table-operator_data_pass"></a>
## operator\_data\_pass

> **数据敏感信息申请**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| pass\_id  | 审核id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | 0 | No |
| operator\_id  | 操作者id| INT | Yes | 0 | No |
| status  | 审批状态 0:未审批 1:同意 2:驳回| INT | Yes | 0 | No |
| is\_closed  | 关闭状态: 0:未关闭 1:关闭| INT | Yes | 0 | No |
| start\_time  | 生效开始时间| INT | Yes | 0 | No |
| end\_time  | 生效结束时间| INT | Yes | 0 | No |
| rule  | 生效规则 &#039;8-18 *&#039;: 每天8到18点有效 &#039;* 1-5&#039;:周一到周五全天有效| VARCHAR(255) | Yes |  | No |
| reason  | 申请理由| VARCHAR(255) | Yes |  | No |
| remarks  | 审批备注| VARCHAR(255) | Yes |  | No |
| create\_time  | 创建时间| INT | Yes | 0 | No |
| approve\_time  | 审批时间| INT | Yes | 0 | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | pass\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_operator\_id | operator\_id | No |
| idx\_merchant\_id | merchant\_id | No |

<a name="table-operator_data_pass_log"></a>
## operator\_data\_pass\_log

> **数据敏感信息查看**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | 0 | No |
| operator\_id  | 操作者id| INT | Yes | 0 | No |
| create\_time  | 创建时间| INT | Yes | 0 | No |
| path  | 路由地址| VARCHAR(255) | Yes |  | No |
| url  | 全地址| VARCHAR(1000) | Yes |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_operator\_id | operator\_id | No |

<a name="table-operator_license"></a>
## operator\_license

> **商户许可协议表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 协议id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| type  | 许可协议类型: app| VARCHAR(255) | Yes | NULL | No |
| title  | 许可协议标题| VARCHAR(255) | Yes | NULL | No |
| content  | 许可协议内容| LONGTEXT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-operators"></a>
## operators

> **账号表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| operator\_id  | 账号id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| login\_name  | 员工账号名| VARCHAR(255) | No | NULL | No |
| operator\_type  | 操作员类型类型。admin:超级管理员;staff:员工;distributor:店铺管理员;dealer:经销商;merchant:商户;supplier:供应商;self\_delivery\_staff:自配送员| VARCHAR(255) | Yes | admin | No |
| password  | | VARCHAR(255) | No | NULL | No |
| eid  | | VARCHAR(255) | No | NULL | No |
| passport\_uid  | | VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| distributor\_ids  | 员工管理的店铺id集合| LONGTEXT | No | NULL | No |
| shop\_ids  | 员工管理的门店id集合| LONGTEXT | No | NULL | No |
| username  | 名称| VARCHAR(255) | No | NULL | No |
| head\_portrait  | 头像| VARCHAR(255) | No | NULL | No |
| regionauth\_id  | 区域id| BIGINT | Yes | 0 | No |
| contact  | 联系人姓名| VARCHAR(500) | No | NULL | No |
| split\_ledger\_info  | 分账信息| VARCHAR(255) | No | NULL | No |
| is\_disable  | 是否禁用。1:是 0:否| TINYINT(1) | No | 0 | No |
| adapay\_open\_account\_time  | adapay子商户开户时间| VARCHAR(255) | No | NULL | No |
| dealer\_parent\_id  | 经销商子账号父级id| VARCHAR(255) | No | NULL | No |
| is\_dealer\_main  | 是否是经销商主账号。1:是,0:否| TINYINT(1) | Yes | 1 | No |
| merchant\_id  | 商户id| BIGINT | No | 0 | No |
| is\_merchant\_main  | 是否是商户端超级管理员。1:是,0:否| TINYINT(1) | Yes | 0 | No |
| is\_distributor\_main  | 是否是店铺超级管理员.1:是,0:否| TINYINT(1) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | operator\_id | Yes |
| idx\_eid | eid | No |
| idx\_passportuid | passport\_uid | Yes |

<a name="table-order_epidemic_register"></a>
## order\_epidemic\_register

> **订单疫情登记表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单id| BIGINT | Yes | NULL | No |
| user\_id  | 用户ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| INT | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| name  | 登记姓名| LONGTEXT | Yes | NULL | No |
| mobile  | 手机号| LONGTEXT | Yes | NULL | No |
| cert\_id  | 身份证号| LONGTEXT | Yes | NULL | No |
| temperature  | 体温| VARCHAR(30) | Yes | NULL | No |
| job  | 职业| VARCHAR(100) | Yes | NULL | No |
| symptom  | 症状| VARCHAR(50) | Yes | NULL | No |
| symptom\_des  | 症状描述| VARCHAR(500) | No | NULL | No |
| is\_risk\_area  | 是否去过中高风险地区 1:是 0:否| INT | Yes | NULL | No |
| is\_use  | 是否使用这条登记信息 1:是 0:否| INT | Yes | 1 | No |
| order\_time  | 下单时间| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_order\_id | order\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-order_profit_sharing"></a>
## order\_profit\_sharing

> **订单资金分账**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_profit\_sharing\_id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | No | 0 | No |
| user\_id  | 用户id| BIGINT UNSIGNED | No | 0 | No |
| pay\_type  | 支付方式| VARCHAR(255) | No |  | No |
| channel\_id  | 渠道分账账户id| VARCHAR(255) | No |  | No |
| channel\_acct\_id  | 渠道分账账户号| VARCHAR(255) | No |  | No |
| total\_fee  | 分账金额，以分为单位| INT | No | NULL | No |
| status  | 订单状态。可选值有 0 1 成功 2失败| INT | No | 0 | No |
| hf\_order\_id  | 汇付接口请求id| VARCHAR(255) | No | NULL | No |
| hf\_order\_date  | 汇付接口请求日期| VARCHAR(255) | No | NULL | No |
| resp\_code  | 汇付接口请求响应码| VARCHAR(255) | No | NULL | No |
| resp\_desc  | 汇付接口请求描述| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_profit\_sharing\_id | Yes |
| idx\_company\_id\_order\_id | company\_id, order\_id | No |

<a name="table-order_profit_sharing_details"></a>
## order\_profit\_sharing\_details

> **订单资金分账详情**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_profit\_sharing\_detail\_id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| sharing\_id  | 分账ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | No | 0 | No |
| channel\_id  | 渠道分账账户id| VARCHAR(255) | No |  | No |
| channel\_acct\_id  | 渠道分账账户号| VARCHAR(255) | No |  | No |
| total\_fee  | 分账金额，以分为单位| INT | No | 0 | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_profit\_sharing\_detail\_id | Yes |
| idx\_company\_id\_order\_id | company\_id, order\_id | No |
| idx\_sharing\_id | sharing\_id | No |

<a name="table-orders_associations"></a>
## orders\_associations

> **订单主关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 公众号的appid| VARCHAR(64) | No | NULL | No |
| wxa\_appid  | 小程序的appid| VARCHAR(64) | No | NULL | No |
| title  | 订单标题| VARCHAR(255) | No | NULL | No |
| total\_fee  | 订单金额，以分为单位| BIGINT | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| shop\_id  | 店铺id| BIGINT | No | NULL | No |
| store\_name  | 店铺名称| VARCHAR(100) | No | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| promoter\_user\_id  | 推广员user\_id| BIGINT | No | NULL | No |
| promoter\_shop\_id  | 推广员店铺id，实际为推广员的user\_id| BIGINT | No | NULL | No |
| source\_id  | 订单来源id| BIGINT | No | NULL | No |
| monitor\_id  | 订单监控页面id| BIGINT | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| order\_class  | 订单种类。可选值有 normal:普通订单;groups:拼团订单;;community 社区活动订单;bargain:助力订单;seckill:秒杀订单;shopguide:导购订单| VARCHAR(255) | Yes | normal | No |
| order\_type  | 订单类型。可选值有 service 服务业订单;bargain 砍价订单;distribution 分销订单;normal 普通实体订单| VARCHAR(255) | No | NULL | No |
| order\_status  | 订单状态。可选值有 DONE—订单完成;PAYED-已支付;NOTPAY—未支付;CANCEL—已取消;WAIT\_BUYER\_CONFIRM-待用户收货| VARCHAR(255) | Yes | NULL | No |
| is\_distribution  | 是否是分销订单| TINYINT(1) | Yes |  | No |
| total\_rebate  | 订单总分销金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| delivery\_corp  | 快递公司| VARCHAR(255) | No | NULL | No |
| delivery\_code  | 快递单号| VARCHAR(255) | No | NULL | No |
| delivery\_time  | 发货时间| INT | No | NULL | No |
| member\_discount  | 会员折扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount  | 优惠券抵扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount\_desc  | 优惠券使用详情| LONGTEXT | No | NULL | No |
| member\_discount\_desc  | 会员折扣使用详情| LONGTEXT | No | NULL | No |
| delivery\_status  | 发货状态。可选值有 DONE—已发货;PENDING—待发货;PARTAIL\_DELIVERY-部分发货| VARCHAR(255) | Yes | PENDING | No |
| cancel\_status  | 取消订单状态。可选值有 NO\_APPLY\_CANCEL 未申请;WAIT\_PROCESS 等待审核;REFUND\_PROCESS 退款处理;SUCCESS 取消成功;FAILS 取消失败| VARCHAR(255) | Yes | NO_APPLY_CANCEL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| end\_time  | 订单完成时间| BIGINT | No | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |
| salesman\_id  | 导购员ID| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_type | order\_type | No |
| idx\_order\_class | order\_class | No |
| idx\_user\_id | user\_id | No |
| idx\_salesman\_id | salesman\_id | No |

<a name="table-orders_bargain"></a>
## orders\_bargain

> **砍价订单表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| title  | 订单标题| VARCHAR(255) | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| bargain\_id  | 活动id| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| item\_price  | 商品价格| VARCHAR(255) | Yes | NULL | No |
| item\_pics  | 商品图片| VARCHAR(255) | Yes | NULL | No |
| item\_num  | 购买商品数量| BIGINT | Yes | NULL | No |
| templates\_id  | 运费模板id| INT | Yes | 0 | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| freight\_fee  | 运费价格，以分为单位| INT | No | 0 | No |
| item\_fee  | 商品金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| total\_fee  | 订单金额，以分为单位| BIGINT | Yes | NULL | No |
| order\_status  | 订单状态| VARCHAR(255) | Yes | NULL | No |
| order\_type  | 订单类型| VARCHAR(255) | Yes | bargain | No |
| trade\_source  | 订单来源| VARCHAR(255) | No | NULL | No |
| receiver\_name  | 收货人姓名| VARCHAR(255) | No | NULL | No |
| receiver\_mobile  | 收货人手机号| VARCHAR(255) | No | NULL | No |
| receiver\_zip  | 收货人邮编| VARCHAR(255) | No | NULL | No |
| receiver\_state  | 收货人所在省份| VARCHAR(255) | No | NULL | No |
| receiver\_city  | 收货人所在城市| VARCHAR(255) | No | NULL | No |
| receiver\_district  | 收货人所在地区| VARCHAR(255) | No | NULL | No |
| receiver\_address  | 收货人详细地址| VARCHAR(255) | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| auto\_cancel\_time  | 订单自动取消时间| VARCHAR(255) | Yes | NULL | No |
| source\_id  | 订单来源id| BIGINT | No | NULL | No |
| monitor\_id  | 订单监控页面id| BIGINT | No | NULL | No |
| remark  | 订单备注| VARCHAR(255) | Yes | NULL | No |
| member\_discount  | 会员折扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount  | 优惠券抵扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount\_desc  | 优惠券使用详情| LONGTEXT | No | NULL | No |
| member\_discount\_desc  | 会员折扣使用详情| LONGTEXT | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |
| third\_params  | 第三方特殊字段存储| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |

<a name="table-orders_cancel_orders"></a>
## orders\_cancel\_orders

> **已付钱订单取消退款记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| cancel\_id  | 取消ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商id| BIGINT | Yes | 0 | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| order\_type  | 订单类型。可选值有 service 服务业订单;bargain 砍价订单;distribution 分销订单;normal 普通实体订单| VARCHAR(255) | No | NULL | No |
| total\_fee  | 订单金额，以分为单位| BIGINT UNSIGNED | Yes | NULL | No |
| progress  | 处理进度。可选值有 0 待处理;1 已取消;2 处理中;3 已完成; 4 已驳回| SMALLINT | Yes | 0 | No |
| cancel\_from  | 取消来源。可选值有 buyer 用户取消订单;shop 商家取消订单| VARCHAR(255) | Yes | buyer | No |
| cancel\_reason  | 取消原因| VARCHAR(300) | No | NULL | No |
| shop\_reject\_reason  | 商家拒绝理由| VARCHAR(300) | No | NULL | No |
| refund\_status  | 退款状态。可选值有 READY 待审核;AUDIT\_SUCCESS 审核成功待退款;SUCCESS 退款成功;SHOP\_CHECK\_FAILS 商家审核不通过;CANCEL 撤销退款;PROCESSING 已发起退款等待到账;FAILS 退款失败;| VARCHAR(30) | Yes | READY | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |
| point  | 消费积分| INT UNSIGNED | No | 0 | No |
| pay\_type  | 支付方式| VARCHAR(255) | No |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | cancel\_id | Yes |
| idx\_order\_id | order\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-orders_cart"></a>
## orders\_cart

> **购物车**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| cart\_id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| promoter\_user\_id  | 推广员user\_id| BIGINT | No | NULL | No |
| user\_ident  | 会员ident,会员信息和session生成的唯一值| VARCHAR(50) | No | NULL | No |
| shop\_type  | 店铺类型；distributor:店铺，shop:门店，community:社区, mall:商城, drug 药品清单| VARCHAR(255) | No | distributor | No |
| shop\_id  | 店铺id 或者 社区id| BIGINT UNSIGNED | No | 0 | No |
| activity\_type  | 活动类型| VARCHAR(255) | No | NULL | No |
| activity\_id  | 活动id| BIGINT UNSIGNED | No | 0 | No |
| marketing\_type  | 促销类型| VARCHAR(255) | No | NULL | No |
| marketing\_id  | 促销id| BIGINT UNSIGNED | No | 0 | No |
| item\_type  | 商品类型。可选值有 normal 实体类商品;services 服务类商品, normal\_gift:实体赠品,services\_gift:服务类赠品| VARCHAR(255) | Yes | normal | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| items\_id  | 组合商品关联商品id| VARCHAR(255) | No |  | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| pics  | 图片| VARCHAR(1024) | No | NULL | No |
| num  | 购买商品数量| INT UNSIGNED | Yes | NULL | No |
| price  | 购买商品价格| INT | Yes | 0 | No |
| point  | 积分兑换价格| INT | No | 0 | No |
| wxa\_appid  | 小程序appid| VARCHAR(255) | No | NULL | No |
| is\_checked  | 购物车是否选中| TINYINT(1) | Yes | 1 | No |
| is\_plus\_buy  | 是加价购商品| TINYINT(1) | Yes |  | No |
| source\_type  | 购物车数据来源：scancode：扫码加入购物车, normal:正常加入购物车,salesperson:业务员导购下单| VARCHAR(255) | Yes | normal | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | cart\_id | Yes |
| idx\_item\_id | item\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_promoter\_user\_id | promoter\_user\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_shop\_type | shop\_type | No |
| idx\_wxa\_appid | wxa\_appid | No |
| idx\_is\_checked | is\_checked | No |

<a name="table-orders_delivery"></a>
## orders\_delivery

> **订单发货单表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| orders\_delivery\_id  | orders\_delivery\_id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| order\_id  | 订单id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| delivery\_corp  | 快递公司| VARCHAR(255) | Yes | NULL | No |
| delivery\_corp\_name  | 快递公司名称| VARCHAR(255) | Yes | NULL | No |
| delivery\_code  | 快递单号| VARCHAR(255) | Yes | NULL | No |
| delivery\_time  | 发货时间| INT | Yes | NULL | No |
| delivery\_corp\_source  | 快递代码来源| VARCHAR(255) | No | NULL | No |
| receiver\_mobile  | 收货人手机号| VARCHAR(255) | No | NULL | No |
| package\_type  | 订单包裹类型 batch 整单发货  sep拆单发货| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| self\_delivery\_operator\_id  | 自配送员id| BIGINT | No | 0 | No |
| delivery\_remark  | 配送备注| VARCHAR(255) | No | NULL | No |
| delivery\_pics  | 配送图片| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | orders\_delivery\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_id | order\_id | No |
| idx\_supplier\_id | supplier\_id | No |

<a name="table-orders_delivery_items"></a>
## orders\_delivery\_items

> **订单发货单商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| orders\_delivery\_items\_id  | orders\_delivery\_items\_id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单id| BIGINT | Yes | NULL | No |
| order\_items\_id  | 订单items表id| BIGINT | Yes | NULL | No |
| orders\_delivery\_id  | 订单发货单id| BIGINT | Yes | NULL | No |
| goods\_id  | 产品id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| num  | 发货数量| INT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| pic  | 商品图片| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | orders\_delivery\_items\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_order\_id | order\_id | No |
| idx\_orders\_delivery\_id | orders\_delivery\_id | No |

<a name="table-orders_diagnosis"></a>
## orders\_diagnosis

> **问诊单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| VARCHAR(64) | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| kuaizhen\_store\_id  | 580门店Id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| service\_type  | 服务类型，0为图文，1为视频| SMALLINT | Yes | NULL | No |
| is\_examine  | 是否需要审方（0为不需要，1为需要）| SMALLINT | Yes | NULL | No |
| is\_pregnant\_woman  | 用药人是否孕妇（0为否，1为是）| SMALLINT | Yes | NULL | No |
| is\_lactation  | 用药人是否哺乳期0为否，1为是| SMALLINT | Yes | NULL | No |
| souce\_from  | 来源（0为微信小程序，1为APP，2为H5，3为支付宝小程序）| SMALLINT | Yes | 0 | No |
| user\_family\_name  | 用药人姓名| VARCHAR(255) | Yes | NULL | No |
| user\_family\_id\_card  | 用药人身份证号| VARCHAR(255) | Yes |  | No |
| user\_family\_age  | 用药人年龄| INT | Yes | NULL | No |
| user\_family\_gender  | 用药人性别1-男，2-女| SMALLINT | Yes | NULL | No |
| user\_family\_phone  | 用药人手机号码| VARCHAR(255) | Yes | NULL | No |
| relationship  | 用药人与问诊人关系(1本人 2父母 3配偶 4子女 5其他)| SMALLINT | Yes | NULL | No |
| before\_ai\_data\_list  | AI问诊前5道题| LONGTEXT | No | NULL | No |
| prescription\_status  | 开方状态，1未开方，2已开方，3医生拒绝开方| SMALLINT | Yes | 1 | No |
| prescription\_refuse\_reason  | 拒绝开方原因| VARCHAR(255) | Yes |  | No |
| location\_url  | 跳转问诊H5页面地址| LONGTEXT | Yes |  | No |
| status  | 问诊单状态（1为进行中，2为已完成,5-AI问诊时取消）| SMALLINT | Yes | 1 | No |
| end\_time  | 问诊结束时间| INT | Yes | 0 | No |
| cancel\_time  | 问诊取消时间| INT | Yes | 0 | No |
| doctor\_office  | 医生科室| VARCHAR(255) | Yes |  | No |
| doctor\_name  | 医生姓名| VARCHAR(255) | Yes |  | No |
| hospital\_name  | 互联网医院名称| VARCHAR(255) | Yes |  | No |
| first\_visit\_list  | 首诊信息| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_status | status | No |

<a name="table-orders_invoice"></a>
## orders\_invoice

> **订单发票表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| invoice\_apply\_bn  | 发票申请单号| VARCHAR(64) | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| regionauth\_id  | 区域id| BIGINT | No | NULL | No |
| order\_id  | 订单id，多订单以英文逗号分隔| VARCHAR(255) | Yes | NULL | No |
| invoice\_type  | 开票类型，企业enterprise,和个人individual| VARCHAR(20) | Yes | NULL | No |
| company\_title  | 公司抬头| VARCHAR(255) | Yes | NULL | No |
| company\_tax\_number  | 公司税号| VARCHAR(64) | No | NULL | No |
| company\_address  | 公司地址| VARCHAR(255) | No | NULL | No |
| company\_telephone  | 公司电话| VARCHAR(20) | No | NULL | No |
| bank\_name  | 开户银行| VARCHAR(255) | No | NULL | No |
| bank\_account  | 开户账号| VARCHAR(64) | No | NULL | No |
| email  | 电子邮箱| VARCHAR(255) | No | NULL | No |
| mobile  | 手机号码| VARCHAR(20) | No | NULL | No |
| invoice\_status  | 开票状态：待开票：pending，开票中：inProgress，开票成功：success，已作废：waste，开票失败：failed| VARCHAR(20) | Yes | pending | No |
| invoice\_amount  | 开票金额，以分为单位| INT | No | 0 | No |
| invoice\_file\_url  | 发票文件地址| VARCHAR(255) | No | NULL | No |
| invoice\_method  | 开票类型：线上和线下| VARCHAR(20) | Yes | online | No |
| invoice\_source  | 开票来源：user客户端,oms| VARCHAR(20) | Yes | NULL | No |
| remark  | 备注| VARCHAR(255) | No | NULL | No |
| is\_oms  | 是否推送OMS，0是未推送，1是已推送| INT | Yes | 0 | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_invoice\_apply\_bn | invoice\_apply\_bn | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_order\_id | order\_id | No |

<a name="table-orders_invoice_item"></a>
## orders\_invoice\_item

> **订单发票商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| invoice\_id  | 关联发票表id| BIGINT | Yes | NULL | No |
| invoice\_apply\_bn  | 发票申请单号| VARCHAR(64) | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | Yes | NULL | No |
| oid  | OMS系统订单ID| VARCHAR(64) | No | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| item\_bn  | 商品编码| VARCHAR(64) | No | NULL | No |
| main\_img  | 商品主图| VARCHAR(255) | No | NULL | No |
| spec\_info  | 商品规格| VARCHAR(255) | No | NULL | No |
| num  | 数量| INT | Yes | NULL | No |
| amount  | 金额，以分为单位| INT | Yes | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_invoice\_id | invoice\_id | No |
| idx\_invoice\_apply\_bn | invoice\_apply\_bn | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_order\_id | order\_id | No |

<a name="table-orders_invoice_log"></a>
## orders\_invoice\_log

> **订单发票日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| invoice\_id  | 关联发票表id| BIGINT | Yes | NULL | No |
| operator\_type  | 操作类型| VARCHAR(20) | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| operator\_id  | 操作人id| BIGINT | No | NULL | No |
| operator\_content  | 操作内容| JSON | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_invoice\_id | invoice\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_operator\_id | operator\_id | No |

<a name="table-orders_invoices"></a>
## orders\_invoices

> **发票表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| invoice\_id  | 关联发票表id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| invoice\_type  | 开票类型，红red,和蓝blue| VARCHAR(20) | Yes | NULL | No |
| invoice\_no  | 发票号码| VARCHAR(255) | No | NULL | No |
| invoice\_code  | 发票代码| VARCHAR(255) | No | NULL | No |
| invoice\_time  | 开票时间| VARCHAR(255) | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_invoice\_id | invoice\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-orders_items_rel_profit"></a>
## orders\_items\_rel\_profit

> **订单商品分润表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| order\_profit\_status  | 0 无效分润 1 冻结分润 2 分润成功| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| total\_fee  | 订单金额，以分为单位| BIGINT | No | NULL | No |
| profit\_type  | 分润类型 1 总部分润 2 自营门店分润 3 加盟门店分润| SMALLINT | Yes | NULL | No |
| user\_id  | 购买用户id| BIGINT | Yes | 0 | No |
| dealer\_id  | 区域经销商id| BIGINT | Yes | 0 | No |
| distributor\_id  | 拉新门店id| BIGINT | Yes | 0 | No |
| order\_distributor\_id  | 下单当前所在门店id| BIGINT | Yes | 0 | No |
| distributor\_nid  | 拉新导购当前所在门店id| BIGINT | Yes | 0 | No |
| seller\_id  | 拉新导购id| BIGINT | Yes | 0 | No |
| popularize\_distributor\_id  | 推广门店id| BIGINT | Yes | 0 | No |
| popularize\_seller\_id  | 推广导购id| BIGINT | Yes | 0 | No |
| proprietary  | 判断拉新门店 0 无门店 1 自营门店 2 加盟门店| BIGINT | Yes | 0 | No |
| popularize\_proprietary  | 判断推广门店 0 无门店 1 自营门店 2 加盟门店| BIGINT | Yes | 0 | No |
| dealers  | 区域经销商分成| BIGINT | Yes | 0 | No |
| distributor  | 拉新门店分成| BIGINT | Yes | 0 | No |
| seller  | 拉新导购分成（分给门店）| BIGINT | Yes | 0 | No |
| popularize\_distributor  | 推广门店分成| BIGINT | Yes | 0 | No |
| popularize\_seller  | 推广导购分成（分给门店）| BIGINT | Yes | 0 | No |
| commission  | 总部手续费| BIGINT | Yes | 0 | No |
| rule  | 分润规则| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_orderid\_userid\_companyid | order\_id, user\_id, company\_id | No |

<a name="table-orders_merchant_trade"></a>
## orders\_merchant\_trade

> **企业付款账单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| merchant\_trade\_id  | 商家支付交易单号| VARCHAR(32) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| rel\_scene\_id  | 关联支付场景ID| VARCHAR(255) | No | NULL | No |
| rel\_scene\_name  | 关联支付场景名称| VARCHAR(255) | No | NULL | No |
| mch\_appid  | 商户APPId| VARCHAR(32) | No | NULL | No |
| mchid  | 商户号| VARCHAR(32) | No | NULL | No |
| payment\_action  | 商户支付方式| VARCHAR(32) | Yes | NULL | No |
| check\_name  | 是否强验用户姓名| VARCHAR(11) | Yes | NULL | No |
| mobile  | 支付手机号| VARCHAR(32) | No | NULL | No |
| re\_user\_name  | 收款用户姓名| VARCHAR(255) | No | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| open\_id  | 用户openId| VARCHAR(255) | No | NULL | No |
| amount  | 付款金额(分)| BIGINT | Yes | NULL | No |
| payment\_desc  | 付款备注| VARCHAR(255) | Yes | NULL | No |
| spbill\_create\_ip  | ip地址| VARCHAR(255) | Yes | NULL | No |
| status  | 支付状态。可选值有 NOT\_PAY:未付款;PAYING:付款中;SUCCESS:付款成功;FAIL:付款失败| VARCHAR(255) | Yes | NULL | No |
| payment\_no  | 微信支付订单号| VARCHAR(64) | No | NULL | No |
| payment\_time  | 微信支付成功时间| VARCHAR(255) | No | NULL | No |
| error\_code  | 支付错误code码| VARCHAR(255) | No | NULL | No |
| error\_desc  | 支付错误描述| VARCHAR(255) | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| cur\_fee\_type  | 系统配置货币类型| VARCHAR(5) | Yes | CNY | No |
| cur\_fee\_rate  | 系统配置货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| cur\_fee\_symbol  | 系统配置货币符号| VARCHAR(255) | Yes | ￥ | No |
| cur\_pay\_fee  | 系统货币支付金额| VARCHAR(255) | Yes | NULL | No |
| hf\_order\_id  | 汇付请求订单号| VARCHAR(255) | No | NULL | No |
| hf\_order\_date  | 汇付请求日期| VARCHAR(255) | No | NULL | No |
| hf\_cash\_type  | 汇付取现方式 T0：T0取现; T1：T1取现 D1：D1取现| VARCHAR(255) | No | NULL | No |
| user\_cust\_id  | 汇付商户客户号| VARCHAR(255) | No | NULL | No |
| bind\_card\_id  | 汇付取现银行卡id| VARCHAR(255) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | merchant\_trade\_id | Yes |

<a name="table-orders_normal_orders"></a>
## orders\_normal\_orders

> **实体订单表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| title  | 订单标题| VARCHAR(255) | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| cost\_fee  | 商品成本价，以分为单位| INT UNSIGNED | Yes | NULL | No |
| commission\_fee  | 佣金(分)| INT | Yes | 0 | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| act\_id  | 营销活动ID，团购ID，社区拼团ID，秒杀活动ID等| BIGINT | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| order\_class  | 订单种类。可选值有 normal:普通订单;groups:拼团订单;;community 社区活动订单;bargain:助力订单;seckill:秒杀订单;shopguide:导购订单;pointsmall:积分商城;excard:兑换券| VARCHAR(255) | Yes | normal | No |
| freight\_fee  | 运费价格，以分为单位| INT | No | 0 | No |
| freight\_type  | 运费类型-用于积分商城 cash:现金 point:积分| VARCHAR(255) | Yes | cash | No |
| item\_fee  | 商品金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| total\_fee  | 订单金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| market\_fee  | 销售价总金额，以分为单位| VARCHAR(255) | No | NULL | No |
| step\_paid\_fee  | 分阶段付款已支付金额，以分为单位| INT UNSIGNED | No | 0 | No |
| total\_rebate  | 订单总分销金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| is\_rate  | 是否评价| TINYINT(1) | No | 0 | No |
| receipt\_type  | 收货方式。可选值有 【logistics 物流】【ziti 店铺自提】【dada 达达同城配】【merchant 商家自配】| VARCHAR(255) | Yes | logistics | No |
| ziti\_code  | 店铺自提码| BIGINT | Yes | 0 | No |
| ziti\_status  | 店铺自提状态。可选值有 PENDING:等待自提;DONE:自提完成;NOTZITI:自提完成; APPROVE:审核通过,药品自提需要审核| VARCHAR(255) | No | NOTZITI | No |
| self\_delivery\_status  | 店铺自配送状态。可选值有 CONFIRMING:等待确认;RECEIVEORDER:已接单;PACKAGED:已打包;DELIVERING:配送中;DONE:已送达;NOTMERCHANT:不是自配送;| VARCHAR(255) | No | NOTMERCHANT | No |
| order\_status  | 订单状态。可选值有 DONE—订单完成;NOTPAY—未支付;PART\_PAYMENT-部分付款;WAIT\_GROUPS\_SUCCESS-等待拼团成功;PAYED-已支付;CANCEL—已取消;WAIT\_BUYER\_CONFIRM-待用户收货| VARCHAR(255) | Yes | NULL | No |
| pay\_status  | 支付状态。可选值有 NOTPAY—未支付;PAYED-已支付;ADVANCE\_PAY-预付款完成;TAIL\_PAY-支付尾款中| VARCHAR(255) | Yes | NOTPAY | No |
| order\_source  | 订单来源。可选值有 member-用户自主下单;shop-商家代客下单 salesperson:业务员导购下单| VARCHAR(255) | No | member | No |
| order\_holder  | 订单归属。可选值 self-自营订单;distributor-商家订单;supplier-供应商订单;self\_supplier-自营和供应商订单| VARCHAR(20) | No | self | No |
| order\_type  | 订单类型。可选值有 normal:普通实体订单| VARCHAR(255) | Yes | normal | No |
| auto\_cancel\_time  | 订单自动取消时间| VARCHAR(255) | Yes | NULL | No |
| auto\_finish\_time  | 订单自动完成时间| VARCHAR(255) | No | NULL | No |
| is\_distribution  | 是否分销订单| TINYINT(1) | Yes |  | No |
| source\_id  | 订单来源id| BIGINT | No | NULL | No |
| monitor\_id  | 订单监控页面id| BIGINT | No | NULL | No |
| salesman\_id  | 导购员ID| BIGINT | No | 0 | No |
| delivery\_corp  | 快递公司| VARCHAR(255) | No | NULL | No |
| delivery\_corp\_source  | 快递代码来源| VARCHAR(255) | No | NULL | No |
| delivery\_code  | 快递单号| VARCHAR(255) | No | NULL | No |
| delivery\_img  | 快递发货凭证| VARCHAR(255) | No | NULL | No |
| delivery\_time  | 发货时间| INT | No | NULL | No |
| end\_time  | 订单完成时间| BIGINT | No | NULL | No |
| delivery\_status  | 发货状态。可选值有 DONE—已发货;PENDING—待发货;PARTAIL-部分发货| VARCHAR(255) | Yes | PENDING | No |
| cancel\_status  | 取消订单状态。可选值有 NO\_APPLY\_CANCEL 未申请;WAIT\_PROCESS 等待审核;REFUND\_PROCESS 退款处理;SUCCESS 取消成功;FAILS 取消失败| VARCHAR(255) | Yes | NO_APPLY_CANCEL | No |
| receiver\_name  | 收货人姓名| VARCHAR(500) | No | NULL | No |
| receiver\_mobile  | 收货人手机号| VARCHAR(255) | No | NULL | No |
| receiver\_zip  | 收货人邮编| VARCHAR(255) | No | NULL | No |
| receiver\_state  | 收货人所在省份| VARCHAR(255) | No | NULL | No |
| receiver\_city  | 收货人所在城市| VARCHAR(255) | No | NULL | No |
| receiver\_district  | 收货人所在地区| VARCHAR(255) | No | NULL | No |
| receiver\_address  | 收货人详细地址| LONGTEXT | No | NULL | No |
| member\_discount  | 会员折扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount  | 优惠券抵扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| discount\_fee  | 订单优惠金额，以分为单位| INT | Yes | 0 | No |
| discount\_info  | 订单优惠详情| LONGTEXT | No | NULL | No |
| coupon\_discount\_desc  | 优惠券使用详情| LONGTEXT | No | NULL | No |
| member\_discount\_desc  | 会员折扣使用详情| LONGTEXT | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |
| item\_point  | 商品消费总积分| INT UNSIGNED | No | 0 | No |
| point  | 消费积分| INT UNSIGNED | No | 0 | No |
| pay\_type  | 支付方式| VARCHAR(255) | No |  | No |
| pay\_channel  | adapay支付渠道| VARCHAR(255) | No |  | No |
| remark  | 订单备注| VARCHAR(255) | No | NULL | No |
| third\_params  | 第三方特殊字段存储| JSON | No | NULL | No |
| invoice  | 发票信息| JSON | No | NULL | No |
| invoice\_number  | 发票号| VARCHAR(255) | No |  | No |
| is\_invoiced  | 是否已开发票| TINYINT(1) | No | 0 | No |
| send\_point  | 是否分发积分0否 1是| INT | Yes | 0 | No |
| is\_online\_order  | 是否为线上订单| TINYINT(1) | Yes | 1 | No |
| is\_profitsharing  | 是否分账订单 1不分账 2分账| INT | No | 1 | No |
| profitsharing\_status  | 分账状态 1未分账 2已分账| INT | No | 1 | No |
| profitsharing\_rate  | 分账费率| INT | No | NULL | No |
| order\_auto\_close\_aftersales\_time  | 自动关闭售后时间| INT | No | 0 | No |
| type  | 订单类型，0普通订单,1跨境订单,....其他| INT | Yes | 0 | No |
| taxable\_fee  | 计税总价，以分为单位| INT UNSIGNED | Yes | 0 | No |
| identity\_id  | 身份证号码| VARCHAR(18) | No |  | No |
| identity\_name  | 身份证姓名| VARCHAR(20) | No |  | No |
| total\_tax  | 总税费| INT | Yes | 0 | No |
| audit\_status  | 跨境订单审核状态 approved成功 processing审核中 rejected审核拒绝| VARCHAR(255) | No | processing | No |
| audit\_msg  | 审核意见| VARCHAR(255) | No | 正在审核订单 | No |
| point\_fee  | 积分抵扣金额，以分为单位| INT | No | 0 | No |
| point\_use  | 积分抵扣使用的积分数| INT | No | 0 | No |
| uppoint\_use  | 积分抵扣商家补贴的积分数(基础积分-使用的升值积分)| INT UNSIGNED | No | 0 | No |
| point\_up\_use  | 积分抵扣使用的积分升值数| INT UNSIGNED | No | 0 | No |
| get\_point\_type  | 获取积分类型，0 老订单按订单完成时送,1 新订单按下单时计算送| INT | Yes | 0 | No |
| pack  | 包装| VARCHAR(255) | No | NULL | No |
| is\_shopscreen  | 是否门店订单| TINYINT(1) | No |  | No |
| is\_logistics  | 门店缺货商品总部快递发货| TINYINT(1) | No |  | No |
| get\_points  | 订单获取积分| INT UNSIGNED | No | 0 | No |
| extra\_points  | 订单获取额外积分| INT UNSIGNED | No | 0 | No |
| bonus\_points  | 购物赠送积分| INT UNSIGNED | No | 0 | No |
| bind\_auth\_code  | 订单订单验证码| VARCHAR(10) | No |  | No |
| sale\_salesman\_distributor\_id  | 销售导购店铺id| BIGINT UNSIGNED | Yes | 0 | No |
| bind\_salesman\_id  | 绑定导购员ID| BIGINT | No | 0 | No |
| bind\_salesman\_distributor\_id  | 绑定导购店铺id| BIGINT UNSIGNED | Yes | 0 | No |
| chat\_id  | 客户群ID| VARCHAR(32) | No |  | No |
| is\_consumption  | 是否处理了增加消费金额，0未处理,1已处理| INT | Yes | 0 | No |
| app\_pay\_type  | 支付类型 01：微信正扫 02：支付宝正扫 03：银联正扫 05：微信公众号 06：支付宝小程序/生活号 07：微信小程序 08：微信正扫(直连) 09：微信app支付(直连) 10：银联app支付 11：apple支付 12：微信H5支付(直连) 13：支付宝app支付(直连)| VARCHAR(255) | No | 07 | No |
| distributor\_remark  | 商家备注| VARCHAR(255) | Yes | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| self\_delivery\_operator\_id  | 自配送员id| BIGINT | No | 0 | No |
| self\_delivery\_fee  | 操作者id| INT | No | 0 | No |
| self\_delivery\_time  | 自配送预约时间| INT | No | 0 | No |
| self\_delivery\_end\_time  | 自配送送达时间| BIGINT | No | NULL | No |
| subdistrict\_parent\_id  | 街道id| BIGINT | Yes | NULL | No |
| subdistrict\_id  | 社区id| BIGINT | Yes | NULL | No |
| building\_number  | 楼栋号| VARCHAR(20) | Yes | NULL | No |
| house\_number  | 门牌号| VARCHAR(20) | Yes | NULL | No |
| operator\_id  | 操作者id| INT | No | 0 | No |
| left\_aftersales\_num  | 剩余可申请售后的数量| INT UNSIGNED | Yes | 0 | No |
| source\_from  | 订单来源 pc,h5,wxapp,aliapp,unknow,dianwu| VARCHAR(10) | No | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| original\_order\_id  | 拆单前原始订单号| BIGINT | No | NULL | No |
| offline\_payment\_status  | 线下支付状态：-1-未上传转账凭证；0-待处理；1-已审核；2-已拒绝；9-已取消| SMALLINT | No | -1 | No |
| prescription\_status  | 开方状态，0不需要开方，1未开方，2已开方，处方药开方后才能继续支付| INT | Yes | 0 | No |
| invoice\_status  | 开票状态。可选值有 DONE—已开票;PENDING—待开票;PARTAIL-部分开票| VARCHAR(255) | Yes | PENDING | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |
| idx\_order\_type | order\_type | No |
| idx\_order\_class | order\_class | No |
| idx\_shop\_id | shop\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_salesman\_id | salesman\_id | No |
| idx\_order\_source | order\_source | No |
| idx\_create\_time | create\_time | No |
| idx\_merchant\_id | merchant\_id | No |
| idx\_supplier\_id | supplier\_id | No |
| idx\_order\_holder | order\_holder | No |
| idx\_66c5819c17fbd9b018f167a7dfd85ba9 | order\_status, pay\_type, is\_profitsharing, profitsharing\_status, order\_auto\_close\_aftersales\_time | No |
| idx\_prescription\_status | prescription\_status | No |

<a name="table-orders_normal_orders_items"></a>
## orders\_normal\_orders\_items

> **实体订单明细表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| goods\_id  | 产品id| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| item\_bn  | 商品编码| VARCHAR(255) | No | NULL | No |
| goods\_bn  | 商品spu编码| VARCHAR(255) | No | NULL | No |
| cost\_fee  | 商品成本价，以分为单位| INT UNSIGNED | Yes | NULL | No |
| commission\_fee  | 佣金(分)| INT | Yes | 0 | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| act\_id  | 营销活动ID，团购ID，社区拼团ID，秒杀活动ID等| BIGINT | No | NULL | No |
| is\_total\_store  | 是否是总部库存(true:总部库存，false:店铺库存)| TINYINT(1) | No | 1 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| item\_unit  | 商品计量单位| VARCHAR(255) | No | NULL | No |
| pic  | 商品图片| VARCHAR(255) | No | NULL | No |
| num  | 购买商品数量| INT UNSIGNED | Yes | NULL | No |
| price  | 单价，以分为单位| INT UNSIGNED | Yes | NULL | No |
| cost\_price  | 原价价，以分为单位| INT UNSIGNED | Yes | 0 | No |
| market\_price  | 原价，以分为单位| INT UNSIGNED | Yes | 0 | No |
| total\_fee  | 订单金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| rebate  | 单个分销金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| total\_rebate  | 总分销金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| templates\_id  | 运费模板id| INT | Yes | 0 | No |
| item\_fee  | 商品总金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| member\_discount  | 会员折扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount  | 优惠券抵扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| discount\_fee  | 订单优惠金额，以分为单位| INT | Yes | 0 | No |
| discount\_info  | 订单优惠详情| LONGTEXT | No | NULL | No |
| add\_service\_info  | 订单商品附加信息| LONGTEXT | No | NULL | No |
| order\_item\_type  | 订单商品类型,normal:正常商品，gift: 赠品, plus\_buy: 加价购商品| VARCHAR(255) | Yes | normal | No |
| coupon\_discount\_desc  | 优惠券使用详情| LONGTEXT | No | NULL | No |
| member\_discount\_desc  | 会员折扣使用详情| LONGTEXT | No | NULL | No |
| is\_rate  | 是否评价| TINYINT(1) | No | 0 | No |
| auto\_close\_aftersales\_time  | 自动关闭售后时间| INT | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| delivery\_corp  | 快递公司| VARCHAR(255) | No | NULL | No |
| delivery\_code  | 快递单号| VARCHAR(255) | No | NULL | No |
| delivery\_img  | 快递发货凭证| VARCHAR(255) | No | NULL | No |
| delivery\_time  | 发货时间| INT | No | NULL | No |
| delivery\_status  | 发货状态。可选值有 DONE—已发货;PENDING—待发货| VARCHAR(255) | Yes | PENDING | No |
| aftersales\_status  | 售后状态。可选值有 WAIT\_SELLER\_AGREE 0 等待商家处理;WAIT\_BUYER\_RETURN\_GOODS 1 商家接受申请，等待消费者回寄;WAIT\_SELLER\_CONFIRM\_GOODS 2 消费者回寄，等待商家收货确认;SELLER\_REFUSE\_BUYER 3 售后驳回;SELLER\_SEND\_GOODS 4 卖家重新发货 换货完成;REFUND\_SUCCESS 5 退款成功;REFUND\_CLOSED 6 退款关闭;CLOSED 7 售后关闭| VARCHAR(255) | No | NULL | No |
| refunded\_fee  | 退款金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |
| item\_point  | 商品积分| INT UNSIGNED | No | 0 | No |
| point  | 商品总积分| INT UNSIGNED | No | 0 | No |
| item\_spec\_desc  | 商品规格描述| LONGTEXT | No | NULL | No |
| volume  | 商品体积| INT UNSIGNED | No | 0 | No |
| weight  | 商品重量| DOUBLE PRECISION | No | 0 | No |
| type  | 订单类型，0普通订单,1跨境订单,....其他| INT | Yes | 0 | No |
| tax\_rate  | 商品税率| VARCHAR(6) | No |  | No |
| cross\_border\_tax  | 商品跨境税费| INT | Yes | 0 | No |
| origincountry\_name  | 产地国名称| VARCHAR(50) | No |  | No |
| origincountry\_img\_url  | 产地国国旗| VARCHAR(255) | No |  | No |
| point\_fee  | 积分抵扣时分摊的积分的金额，以分为单位| INT | No | 0 | No |
| is\_logistics  | 门店缺货商品总部快递发货| TINYINT(1) | No |  | No |
| share\_points  | 积分抵扣时分摊的积分值| INT | No | 0 | No |
| up\_share\_points  | 积分抵扣时分摊的积分升值数| INT UNSIGNED | No | 0 | No |
| taxable\_fee  | 计税总价，以分为单位| INT UNSIGNED | Yes | 0 | No |
| delivery\_item\_num  | 发货单发货数量| INT | No | NULL | No |
| cancel\_item\_num  | 取消数量| INT | No | NULL | No |
| get\_points  | 商品获取积分| INT UNSIGNED | No | 0 | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| is\_prescription  | 是否为处方药商品,0否 1是| INT | Yes | 0 | No |
| is\_invoice  | 是否开票,0否 1是| INT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_order\_id | company\_id, order\_id | No |
| idx\_order\_id | order\_id | No |

<a name="table-orders_operate_logs"></a>
## orders\_operate\_logs

> **订单操作日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 订单操作日志| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司Id| BIGINT | Yes | NULL | No |
| operator\_id  | 操作员Id| BIGINT | No | NULL | No |
| supplier\_id  | 供应商ID| BIGINT | Yes | 0 | No |
| operator  | 操作员| VARCHAR(255) | No | NULL | No |
| operator\_role  | 操作角色,buyer:购买者;seller:卖家;shopadmin:平台操作员;system:系统| VARCHAR(100) | No | NULL | No |
| behavior  | 操作行为,create:创建;update:修改;payed:支付;delivery:发货；confirm:收货；cancel:取消；refund:退款；reship:退货；exchange:换货；mark:修改备注；finish:完成；| VARCHAR(100) | No | NULL | No |
| log\_text  | 操作内容| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| order\_id | order\_id | No |
| operator\_id | operator\_id | No |
| company\_id | company\_id | No |

<a name="table-orders_prescription"></a>
## orders\_prescription

> **问诊单开方数据**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| VARCHAR(64) | Yes | NULL | No |
| diagnosis\_id  | 问诊单id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| prescription\_id  | 快诊580处方ID| BIGINT | Yes | NULL | No |
| hospital\_name  | 互联网医院名称| VARCHAR(255) | Yes | NULL | No |
| kuaizhen\_store\_id  | 580门店Id| BIGINT | Yes | NULL | No |
| kuaizhen\_store\_name  | 580门店名称| VARCHAR(255) | Yes | NULL | No |
| kuaizhen\_diagnosis\_id  | 580问诊单ID| BIGINT | Yes | NULL | No |
| doctor\_sign\_time  | 医生签署时间(时间戳)| BIGINT | Yes | NULL | No |
| doctor\_office  | 医生科室| VARCHAR(255) | Yes | NULL | No |
| doctor\_id  | 医生id| BIGINT | Yes | NULL | No |
| doctor\_name  | 医生姓名| VARCHAR(255) | Yes | NULL | No |
| user\_family\_name  | 就诊人姓名| VARCHAR(255) | Yes | NULL | No |
| user\_family\_phone  | 就诊人手机号码| VARCHAR(255) | Yes |  | No |
| user\_family\_age  | 就诊人年龄| INT | Yes | NULL | No |
| user\_family\_gender  | 就诊人性别，0未知，1男，2女| SMALLINT | Yes | NULL | No |
| user\_family\_id\_card  | 用药人身份证号| VARCHAR(255) | Yes |  | No |
| tags  | 诊断标签| VARCHAR(255) | Yes | NULL | No |
| status  | 处方状态(1正常 2已作废)| SMALLINT | Yes | NULL | No |
| memo  | 备注| VARCHAR(255) | Yes |  | No |
| remarks  | 补充说明| VARCHAR(255) | Yes |  | No |
| reason  | 审核不通过的理由（可能为空）| VARCHAR(255) | Yes |  | No |
| dst\_file\_path  | 处方图片地址| VARCHAR(255) | Yes | NULL | No |
| serial\_no  | 处方编号| VARCHAR(255) | Yes | NULL | No |
| drug\_rsp\_list  | 药品信息说明| LONGTEXT | No | NULL | No |
| audit\_status  | 处方审核状态，1未审核，2审核通过，3审核不通过，4不需要审方| SMALLINT | Yes | 1 | No |
| audit\_time  | 审方时间| INT | Yes | 0 | No |
| audit\_reason  | 审方不通过原因| VARCHAR(255) | Yes |  | No |
| audit\_apothecary\_name  | 审方药师名称| VARCHAR(255) | Yes |  | No |
| is\_deleted  | 是否已废弃, 0否  1是| SMALLINT | Yes | 0 | No |
| delete\_time  | 废弃时间| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |
| idx\_diagnosis\_id | diagnosis\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_status | status | No |
| idx\_is\_deleted | is\_deleted | No |
| idx\_user\_family\_name | user\_family\_name | No |
| idx\_user\_family\_phone | user\_family\_phone | No |
| idx\_user\_family\_id\_card | user\_family\_id\_card | No |
| idx\_doctor\_name | doctor\_name | No |
| idx\_serial\_no | serial\_no | No |
| idx\_audit\_apothecary\_name | audit\_apothecary\_name | No |
| idx\_audit\_status | audit\_status | No |

<a name="table-orders_process_log"></a>
## orders\_process\_log

> **订单流程记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| operator\_type  | 操作类型 用户:user 导购:salesperon 管理员:admin 系统:system| VARCHAR(20) | Yes | NULL | No |
| operator\_id  | 操作员id| BIGINT | No | 0 | No |
| operator\_name  | 操作员名字| VARCHAR(255) | No |  | No |
| remarks  | 订单操作备注| VARCHAR(30) | Yes | NULL | No |
| detail  | 订单操作detail| LONGTEXT | Yes | NULL | No |
| params  | 提交参数| JSON | No | NULL | No |
| is\_show  | C端是否可见| TINYINT(1) | No |  | No |
| pics  | 图片记录| JSON | No | NULL | No |
| delivery\_remark  | 订单发货备注| VARCHAR(255) | No | NULL | No |
| create\_time  | 订单操作时间| INT | Yes | NULL | No |
| update\_time  | 订单操作| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |

<a name="table-orders_rel_chinaumspay_division"></a>
## orders\_rel\_chinaumspay\_division

> **订单关联银联商务分账表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| status  | 划付状态 0:待处理、1:已上传、2:无需处理| VARCHAR(255) | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |
| idx\_order\_id | order\_id | No |

<a name="table-orders_rel_dada"></a>
## orders\_rel\_dada

> **实体订单关联达达同城配表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| dada\_status  | 达达状态 0:待处理,1:待接单,2:待取货,3:配送中,4:已完成,5:已取消,9:妥投异常之物品返回中,10:妥投异常之物品返回完成,100: 骑士到店,1000:创建达达运单失败| INT | Yes | 0 | No |
| dada\_delivery\_no  | 达达平台订单号| VARCHAR(50) | No | NULL | No |
| dada\_cancel\_from  | 订单取消原因来源 1:达达回调配送员取消；2:达达回调商家主动取消；3:达达回调系统或客服取消；11:商城系统取消；12:商城商家主动取消；13:商城消费者主动取消；| INT | Yes | NULL | No |
| dm\_id  | 达达配送员id| INT | No | NULL | No |
| dm\_name  | 配送员姓名| VARCHAR(20) | No | NULL | No |
| dm\_mobile  | 配送员手机号| VARCHAR(255) | No | NULL | No |
| pickup\_time  | 取货时间| INT | Yes | NULL | No |
| accept\_time  | 商家接单时间| INT | Yes | NULL | No |
| delivered\_time  | 送达时间| INT | Yes | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_dada\_status | dada\_status | No |

<a name="table-orders_rel_jushuitan"></a>
## orders\_rel\_jushuitan

> **订单关联聚水潭表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| o\_id  | 聚水潭内部单号| BIGINT | Yes | NULL | No |
| created  | 创建时间| INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |
| idx\_order\_id | order\_id | No |

<a name="table-orders_rel_profit"></a>
## orders\_rel\_profit

> **订单分润表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单id| BIGINT | Yes | NULL | No |
| order\_profit\_status  | 0 无效分润 1 冻结分润 2 分润成功| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| total\_fee  | 分润完成之后金额，以分为单位| BIGINT | No | NULL | No |
| pay\_fee  | 支付订单金额，以分为单位| BIGINT | No | NULL | No |
| profit\_type  | 分润类型 1 总部分润 2 自营门店分润 3 加盟门店分润| SMALLINT | Yes | NULL | No |
| user\_id  | 购买用户id| BIGINT | Yes | 0 | No |
| dealer\_id  | 区域经销商id| BIGINT | Yes | 0 | No |
| distributor\_id  | 拉新门店id| BIGINT | Yes | 0 | No |
| order\_distributor\_id  | 下单当前所在门店id| BIGINT | Yes | 0 | No |
| distributor\_nid  | 拉新导购当前所在门店id| BIGINT | Yes | 0 | No |
| seller\_id  | 拉新导购id| BIGINT | Yes | 0 | No |
| popularize\_distributor\_id  | 推广门店id| BIGINT | Yes | 0 | No |
| popularize\_seller\_id  | 推广导购id| BIGINT | Yes | 0 | No |
| proprietary  | 判断拉新门店 0 无门店 1 自营门店 2 加盟门店| BIGINT | Yes | 0 | No |
| popularize\_proprietary  | 判断推广门店 0 无门店 1 自营门店 2 加盟门店| BIGINT | Yes | 0 | No |
| dealers  | 区域经销商分成| BIGINT | Yes | 0 | No |
| distributor  | 拉新门店分成| BIGINT | Yes | 0 | No |
| seller  | 拉新导购分成（分给门店）| BIGINT | Yes | 0 | No |
| popularize\_distributor  | 推广门店分成| BIGINT | Yes | 0 | No |
| popularize\_seller  | 推广导购分成（分给门店）| BIGINT | Yes | 0 | No |
| commission  | 总部手续费| BIGINT | Yes | 0 | No |
| rule  | 分润规则| JSON | No | NULL | No |
| plan\_close\_time  | 计划结算时间| BIGINT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-orders_rel_promotions"></a>
## orders\_rel\_promotions

> **商品促销和订单关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| moid  | 主订单id| BIGINT | Yes | NULL | No |
| coid  | 子订单id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| order\_type  | 订单类型| VARCHAR(255) | Yes | normal | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| item\_type  | 商品类型| VARCHAR(255) | No | normal | No |
| activity\_id  | 活动id| BIGINT | Yes | NULL | No |
| activity\_name  | 活动名称| VARCHAR(255) | No | NULL | No |
| activity\_type  | 活动类型| VARCHAR(255) | Yes | NULL | No |
| activity\_tag  | 活动标签| VARCHAR(255) | No | NULL | No |
| activity\_desc  | 活动描述| LONGTEXT | No | NULL | No |
| shop\_id  | 店铺id| BIGINT | No | 0 | No |
| shop\_type  | 店铺类型| VARCHAR(255) | No | shop | No |
| status  | 促销应用状态,valid:有效, invalid:失效| VARCHAR(255) | No | valid | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_moid | moid | No |
| idx\_user\_id | user\_id | No |
| idx\_activity\_id | activity\_id | No |
| idx\_shop\_id | shop\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-orders_rel_supplier"></a>
## orders\_rel\_supplier

> **实体订单关联供应商**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | NULL | No |
| freight\_fee  | 运费价格，以分为单位| INT | No | 0 | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_supplier\_order\_id | supplier\_id, order\_id | No |

<a name="table-orders_rel_ziti"></a>
## orders\_rel\_ziti

> **实体订单关联自提信息**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| name  | 自提点名称| VARCHAR(255) | Yes | NULL | No |
| lng  | 纬度| VARCHAR(255) | No | NULL | No |
| lat  | 经度| VARCHAR(255) | No | NULL | No |
| province  | 省| VARCHAR(255) | No | NULL | No |
| city  | 市| VARCHAR(255) | No | NULL | No |
| area  | 区| VARCHAR(255) | No | NULL | No |
| address  | 地址| VARCHAR(255) | No | NULL | No |
| contract\_phone  | 联系电话| VARCHAR(20) | Yes | NULL | No |
| pickup\_date  | 自提日期| VARCHAR(20) | Yes | NULL | No |
| pickup\_time  | 自提时间| VARCHAR(20) | Yes | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |

<a name="table-orders_rights"></a>
## orders\_rights

> **权益表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| rights\_id  | 权益ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| can\_reservation  | 是否可预约| TINYINT(1) | Yes |  | No |
| rights\_name  | 权益标题| VARCHAR(255) | Yes | NULL | No |
| rights\_subname  | 权益子标题| VARCHAR(255) | No | NULL | No |
| rights\_from  | 权益来源| VARCHAR(255) | No | NULL | No |
| operator\_desc  | 操作员信息| VARCHAR(255) | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| total\_num  | 服务商品原始总次数,0标示无限制| BIGINT | Yes | 0 | No |
| total\_consum\_num  | 总消耗次数| BIGINT | Yes | 0 | No |
| start\_time  | 权益开始时间| INT | Yes | NULL | No |
| end\_time  | 权益结束时间| INT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | No | NULL | No |
| label\_infos  | 权益的物料信息json结构| LONGTEXT | No | NULL | No |
| status  | 权益状态; valid:有效的, expire:过期的; invalid:失效的| VARCHAR(255) | Yes | valid | No |
| is\_not\_limit\_num  | 限制核销次数,1:不限制；2:限制| INT | Yes | 2 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | rights\_id | Yes |

<a name="table-orders_rights_detail"></a>
## orders\_rights\_detail

> **权益详细ID**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| rights\_id  | 权益ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| label\_id  | 数值属性ID| BIGINT | Yes | NULL | No |
| label\_name  | 数值属性名称| VARCHAR(255) | Yes | NULL | No |
| total\_num  | 服务商品原始总次数| BIGINT | Yes | NULL | No |
| total\_consum\_num  | 总消耗次数| BIGINT | Yes | 0 | No |
| start\_time  | 权益开始时间| VARCHAR(255) | Yes | NULL | No |
| end\_time  | 权益结束时间| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | rights\_id, item\_id | Yes |

<a name="table-orders_rights_log"></a>
## orders\_rights\_log

> **权益日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| rights\_log\_id  | 权益日志ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| rights\_id  | 权益ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| shop\_id  | 门店ID| VARCHAR(255) | Yes | NULL | No |
| rights\_name  | 权益标题| VARCHAR(255) | Yes | NULL | No |
| rights\_subname  | 权益子标题| VARCHAR(255) | No | NULL | No |
| consum\_num  | 消耗次数| BIGINT | Yes | NULL | No |
| attendant  | 服务员| VARCHAR(255) | Yes | NULL | No |
| salesperson\_mobile  | 核销员手机号| VARCHAR(255) | Yes | NULL | No |
| end\_time  | 权益结束时间| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | rights\_log\_id | Yes |

<a name="table-orders_rights_operate_logs"></a>
## orders\_rights\_operate\_logs

> **权益操作日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 权益延期操作日志| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| rights\_id  | 权益ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| remark  | 操作备注| VARCHAR(255) | Yes | NULL | No |
| operator\_id  | 操作员Id| BIGINT | No | NULL | No |
| operator  | 操作员| VARCHAR(255) | No | NULL | No |
| original\_date  | 延期之前日期| INT | No | NULL | No |
| delay\_date  | 延期之后日期| INT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-orders_rights_transfer_logs"></a>
## orders\_rights\_transfer\_logs

> **权益转赠表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 权益延期操作日志| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| rights\_id  | 权益ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| transfer\_user\_id  | 转让用户id| BIGINT | Yes | NULL | No |
| mobile  | 用户手机号| VARCHAR(255) | Yes | NULL | No |
| transfer\_mobile  | 转让用户手机号| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| remark  | 操作备注| VARCHAR(255) | Yes | NULL | No |
| operator\_id  | 操作员Id| BIGINT | No | NULL | No |
| operator  | 操作员| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-orders_user_invoice"></a>
## orders\_user\_invoice

> **订单发票**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| VARCHAR(64) | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| status  | 是否开票| INT | Yes | 0 | No |
| invoice  | 发票信息| LONGTEXT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-pages_open_screen_ad"></a>
## pages\_open\_screen\_ad

> **开屏广告设置**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 设置id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| ad\_material  | 广告素材| VARCHAR(255) | Yes | NULL | No |
| is\_enable  | 是否启用0否,1是| INT | Yes | 0 | No |
| show\_time  | 曝光设置：first,always| VARCHAR(255) | Yes | first | No |
| position  | 倒计时位置：right\_top,right\_bottom| VARCHAR(255) | Yes | 0 | No |
| is\_jump  | 是否跳过0否,1是| INT | Yes | 0 | No |
| material\_type  | 素材类型1图片,2视频| INT | Yes | 1 | No |
| waiting\_time  | 等待时间，秒| INT | Yes | 0 | No |
| ad\_url  | 广告链接| VARCHAR(1000) | Yes | NULL | No |
| app  | 设置应用, all 全部,app APP,wapp 小程序 | VARCHAR(100) | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_id | id | No |
| ix\_company\_id | company\_id | No |

<a name="table-pages_template"></a>
## pages\_template

> **页面模板表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| pages\_template\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| INT | No | 0 | No |
| template\_title  | 模板名称| VARCHAR(50) | Yes | NULL | No |
| template\_name  | 模板客户端名称| VARCHAR(50) | Yes | NULL | No |
| template\_pic  | 模板封面| VARCHAR(255) | No | NULL | No |
| template\_type  | 模板类型 0总部  1同步模板 2门店自有模板| INT | Yes | 0 | No |
| element\_edit\_status  | 可编辑挂件状态  1启用 2未启用| INT | No | 2 | No |
| status  | 启用状态 1启用 2未启用| INT | No | 2 | No |
| timer\_status  | 定时启用状态 1启用 2未启用| INT | No | 2 | No |
| timer\_time  | 定时模板切换时间| INT | No | NULL | No |
| template\_status\_modify\_time  | 模板状态变更时间| INT | No | NULL | No |
| weapp\_pages  | 模版页面| VARCHAR(255) | No | NULL | No |
| template\_content  | 模板内容| LONGTEXT | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |
| deleted\_at  | | DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | pages\_template\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-pages_template_set"></a>
## pages\_template\_set

> **模板设置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| index\_type  | 首页类型 1总部首页 2店铺首页| INT | No | 1 | No |
| pages\_template\_id  | 关联模版ID| BIGINT | No | 0 | No |
| is\_enforce\_sync  | 店铺首页同步状态 1强制同步 2非强制同步| INT | No | 2 | No |
| is\_open\_recommend  | 开启猜你喜欢 1开启 2关闭| INT | No | 2 | No |
| is\_open\_wechatapp\_location  | 开启小程序定位 1开启 2关闭| INT | No | 1 | No |
| is\_open\_scan\_qrcode  | 开启扫码功能 1开启 2关闭| INT | No | 2 | No |
| is\_open\_official\_account  | 开启关注公众号组件 1开启 2关闭| INT | No | 2 | No |
| tab\_bar  | 小程序菜单设置| LONGTEXT | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-point_member"></a>
## point\_member

> **用户积分表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| point  | 积分个数| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | user\_id, company\_id | Yes |

<a name="table-point_member_log"></a>
## point\_member\_log

> **用户积分记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 积分记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| journal\_type  | 积分交易类型，1:注册送积分 2.推荐送分 3.充值返积分 4.推广注册返积分 5.积分换购 6.储值兑换积分 7.订单返积分 8.会员等级返佣 9.取消订处理积分 10.售后处理积分 11.大转盘抽奖送积分 12:管理员手动调整积分 13.外部开发者同步进来的会员积分 14:会员信息导入，初始化积分 15:会员信息导入，更新会员调整积分; 16 活动报名送积分| SMALLINT | Yes | NULL | No |
| point\_desc  | 积分描述| VARCHAR(255) | Yes |  | No |
| income  | 入账积分| INT UNSIGNED | Yes | 0 | No |
| outcome  | 出账积分| INT UNSIGNED | Yes | 0 | No |
| order\_id  | 订单号(充值)| VARCHAR(64) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| external\_id  | 外部唯一标识，外部调用方自定义的值| VARCHAR(50) | Yes |  | No |
| operater  | 操作员名称| VARCHAR(50) | Yes |  | No |
| operater\_remark  | 操作员备注| VARCHAR(255) | Yes |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id\_external\_id | company\_id, external\_id | No |
| idx\_company\_id\_operater | company\_id, operater | No |

<a name="table-pointsmall_items"></a>
## pointsmall\_items

> **积分商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| item\_type  | 商品类型，services：服务商品，normal: 普通商品| VARCHAR(15) | Yes | services | No |
| item\_category  | 商品主类目| VARCHAR(15) | No | null | No |
| consume\_type  | 核销类型，every：每个物料都要核销(例如3个物料要核销3次)，all：所有物料作为一个整体核销一次(例如3个物料只需要核销1次)| VARCHAR(15) | Yes | every | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| item\_bn  | 商品编号| VARCHAR(255) | Yes | NULL | No |
| barcode  | 商品条形码| VARCHAR(255) | Yes | NULL | No |
| brief  | 简洁的描述| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| price  | 价格,单位为‘分’| INT | Yes | NULL | No |
| cost\_price  | 价格,单位为‘分’| INT | No | 0 | No |
| item\_unit  | 商品计量单位| VARCHAR(255) | No | NULL | No |
| special\_type  | 商品特殊类型 drug 处方药 normal 普通商品| VARCHAR(255) | No | normal | No |
| item\_address\_province  | 产地省| VARCHAR(255) | No | NULL | No |
| item\_address\_city  | 产地市| VARCHAR(255) | No | NULL | No |
| regions\_id  | 产地地区id| VARCHAR(255) | No | NULL | No |
| store  | 库存| INT | No | NULL | No |
| sales  | 销量| INT | No | 0 | No |
| approve\_status  | 商品状态 onsale 前台可销售，offline\_sale前端不展示，instock 不可销售| VARCHAR(255) | Yes | NULL | No |
| audit\_status  | 审核状态 approved成功 processing审核中 rejected审核拒绝| VARCHAR(255) | No | approved | No |
| audit\_reason  | 审核拒绝原因| LONGTEXT | No | NULL | No |
| market\_price  | 原价,单位为‘分’| INT | Yes | NULL | No |
| goods\_function  | 商品功能| VARCHAR(255) | No | NULL | No |
| goods\_series  | 商品系列| VARCHAR(255) | No | NULL | No |
| goods\_color  | 商品颜色| VARCHAR(255) | No | NULL | No |
| goods\_brand  | 商品品牌| VARCHAR(255) | No | NULL | No |
| is\_default  | 商品是否为默认商品| TINYINT(1) | No | 1 | No |
| default\_item\_id  | 默认商品ID| BIGINT | No | 0 | No |
| goods\_id  | 产品ID| BIGINT | No | 0 | No |
| nospec  | 商品是否为单规格| VARCHAR(255) | No | true | No |
| weight  | 商品重量| DOUBLE PRECISION | No | 0 | No |
| sort  | 商品排序| INT | Yes | 0 | No |
| templates\_id  | 运费模板id| INT | No | NULL | No |
| pics  | 图片| JSON | Yes | NULL | No |
| video\_type  | 视频类型 local:本地视频 tencent:腾讯视频| VARCHAR(255) | Yes | local | No |
| videos  | 视频| LONGTEXT | No | NULL | No |
| video\_pic\_url  | 视频封面图| LONGTEXT | No | NULL | No |
| intro  | 图文详情| LONGTEXT | No | NULL | No |
| purchase\_agreement  | 购买协议| LONGTEXT | No | NULL | No |
| is\_show\_specimg  | 详情页是否显示规格图片| TINYINT(1) | Yes |  | No |
| enable\_agreement  | 开启购买协议| TINYINT(1) | Yes |  | No |
| date\_type  | 有效期的类型, DATE\_TYPE\_FIX\_TIME\_RANGE:指定日期范围内, DATE\_TYPE\_FIX\_TERM:固定天数后| VARCHAR(255) | No | NULL | No |
| begin\_date  | 有效期开始时间| INT | No | NULL | No |
| end\_date  | 有效期结束时间| INT | No | NULL | No |
| fixed\_term  | 有效期的有效天数| INT | No | NULL | No |
| brand\_logo  | 品牌图片| VARCHAR(1024) | No | NULL | No |
| point  | 积分兑换价格| INT | No | 0 | No |
| pay\_class  | 支付方式 point积分支付 online在线支付 mix混合支付| VARCHAR(255) | No | point | No |
| volume  | 商品体积| DOUBLE PRECISION | No | NULL | No |
| brand\_id  | 品牌id| INT | No | 0 | No |
| tax\_rate  | 税率, 百分之～/100| INT | Yes | NULL | No |
| crossborder\_tax\_rate  | 跨境税率，百分比，小数点2位| VARCHAR(10) | Yes | NULL | No |
| origincountry\_id  | 产地国id| BIGINT | Yes | 0 | No |
| type  | 商品类型，0普通，1跨境商品，可扩展| INT | Yes | 0 | No |
| is\_medicine  | 是否为药品，0否 1是| SMALLINT | Yes | 0 | No |
| is\_prescription  | 是否为处方药，0否 1是| SMALLINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_default\_item\_id | default\_item\_id | No |
| ix\_item\_category | item\_category | No |
| ix\_is\_default | is\_default | No |
| ix\_goods\_id | goods\_id | No |
| ix\_default\_item\_list | company\_id, default\_item\_id, approve\_status, item\_type, item\_category | No |

<a name="table-pointsmall_items_rel_attributes"></a>
## pointsmall\_items\_rel\_attributes

> **积分商品关联属性表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| attribute\_sort  | 商品属性排序| INT | No | 0 | No |
| attribute\_id  | 商品属性id| BIGINT | Yes | NULL | No |
| attribute\_type  | 商品属性类型 unit单位，brand品牌，item\_params商品参数, item\_spec规格| VARCHAR(15) | Yes | NULL | No |
| attribute\_value\_id  | 商品属性值id| BIGINT | No | NULL | No |
| custom\_attribute\_value  | 自定义属性名称| VARCHAR(255) | No | NULL | No |
| image\_url  | 规格自定义图片| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_item\_id | item\_id | No |
| ix\_attribute\_type | attribute\_type | No |

<a name="table-pointsmall_items_rel_cats"></a>
## pointsmall\_items\_rel\_cats

> **积分商品和分类关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| category\_id  | 商品分类id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id, category\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_category\_id | category\_id | No |
| ix\_created | created | No |

<a name="table-popularize_brokerage"></a>
## popularize\_brokerage

> **分销佣金表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| brokerage\_type  | 佣金类型| VARCHAR(15) | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| user\_id  | | BIGINT | Yes | NULL | No |
| buy\_user\_id  | | BIGINT | Yes | NULL | No |
| order\_type  | 订单类型| VARCHAR(15) | Yes | NULL | No |
| source  | 佣金来源 订单,邀请等| VARCHAR(15) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| price  | 销售金额,单位为‘分’| INT | Yes | NULL | No |
| commission\_type  | 返佣类型 money 金额 point 积分| VARCHAR(15) | Yes | NULL | No |
| rebate  | 返佣金额,单位为‘分’| INT | Yes | NULL | No |
| rebate\_point  | 返佣金额,单位为‘分’| VARCHAR(15) | No | money | No |
| detail  | 佣金计算详情| LONGTEXT | Yes | NULL | No |
| is\_close  | 是否已结算| TINYINT(1) | Yes |  | No |
| plan\_close\_time  | 计划结算时间| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-popularize_brokerage_statistics"></a>
## popularize\_brokerage\_statistics

> **分销佣金统计**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_total\_price  | 分销商品总金额| BIGINT | No | 0 | No |
| rebate\_total  | 分销佣金总金额| BIGINT | No | 0 | No |
| point\_total  | 分销佣金总积分| BIGINT | Yes | 0 | No |
| no\_close\_rebate  | 未结算佣金| BIGINT | No | 0 | No |
| no\_close\_point  | 未结算佣金积分| BIGINT | Yes | 0 | No |
| cash\_withdrawal\_rebate  | 可提现佣金| BIGINT | No | 0 | No |
| cash\_withdrawal\_point  | 订单返佣中可使用积分| BIGINT | Yes | 0 | No |
| freeze\_cash\_withdrawal\_rebate  | 申请提现佣金，冻结提现佣金| BIGINT | No | 0 | No |
| payed\_rebate  | 已提现佣金| BIGINT | No | 0 | No |
| recharge\_rebate  | 充值返佣| BIGINT | No | 0 | No |
| recharge\_point  | 充值返佣金积分| BIGINT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | user\_id | Yes |
| ix\_user\_id | user\_id | No |
| ix\_company\_id | company\_id | No |

<a name="table-popularize_cash_withdrawal"></a>
## popularize\_cash\_withdrawal

> **推广员提现表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 推广员userId| VARCHAR(255) | Yes | NULL | No |
| account\_name  | 提现账号姓名| VARCHAR(255) | No | NULL | No |
| pay\_account  | 提现账号 微信为openid 支付宝为，支付账号| VARCHAR(255) | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| money  | 提现金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| status  | 提现状态| VARCHAR(255) | Yes | NULL | No |
| remarks  | 备注| VARCHAR(255) | No | NULL | No |
| pay\_type  | 提现支付类型| VARCHAR(255) | Yes | NULL | No |
| wxa\_appid  | 提现的小程序appid| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-popularize_promoter"></a>
## popularize\_promoter

> **推广员表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业ID| BIGINT | Yes | NULL | No |
| user\_id  | 会员ID| BIGINT | Yes | NULL | No |
| identity\_id  | 推广员身份ID| BIGINT | Yes | 0 | No |
| is\_subordinates  | 是否可发展下级分销员| INT | Yes | 0 | No |
| pid  | 上级会员ID| BIGINT | No | NULL | No |
| pmobile  | 上级手机号| VARCHAR(255) | No | NULL | No |
| pname  | 上级推广员名称| VARCHAR(255) | No | NULL | No |
| shop\_name  | 推广员自定义店铺名称| VARCHAR(255) | No | NULL | No |
| alipay\_name  | 推广员提现的支付宝姓名| VARCHAR(255) | No | NULL | No |
| brief  | 推广店铺描述| VARCHAR(255) | No | NULL | No |
| shop\_pic  | 推广店铺封面| VARCHAR(255) | No | NULL | No |
| alipay\_account  | 推广员提现的支付宝账号| VARCHAR(255) | No | NULL | No |
| grade\_level  | 推广员等级| INT | Yes | NULL | No |
| is\_promoter  | 是否为推广员| INT | Yes | NULL | No |
| shop\_status  | 开店状态 0 未开店 1已开店 2申请中 3禁用 4申请审核拒绝 | INT | Yes | 0 | No |
| reason  | 审核拒绝原因| VARCHAR(255) | No | NULL | No |
| disabled  | 是否有效| INT | Yes | NULL | No |
| is\_buy  | 是否有购买记录| INT | Yes | NULL | No |
| promoter\_name  | 推广员名称| VARCHAR(255) | No | NULL | No |
| regions\_id  | 地区ID| LONGTEXT | No | NULL | No |
| address  | 地址| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_pid | pid | No |
| idx\_companyid\_userid | company\_id, user\_id | No |
| idx\_identity\_id | identity\_id | No |
| idx\_is\_subordinates | is\_subordinates | No |

<a name="table-popularize_promoter_goods"></a>
## popularize\_promoter\_goods

> **推广员商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业ID| BIGINT | Yes | NULL | No |
| user\_id  | 会员ID| BIGINT | Yes | NULL | No |
| goods\_id  | 商品ID| BIGINT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-popularize_promoter_identity"></a>
## popularize\_promoter\_identity

> **推广员身份表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业ID| BIGINT | Yes | NULL | No |
| name  | 推广员身份名称| VARCHAR(255) | No | NULL | No |
| is\_subordinates  | 是否可发展下级分销员| INT | Yes | NULL | No |
| is\_default  | 是否为默认| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_companyid | company\_id | No |
| idx\_is\_subordinates | is\_subordinates | No |

<a name="table-popularize_task_brokerage"></a>
## popularize\_task\_brokerage

> **任务制返佣**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| user\_id  | | BIGINT | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| buy\_user\_id  | | BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| item\_spec\_desc  | 商品规格描述| LONGTEXT | No | NULL | No |
| price  | 价格| INT | Yes | NULL | No |
| num  | 销售数量| INT | Yes | NULL | No |
| status  | 状态| VARCHAR(255) | Yes | NULL | No |
| plan\_date  | 计划结算时间| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-popularize_task_brokerage_count"></a>
## popularize\_task\_brokerage\_count

> **任务制返佣**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| rebate\_type  | 返佣模式| VARCHAR(15) | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| item\_bn  | 商品编号| VARCHAR(255) | Yes | NULL | No |
| total\_fee  | 已完成的总销售额| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | No | NULL | No |
| item\_spec\_desc  | 商品规格描述| LONGTEXT | No | NULL | No |
| user\_id  | | BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| rebate\_conf  | 分销配置| JSON | No | NULL | No |
| rebate\_money  | 分销奖金| BIGINT | Yes | 0 | No |
| finish\_num  | 订单已完成数量| VARCHAR(255) | Yes | NULL | No |
| wait\_num  | 订单已支付，待完成数量| VARCHAR(255) | Yes | NULL | No |
| close\_num  | 订单已关闭数量，包含取消订单，售后订单| VARCHAR(255) | Yes | NULL | No |
| plan\_date  | 计划结算时间| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotion_check_in"></a>
## promotion\_check\_in

> **签到日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| create\_time  | 签到时间| INT | Yes | NULL | No |
| tag  | 标签| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotion_groups_activity"></a>
## promotion\_groups\_activity

> **拼团活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| groups\_activity\_id  | 活动ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| act\_name  | 活动名称| VARCHAR(50) | Yes | NULL | No |
| goods\_id  | 商品ID| BIGINT | Yes | NULL | No |
| group\_goods\_type  | 团购活动商品类型| VARCHAR(255) | Yes | services | No |
| pics  | 活动封面| VARCHAR(255) | Yes | NULL | No |
| act\_price  | 活动价格| BIGINT | Yes | NULL | No |
| person\_num  | 拼团人数| BIGINT | Yes | NULL | No |
| begin\_time  | 开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 结束时间| BIGINT | Yes | NULL | No |
| limit\_buy\_num  | 限买数量| BIGINT | Yes | NULL | No |
| limit\_time  | 成团时效(单位时)| INT | Yes | NULL | No |
| store  | 拼团库存| BIGINT | Yes | NULL | No |
| free\_post  | 是否包邮| TINYINT(1) | No | 1 | No |
| rig\_up  | 是否展示开团列表| TINYINT(1) | No | 1 | No |
| robot  | 成团机器人| TINYINT(1) | No | 1 | No |
| share\_desc  | 分享描述| VARCHAR(100) | No |  | No |
| disabled  | 是否禁用 true=禁用,false=启用| TINYINT(1) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | groups\_activity\_id | Yes |
| idx\_goodsid\_begintime\_endtime | goods\_id, begin\_time, end\_time | No |

<a name="table-promotion_groups_team"></a>
## promotion\_groups\_team

> **开团表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| team\_id  | 团id号| VARCHAR(100) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| act\_id  | 活动ID号| BIGINT | Yes | NULL | No |
| head\_mid  | 团长会员ID| BIGINT | Yes | NULL | No |
| begin\_time  | 开团时间| BIGINT | Yes | NULL | No |
| end\_time  | 结束时间(根据成团时效和活动结束时间算出来的)| BIGINT | Yes | NULL | No |
| join\_person\_num  | 参与人数| BIGINT | Yes | 0 | No |
| group\_goods\_type  | 团购活动商品类型| VARCHAR(255) | Yes | services | No |
| team\_status  | 状态:1.进行中2.成功3.失败| BIGINT | Yes | 1 | No |
| disabled  | 是否禁用 true=禁用,false=启用| TINYINT(1) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotion_groups_team_member"></a>
## promotion\_groups\_team\_member

> **参团表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| team\_id  | 团id号| VARCHAR(100) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| act\_id  | 活动ID号| BIGINT | Yes | NULL | No |
| member\_id  | 会员ID, 0为拼团机器人| BIGINT | No | NULL | No |
| join\_time  | 参团时间| BIGINT | Yes | NULL | No |
| order\_id  | 订单编号| VARCHAR(100) | No | NULL | No |
| group\_goods\_type  | 团购活动商品类型| VARCHAR(255) | Yes | services | No |
| member\_info  | 拼团机器人| VARCHAR(255) | No | NULL | No |
| disabled  | 是否禁用 true=禁用,false=启用| TINYINT(1) | No |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotion_user_task"></a>
## promotion\_user\_task

> **签到日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| create\_time  | 签到时间| INT | Yes | NULL | No |
| tag  | 标签| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotions_active_articles"></a>
## promotions\_active\_articles

> **活动文章表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| article\_title  | 文章标题| VARCHAR(255) | Yes | NULL | No |
| article\_subtitle  | 文章副标题| VARCHAR(255) | No | NULL | No |
| article\_content  | 文章内容| LONGTEXT | Yes | NULL | No |
| article\_cover  | 封面| LONGTEXT | Yes | NULL | No |
| directional\_url  | 跳转地址,转json| LONGTEXT | Yes | NULL | No |
| is\_show  | 是否展示,1展示 0不展示| TINYINT(1) | Yes | 1 | No |
| is\_delete  | 是否已删除,1已删除 0未删除| TINYINT(1) | Yes | 0 | No |
| sort  | 排序| BIGINT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotions_activity"></a>
## promotions\_activity

> **自动化营销活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | 活动ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| activity\_type  | 活动类型| VARCHAR(255) | Yes | NULL | No |
| title  | 活动名称| VARCHAR(255) | Yes | NULL | No |
| trigger\_condition  | 触发条件| LONGTEXT | Yes | NULL | No |
| discount\_config  | 优惠配置| LONGTEXT | Yes | NULL | No |
| sms\_params  | 发送短信相关参数| VARCHAR(255) | No | NULL | No |
| sms\_isopen  | 是否开启发送短信| VARCHAR(255) | Yes | NULL | No |
| activity\_status  | 活动状态| VARCHAR(255) | Yes | NULL | No |
| begin\_time  | 活动开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 活动结束时间| BIGINT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-promotions_bargain"></a>
## promotions\_bargain

> **砍价活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| bargain\_id  | 砍价活动ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| title  | 活动名称| VARCHAR(255) | Yes | NULL | No |
| ad\_pic  | 广告图| VARCHAR(255) | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| item\_pics  | 商品图片| VARCHAR(255) | Yes | NULL | No |
| item\_intro  | 商品详情| LONGTEXT | No | NULL | No |
| mkt\_price  | 市场价格,单位为‘分’| INT | Yes | NULL | No |
| price  | 购买价格,单位为‘分’| INT | Yes | NULL | No |
| limit\_num  | 购买限制| INT | Yes | NULL | No |
| order\_num  | 已购买数量| INT | Yes | 0 | No |
| cutdown\_rules  | 砍价规则| LONGTEXT | Yes | NULL | No |
| cutdown\_range  | 砍价范围，单位 分。值有 min 最小值;max 最大值| JSON | Yes | NULL | No |
| people\_range  | 砍价人数，单位(个)。值有 min 最小人数;max 最大人数| JSON | Yes | NULL | No |
| min\_price  | 每个人最少能看的价钱,单位为‘分’| INT | Yes | NULL | No |
| begin\_time  | 开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 结束时间| BIGINT | Yes | NULL | No |
| share\_msg  | 分享内容| VARCHAR(255) | Yes | NULL | No |
| help\_pics  | 翻牌图片| JSON | Yes | NULL | No |
| item\_id  | 商品id| VARCHAR(11) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | bargain\_id | Yes |

<a name="table-promotions_bargain_log"></a>
## promotions\_bargain\_log

> **砍价日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| bargain\_log\_id  | 砍价记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 公众号的appid| VARCHAR(64) | No | NULL | No |
| wxa\_appid  | 小程序的appid| VARCHAR(64) | No | NULL | No |
| bargain\_id  | 砍价ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| open\_id  | 微信用户标识| VARCHAR(40) | No | NULL | No |
| nickname  | 用户昵称| VARCHAR(255) | No | NULL | No |
| headimgurl  | 用户头像url| VARCHAR(255) | No | NULL | No |
| cutdown\_num  | 砍掉金额,单位为‘分’| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | bargain\_log\_id | Yes |

<a name="table-promotions_distributor"></a>
## promotions\_distributor

> **分销商营销**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 商户id| BIGINT | Yes | NULL | No |
| promotion\_type  | 营销类型| VARCHAR(255) | Yes | register | No |
| promotion\_id  | 营销id| BIGINT | Yes | NULL | No |
| distributor\_id  | 分销商id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotions_extrapoint_activity"></a>
## promotions\_extrapoint\_activity

> **积分营销活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | 活动ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| type  | 营销类型: shop:店铺额外积分,birthday:会员生日,item:商品额外积分| VARCHAR(255) | Yes | shop | No |
| title  | 活动名称| VARCHAR(255) | Yes | NULL | No |
| trigger\_condition  | 触发条件| LONGTEXT | Yes | NULL | No |
| condition\_value  | 优惠配置| INT | Yes | NULL | No |
| condition\_type  | 优惠方式: multiple:倍数, plus:增加| VARCHAR(255) | Yes | NULL | No |
| valid\_grade  | 会员级别集合| LONGTEXT | No | NULL | No |
| use\_shop  | 适用店铺: 0:全场可用,1:指定店铺可用| VARCHAR(255) | Yes | NULL | No |
| shop\_ids  | 店铺id集合| LONGTEXT | No | all | No |
| activity\_status  | 活动状态| VARCHAR(255) | Yes | NULL | No |
| begin\_time  | 活动开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 活动结束时间| BIGINT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-promotions_items_tag"></a>
## promotions\_items\_tag

> **商品的促销标签表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| promotion\_id  | 关联营销id| BIGINT | Yes | NULL | No |
| item\_id  | 关联对象id(商品ID,标签ID，品牌ID等)| BIGINT | Yes | 0 | No |
| goods\_id  | 关联商品id| BIGINT | No | 0 | No |
| tag\_type  | 标签类型: full\_discount:满折,full\_minus:满减,full\_gift:满赠, seckill: 秒杀,| VARCHAR(255) | Yes | NULL | No |
| activity\_price  | 商品活动价| BIGINT | Yes | 0 | No |
| item\_type  | 活动对象类型: normal:实体类商品,service:服务类商品,tag:标签,category:商品主类目,brand:品牌| VARCHAR(255) | Yes | normal | No |
| start\_time  | 活动开始时间| INT | Yes | NULL | No |
| end\_time  | 活动结束时间| INT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| is\_all\_items  | 是否全部商品,1:全部商品，2:非全部商品| BIGINT | Yes | 2 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_tag\_type | tag\_type | No |
| ix\_company\_id | company\_id | No |

<a name="table-promotions_limit"></a>
## promotions\_limit

> **限购活动规则表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| limit\_id  | 限购活动id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| limit\_name  | 限购活动名称| VARCHAR(50) | Yes | NULL | No |
| limit\_type  | 限购类型, 全局限购：global, 店铺限购：shop| VARCHAR(50) | No | NULL | No |
| valid\_grade  | 会员级别集合| VARCHAR(255) | Yes | NULL | No |
| rule  | 限购规则| VARCHAR(255) | Yes | NULL | No |
| start\_time  | 起始时间| INT | Yes | NULL | No |
| end\_time  | 截止时间| INT | Yes | NULL | No |
| use\_bound  | 适用范围: 1:指定商品可用,2:指定分类可用,3:指定商品标签可用,4:指定商品品牌可用| INT | Yes | 1 | No |
| tag\_ids  | 标签id集合| LONGTEXT | No | NULL | No |
| brand\_ids  | 品牌id集合| LONGTEXT | No | NULL | No |
| total\_item\_num  | 限购商品总数| INT | Yes | 0 | No |
| valid\_item\_num  | 已导入的限购商品数| INT | Yes | 0 | No |
| error\_desc  | 导入错误描述| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| source\_type  | 添加者类型：distributor| VARCHAR(20) | No | NULL | No |
| source\_id  | 添加者ID: 如店铺ID| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | limit\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-promotions_limit_category"></a>
## promotions\_limit\_category

> **限购活动分类表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| limit\_id  | 限购活动规则id| BIGINT | Yes | NULL | No |
| category\_id  | 分类id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | No | NULL | No |
| category\_level  | 分类等级| INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | limit\_id, category\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-promotions_limit_item"></a>
## promotions\_limit\_item

> **限购活动商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| limit\_id  | 限购活动规则id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT UNSIGNED | Yes | 0 | No |
| item\_id  | 商品| BIGINT | Yes | NULL | No |
| limit\_num  | 限购数量| BIGINT | Yes | NULL | No |
| item\_type  | 活动商品类型: normal:实体类商品,service:服务类商品,tag:标签,category:商品主类目,brand:品牌| VARCHAR(255) | Yes | normal | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| pics  | 商品图片| LONGTEXT | Yes | NULL | No |
| price  | 商品原价| INT | Yes | NULL | No |
| item\_spec\_desc  | 产品规格描述| VARCHAR(255) | No |  | No |
| start\_time  | 起始时间| INT | Yes | NULL | No |
| end\_time  | 截止时间| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | limit\_id, distributor\_id, item\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_item\_id | item\_id | No |
| idx\_unique\_item | company\_id, distributor\_id, item\_id | No |

<a name="table-promotions_limit_person"></a>
## promotions\_limit\_person

> **限购活动用户表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 限购活动用户记录表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| limit\_id  | 限购活动规则id| BIGINT | Yes | NULL | No |
| user\_id  | 限购活动用户id| BIGINT | Yes | NULL | No |
| item\_id  | 限购活动商品id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT UNSIGNED | Yes | 0 | No |
| number  | 数量| BIGINT | Yes | NULL | No |
| start\_time  | 起始时间| INT | Yes | NULL | No |
| end\_time  | 截止时间| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_user | distributor\_id, user\_id | No |

<a name="table-promotions_marketing_activity"></a>
## promotions\_marketing\_activity

> **各种促销活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| marketing\_id  | 营销id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| marketing\_type  | 营销类型: full\_discount:满折,full\_minus:满减,full\_gift:满赠,self\_select:任选优惠,plus\_price\_buy:加价购,member\_preference:会员优先购| VARCHAR(255) | Yes | NULL | No |
| rel\_marketing\_id  | 关联其他营销id| BIGINT | No | 0 | No |
| marketing\_name  | 营销活动名称| VARCHAR(255) | Yes | NULL | No |
| ad\_pic  | 活动广告图| VARCHAR(255) | No | NULL | No |
| marketing\_desc  | 营销活动描述| VARCHAR(255) | Yes | NULL | No |
| start\_time  | 活动开始时间| INT | Yes | NULL | No |
| end\_time  | 活动结束时间| INT | Yes | NULL | No |
| release\_time  | 活动发布时间| INT | No | NULL | No |
| used\_platform  | 适用平台:  0:全场可用,1:只用于pc端,2:小程序端,3:h5端| INT | Yes | 0 | No |
| use\_bound  | 适用范围: 0:全场可用,1:指定商品可用,2:指定分类可用,3:指定商品标签可用,4:指定商品品牌可用| INT | Yes | 0 | No |
| tag\_ids  | 标签id集合| LONGTEXT | No | NULL | No |
| brand\_ids  | 品牌id集合| LONGTEXT | No | NULL | No |
| use\_shop  | 适用店铺: 0:全场可用,1:指定店铺可用| INT | Yes | 0 | No |
| shop\_ids  | 店铺id集合| LONGTEXT | No | all | No |
| valid\_grade  | 会员级别集合| LONGTEXT | No | NULL | No |
| condition\_type  | 营销条件标准  quantity:按总件数, totalfee:按总金额| LONGTEXT | Yes | totalfee | No |
| condition\_value  | 营销规则值| LONGTEXT | Yes | NULL | No |
| in\_proportion  | 是否按比例多次赠送| TINYINT(1) | No |  | No |
| activity\_background  | 加价购活动页面背景| VARCHAR(255) | No | NULL | No |
| navbar\_color  | 加价购活动页面导航栏颜色| VARCHAR(255) | No | NULL | No |
| timeBackgroundColor  | 加价购活动页面时间背景颜色| VARCHAR(255) | No | NULL | No |
| canjoin\_repeat  | 是否上不封顶| TINYINT(1) | No |  | No |
| join\_limit  | 可参与次数| INT | Yes | 0 | No |
| free\_postage  | 是否免邮| TINYINT(1) | Yes |  | No |
| promotion\_tag  | 促销标签| VARCHAR(15) | Yes | NULL | No |
| check\_status  | 促销状态:  non-reviewed:未审核,pending:待审核,agree:审核通过,refuse:已拒绝,cancel:已取消,overdue:已过期| VARCHAR(255) | Yes | agree | No |
| reason  | 审核不通过原因| VARCHAR(500) | No | NULL | No |
| item\_type  | 活动商品类型: normal:实体类商品,service:服务类商品| VARCHAR(255) | Yes | normal | No |
| is\_increase\_purchase  | 开启加价购，满赠时启用| TINYINT(1) | No | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| source\_type  | 添加者类型：distributor| VARCHAR(20) | No | NULL | No |
| source\_id  | 添加者ID: 如店铺ID| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | marketing\_id | Yes |
| ix\_marketing\_type | marketing\_type | No |
| ix\_start\_time | start\_time | No |
| ix\_source\_id | source\_id | No |
| idx\_companyid\_starttime\_endtime | company\_id, start\_time, end\_time | No |

<a name="table-promotions_marketing_activity_category"></a>
## promotions\_marketing\_activity\_category

> **各种促销活动分类表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| marketing\_id  | 关联营销id| BIGINT | Yes | NULL | No |
| category\_id  | 关联分类id| BIGINT | Yes | NULL | No |
| marketing\_type  | 营销类型: full\_discount:满折,full\_minus:满减,full\_gift:满赠| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| category\_level  | 分类等级| INT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_marketing\_type | marketing\_type | No |
| ix\_marketing\_category | category\_id, marketing\_id | No |
| ix\_company\_id | company\_id | No |

<a name="table-promotions_marketing_activity_items"></a>
## promotions\_marketing\_activity\_items

> **各种促销活动商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| marketing\_id  | 关联营销id| BIGINT | Yes | NULL | No |
| item\_id  | 关联id(商品ID，标签ID，品牌ID等)| BIGINT | Yes | NULL | No |
| goods\_id  | 关联商品id| BIGINT | No | NULL | No |
| is\_show  | 列表页是否显示| TINYINT(1) | Yes | 1 | No |
| item\_spec\_desc  | 商品规格描述| VARCHAR(255) | No | NULL | No |
| marketing\_type  | 营销类型: full\_discount:满折,full\_minus:满减,full\_gift:满赠,self\_select:任选优惠,plus\_price\_buy:加价购,member\_preference:会员优先购| VARCHAR(255) | Yes | NULL | No |
| item\_type  | 活动商品类型: normal:实体类商品,service:服务类商品,tag:标签,category:商品主类目,brand:品牌| VARCHAR(255) | Yes | normal | No |
| item\_name  | 商品标题| VARCHAR(150) | Yes | NULL | No |
| price  | 商品价格| INT | Yes | 0 | No |
| item\_brief  | 商品简介| VARCHAR(250) | No | NULL | No |
| pics  | 商品图片| LONGTEXT | No | NULL | No |
| promotion\_tag  | 促销标签| VARCHAR(15) | Yes | NULL | No |
| start\_time  | 活动开始时间| INT | Yes | NULL | No |
| end\_time  | 活动结束时间| INT | Yes | NULL | No |
| status  | 是否生效中| TINYINT(1) | Yes | 1 | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_marketing\_type | marketing\_type | No |
| ix\_marketing\_item | item\_id, marketing\_id | No |
| ix\_company\_id | company\_id | No |

<a name="table-promotions_marketing_gift_items"></a>
## promotions\_marketing\_gift\_items

> **活动赠品列表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| marketing\_id  | 关联营销id| BIGINT | Yes | NULL | No |
| item\_id  | 关联商品id| BIGINT | Yes | NULL | No |
| item\_type  | 活动商品类型: normal:实体类商品,service:服务类商品| VARCHAR(255) | Yes | normal | No |
| item\_name  | 商品标题| VARCHAR(255) | Yes | NULL | No |
| price  | 赠品价格| INT | Yes | 0 | No |
| store  | 赠品库存| INT | Yes | 0 | No |
| gift\_num  | 赠品数量| INT | Yes | 0 | No |
| pics  | 商品图片| LONGTEXT | No | NULL | No |
| without\_return  | 退货无需退回赠品| TINYINT(1) | Yes |  | No |
| condition\_type  | 营销条件标准  quantity:按总件数, totalfee:按总金额| LONGTEXT | Yes | totalfee | No |
| filter\_full  | 赠品满足所需条件| INT | No | NULL | No |
| item\_spec\_desc  | 商品规格描述| VARCHAR(255) | No | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_item\_id | item\_id | No |
| ix\_marketing\_id | marketing\_id | No |

<a name="table-promotions_member_price"></a>
## promotions\_member\_price

> **商品会员价表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| price\_id  | 会员价ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| price  | 商品价格| JSON | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | price\_id | Yes |
| ix\_item\_id | item\_id | No |

<a name="table-promotions_notice_template"></a>
## promotions\_notice\_template

> **小程序通知消息模版**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| template\_name  | 小程序模板名称 yykweishop 微商城等| VARCHAR(255) | Yes | NULL | No |
| wxa\_template\_id  | 微信小程序通知模版库id| VARCHAR(255) | Yes | NULL | No |
| company\_id  | company\_id| BIGINT | Yes | NULL | No |
| notice\_type  | 通知类型| VARCHAR(255) | Yes | wxa 小程序 | No |
| tmpl\_type  | 模板分类| VARCHAR(255) | Yes | NULL | No |
| template\_id  | 模板id,发送小程序通知使用| VARCHAR(255) | Yes | NULL | No |
| title  | 标题| VARCHAR(255) | Yes | NULL | No |
| scenes\_name  | 发送场景| VARCHAR(255) | Yes | NULL | No |
| content  | 模板内容| LONGTEXT | Yes | NULL | No |
| is\_open  | 是否开启| TINYINT(1) | Yes | NULL | No |
| send\_time\_desc  | 短信发送触发时间描述,配置| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotions_package"></a>
## promotions\_package

> **组合促销促销规则表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| package\_id  | 组合促销规则id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| goods\_id  | 商品id| BIGINT | Yes | NULL | No |
| main\_item\_id  | 主商品id| BIGINT | Yes | NULL | No |
| main\_item\_price  | 主商品价格| BIGINT | Yes | NULL | No |
| package\_name  | 组合促销名称| VARCHAR(50) | Yes | NULL | No |
| valid\_grade  | 会员级别集合| VARCHAR(255) | Yes | NULL | No |
| used\_platform  | 0 商家全场可用|1 只能用于pc|2 只能用于wap|3 只能用于app, 使用平台| INT | No | 0 | No |
| free\_postage  | 0 包邮|1 商品| TINYINT(1) | No | 0 | No |
| package\_total\_price  | 组合促销各商品总价| INT | No | 0 | No |
| start\_time  | 起始时间| INT | Yes | NULL | No |
| end\_time  | 截止时间| INT | Yes | NULL | No |
| package\_status  | NO\_REVIEWED 未审核|PENDING 待审核|AGREE 审核通过|REFUSE 审核拒绝|CANCEL 已取消| VARCHAR(255) | No | NO_REVIEWED | No |
| reason  | 审核不通过原因| VARCHAR(255) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| source\_type  | 添加者类型：distributor| VARCHAR(20) | No | NULL | No |
| source\_id  | 添加者ID: 如店铺ID| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | package\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_created | created | No |
| idx\_package\_status | package\_status | No |

<a name="table-promotions_package_item"></a>
## promotions\_package\_item

> **组合促销商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| package\_id  | 组合促销规则id| BIGINT | Yes | NULL | No |
| item\_id  | 商品| BIGINT | Yes | NULL | No |
| default\_item\_id  | 默认商品id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_spec\_desc  | 产品规格描述| VARCHAR(255) | No |  | No |
| title  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| image\_default\_id  | 商品图片| LONGTEXT | No | NULL | No |
| package\_price  | 组合促销商品单价| INT | Yes | NULL | No |
| price  | 商品原价| INT | Yes | NULL | No |
| status  | 是否生效中 0 失效 | 1 生效| TINYINT(1) | Yes | NULL | No |
| start\_time  | 起始时间| INT | Yes | NULL | No |
| end\_time  | 截止时间| INT | Yes | NULL | No |
| is\_show  | 列表页是否显示| TINYINT(1) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | package\_id, item\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_item\_id | item\_id | No |

<a name="table-promotions_package_main_item"></a>
## promotions\_package\_main\_item

> **组合促销主商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| package\_id  | 组合促销规则id| BIGINT | Yes | NULL | No |
| main\_item\_id  | 主商品id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| goods\_id  | 商品id| BIGINT | Yes | NULL | No |
| main\_item\_price  | 主商品价格| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | package\_id, main\_item\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_goods\_id | goods\_id | No |
| idx\_main\_item\_id | main\_item\_id | No |

<a name="table-promotions_point_upvaluation"></a>
## promotions\_point\_upvaluation

> **积分升值活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | 活动ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| title  | 活动名称| VARCHAR(255) | Yes | NULL | No |
| begin\_time  | 活动开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 活动结束时间| BIGINT | No | NULL | No |
| trigger\_condition  | 触发条件| LONGTEXT | Yes | NULL | No |
| upvaluation  | 升值倍数| INT | Yes | NULL | No |
| max\_up\_point  | 每日升值积分上限| INT | Yes | NULL | No |
| valid\_grade  | 会员级别集合| LONGTEXT | No | NULL | No |
| used\_scene  | 适用场景:  1:订单抵扣| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-promotions_recommend_like_items"></a>
## promotions\_recommend\_like\_items

> **推荐喜欢商品(猜你喜欢)**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | No | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| sort  | 商品排序| INT | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-promotions_scd_rel_user"></a>
## promotions\_scd\_rel\_user

> **定向促销会员日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 营销id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| user\_id  | 企业id| BIGINT | Yes | NULL | No |
| order\_id  | 订单号id| VARCHAR(255) | Yes | NULL | No |
| discount\_fee  | 优惠金额| BIGINT | Yes | NULL | No |
| activity\_id  | 定向促销id| BIGINT | Yes | NULL | No |
| specific\_id  | 定向条件id| BIGINT | No | NULL | No |
| specific\_name  | 定向条件名称| VARCHAR(255) | No | NULL | No |
| activity\_month  | 促销月份| VARCHAR(255) | No | NULL | No |
| action\_type  | 操作方式，plus:加，less:减| VARCHAR(255) | Yes | plus | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_user\_id | user\_id | No |

<a name="table-promotions_seckill_activity"></a>
## promotions\_seckill\_activity

> **秒杀活动表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| seckill\_id  | 秒杀活动id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺ID, 多个逗号隔开| VARCHAR(255) | No | NULL | No |
| activity\_name  | 秒杀活动名称| VARCHAR(255) | No | NULL | No |
| ad\_pic  | 秒杀活动广告图| VARCHAR(255) | No | NULL | No |
| activity\_start\_time  | 秒杀开始时间| INT | Yes | NULL | No |
| activity\_end\_time  | 秒杀结束时间| INT | Yes | NULL | No |
| activity\_release\_time  | 秒杀活动发布时间| INT | Yes | NULL | No |
| is\_activity\_rebate  | 秒杀活动是否返佣| TINYINT(1) | Yes |  | No |
| is\_free\_shipping  | 秒杀活动是否包邮| TINYINT(1) | Yes |  | No |
| limit\_total\_money  | 每人累计限额| BIGINT | No | NULL | No |
| limit\_money  | 每人单笔限额| BIGINT | No | NULL | No |
| validity\_period  | 未付款订单保留时长（分钟）| INT | No | NULL | No |
| otherext  | 其他扩展字段| LONGTEXT | No | NULL | No |
| description  | 秒杀活动描述| VARCHAR(255) | No | NULL | No |
| seckill\_type  | 秒杀类型 normal正常的秒杀活动， limited\_time\_sale限时特惠| VARCHAR(255) | Yes | normal | No |
| item\_type  | 秒杀活动商品类型| VARCHAR(255) | Yes | normal | No |
| use\_bound  | 适用范围: 1:指定商品可用| INT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| source\_type  | 添加者类型：distributor| VARCHAR(20) | No | NULL | No |
| source\_id  | 添加者ID: 如店铺ID| BIGINT | No | 0 | No |
| disabled  | 是否失效| TINYINT(1) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | seckill\_id | Yes |
| ix\_item\_type | item\_type | No |
| ix\_company\_id | company\_id | No |

<a name="table-promotions_seckill_rel_goods"></a>
## promotions\_seckill\_rel\_goods

> **秒杀关联商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 关联id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| seckill\_id  | 秒杀活动id| BIGINT | Yes | NULL | No |
| seckill\_type  | 秒杀类型 normal正常的秒杀活动， limited\_time\_sale限时特惠| VARCHAR(255) | Yes | normal | No |
| item\_id  | 秒杀活动商品id| BIGINT | Yes | NULL | No |
| item\_type  | 秒杀活动商品类型。可选值有 normal-实体类;services-服务类| VARCHAR(255) | Yes | normal | No |
| is\_show  | 查询列表是否显示| TINYINT(1) | Yes | 1 | No |
| item\_spec\_desc  | 商品规格描述| VARCHAR(255) | No | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| activity\_start\_time  | 秒杀开始时间| INT | Yes | NULL | No |
| activity\_end\_time  | 秒杀结束时间| INT | Yes | NULL | No |
| activity\_release\_time  | 秒杀活动发布时间| INT | Yes | NULL | No |
| item\_title  | 秒杀活动商品名称| VARCHAR(255) | Yes | NULL | No |
| item\_pic  | 秒杀活动商品图片| LONGTEXT | No | NULL | No |
| activity\_price  | 秒杀活动价格| INT | Yes | 0 | No |
| activity\_store  | 秒杀活动库存| INT | Yes | 0 | No |
| limit\_num  | 秒杀活动限购| INT | Yes | 0 | No |
| sales\_store  | 已购买库存| INT | Yes | 0 | No |
| sort  | 商品排序| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| disabled  | 是否失效| TINYINT(1) | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_seckill\_item\_id | seckill\_id, item\_id | No |
| ix\_item\_type | item\_type | No |
| ix\_release\_time | activity\_release\_time | No |
| ix\_end\_time | activity\_end\_time | No |
| ix\_itemid\_activityreleasetime\_activityendtime | item\_id, activity\_release\_time, activity\_end\_time | No |

<a name="table-promotions_specific_crowd_discount"></a>
## promotions\_specific\_crowd\_discount

> **特定人群促销**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 营销id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业id| BIGINT | Yes | NULL | No |
| specific\_type  | 特定人群类型| VARCHAR(255) | Yes | member_tag | No |
| specific\_id  | 营销id| BIGINT | No | NULL | No |
| cycle\_type  | 周期类型,1:自然月;2:指定时段| INT | Yes | 1 | No |
| start\_time  | 开始时间| BIGINT | No | NULL | No |
| end\_time  | 结束时间| BIGINT | No | NULL | No |
| discount  | 折扣值| BIGINT | No | NULL | No |
| limit\_total\_money  | 每人累计限额| INT | No | NULL | No |
| status  | 状态，1:暂存，2:已发布, 3:停用, 4:已过期| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_status | status | No |
| ix\_specific\_id | specific\_id | No |

<a name="table-promotions_turntable_log"></a>
## promotions\_turntable\_log

> **用户大转盘中奖纪录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| prize\_title  | 奖品名称| VARCHAR(255) | Yes | NULL | No |
| prize\_type  | 奖品类型，points:积分，coupon：优惠券，coupons：优惠券包| VARCHAR(255) | Yes | NULL | No |
| act\_id  | 抽奖活动的活动id| BIGINT | Yes | NULL | No |
| prize\_value  | 奖品值| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-promotions_user_bargains"></a>
## promotions\_user\_bargains

> **用户砍价表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| bargain\_id  | 砍价ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 公众号的appid| VARCHAR(64) | No | NULL | No |
| wxa\_appid  | 公众号的appid| VARCHAR(64) | No | NULL | No |
| item\_name  | 订单标题| VARCHAR(255) | No | NULL | No |
| mkt\_price  | 市场金额,单位为‘分’| INT | Yes | NULL | No |
| price  | 购买金额,单位为‘分’| INT | Yes | NULL | No |
| cutprice\_num  | 砍价次数| INT | Yes | NULL | No |
| cutprice\_range  | 预先生成的砍价详情| JSON | Yes | NULL | No |
| cutdown\_amount  | 已砍金额,单位为‘分’| INT | Yes | 0 | No |
| is\_ordered  | 是否已下单| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | bargain\_id, user\_id | Yes |

<a name="table-refund_error_logs"></a>
## refund\_error\_logs

> **退款错误日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商id| BIGINT | Yes | 0 | No |
| wxa\_appid  | 小程序appid| VARCHAR(255) | No | NULL | No |
| data\_json  | data数据json格式| LONGTEXT | No | NULL | No |
| status  | 错误状态| VARCHAR(20) | No | NULL | No |
| error\_code  | 错误码| VARCHAR(500) | No | NULL | No |
| error\_desc  | 错误描述| LONGTEXT | No | NULL | No |
| is\_resubmit  | 是否重新提交| TINYINT(1) | No |  | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company | company\_id | No |
| idx\_merchant\_id | merchant\_id | No |
| idx\_supplier\_id | supplier\_id | No |

<a name="table-register_promotions"></a>
## register\_promotions

> **注册营销表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 注册促销活动ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| is\_open  | 是否开启| VARCHAR(255) | Yes | NULL | No |
| register\_type  | 促销类型。可选值有 general-普通;distributor-分销商| VARCHAR(255) | Yes | general | No |
| ad\_title  | 注册引导广告标题| VARCHAR(255) | No | NULL | No |
| ad\_pic  | 注册引导图片| VARCHAR(255) | Yes | NULL | No |
| register\_jump\_path  | 注册引导跳转路径| VARCHAR(500) | No | NULL | No |
| promotions\_value  | 赠送的参数| LONGTEXT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-reservation_default_work_shift"></a>
## reservation\_default\_work\_shift

> **商户配置默认排班**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| shop\_id  | 公司门店 id| BIGINT | Yes | NULL | No |
| work\_shift\_data  | 周一至周日每天的排班| LONGTEXT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | company\_id, shop\_id | Yes |

<a name="table-reservation_level_rel_service"></a>
## reservation\_level\_rel\_service

> **资源位服务项目关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| resource\_level\_id  | 资源位id| BIGINT | Yes | NULL | No |
| company\_id  | 公司 company id| BIGINT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | Yes | NULL | No |
| material\_id  | 服务项目id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | resource\_level\_id, company\_id, shop\_id, material\_id | Yes |

<a name="table-reservation_record"></a>
## reservation\_record

> **预约记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| record\_id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | Yes | NULL | No |
| shop\_name  | 门店名称| VARCHAR(100) | No | NULL | No |
| agreement\_date  | 约定日期| INT | Yes | NULL | No |
| to\_shop\_time  | 到店时间(时间戳)| INT | No | NULL | No |
| begin\_time  | 到店时间(时刻字符串)| VARCHAR(5) | Yes | NULL | No |
| end\_time  | 约定结束时刻| VARCHAR(5) | No | NULL | No |
| status  | 预约状态。可选值有 cancel-取消;-to\_the\_shop-已到店;-not\_to\_shop-未到店;-success-预约成功;-system-系统占位;| VARCHAR(255) | Yes | NULL | No |
| num  | 预约数量| INT | Yes | 1 | No |
| user\_id  | 用户user id| BIGINT | No | NULL | No |
| user\_name  | 用户名称| VARCHAR(100) | No | NULL | No |
| sex  | 用户性别| INT | No | NULL | No |
| mobile  | 预约人手机号| VARCHAR(255) | No | NULL | No |
| resource\_level\_id  | 资源位id| BIGINT | No | NULL | No |
| resource\_level\_name  | 资源位名称| VARCHAR(100) | No | NULL | No |
| rights\_id  | 服务商品id| BIGINT | No | NULL | No |
| rights\_name  | 服务商品名称| VARCHAR(100) | No | NULL | No |
| label\_id  | 服务商品id| BIGINT | No | NULL | No |
| label\_name  | 服务商品名称| VARCHAR(100) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | record\_id | Yes |

<a name="table-reservation_resource_level"></a>
## reservation\_resource\_level

> **资源位表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| resource\_level\_id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 企业company id| VARCHAR(255) | Yes | NULL | No |
| shop\_id  | 门店id| VARCHAR(255) | Yes | NULL | No |
| shop\_name  | 门店名称| VARCHAR(255) | No | NULL | No |
| name  | 资源位昵称| VARCHAR(255) | Yes | NULL | No |
| description  | 简单介绍| VARCHAR(500) | No | NULL | No |
| status  | 状态,active:有效，invalid: 失效| VARCHAR(255) | No | active | No |
| image\_url  | 图片| VARCHAR(255) | No | NULL | No |
| quantity  | 数量| VARCHAR(255) | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | resource\_level\_id | Yes |

<a name="table-reservation_setting"></a>
## reservation\_setting

> **预约配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| time\_interval  | 预约时间间隔| INT | Yes | NULL | No |
| resource\_name  | 资源位名称| VARCHAR(255) | Yes | NULL | No |
| max\_limit\_day  | 可提前预约天数| INT | Yes | NULL | No |
| min\_limit\_hour  | 可提前预约分钟数| INT | Yes | NULL | No |
| reservation\_condition  | 预约条件| INT | Yes | NULL | No |
| reservation\_mode  | 预约模式| INT | Yes | NULL | No |
| cancel\_minute  | 取消预约最少提前分钟数| INT | Yes | NULL | No |
| reservation\_num\_limit  | 预约限制| LONGTEXT | No | NULL | No |
| sms\_delay  | 预约提醒通知| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-reservation_shift_type"></a>
## reservation\_shift\_type

> **班次类型表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| type\_id  | type\_id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| type\_name  | 排班类型名称| VARCHAR(30) | Yes | NULL | No |
| begin\_time  | 排班类型名称| VARCHAR(5) | Yes | NULL | No |
| end\_time  | 排班类型名称| VARCHAR(5) | Yes | NULL | No |
| status  | 类型状态invalid/valid| VARCHAR(10) | Yes | valid | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | type\_id | Yes |

<a name="table-reservation_work_shift"></a>
## reservation\_work\_shift

> **班次类型表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| shop\_id  | 公司门店 id| BIGINT | Yes | NULL | No |
| resource\_level\_id  | 资源位id| BIGINT | Yes | NULL | No |
| work\_date  | 工作日期| BIGINT | Yes | NULL | No |
| shift\_type\_id  | 工作班次类型id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-resources"></a>
## resources

> **资源包表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| resource\_id  | 资源包id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| resource\_name  | 资源包名称| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| eid  | 企业id| VARCHAR(255) | Yes | NULL | No |
| passport\_uid  | | VARCHAR(255) | Yes | NULL | No |
| shop\_num  | 资源门店数| INT | Yes | NULL | No |
| left\_shop\_num  | 可用门店数| INT | Yes | NULL | No |
| source  | 资源来源。demo:开通试用,purchased:购买,gift:赠品| VARCHAR(255) | Yes | NULL | No |
| available\_days  | 可用天数| INT | Yes | NULL | No |
| active\_at  | 激活时间| BIGINT | Yes | NULL | No |
| expired\_at  | 过期时间| BIGINT | Yes | NULL | No |
| active\_code  | 激活码| VARCHAR(255) | No | NULL | No |
| issue\_id  | 在线开通工单号| VARCHAR(50) | No | NULL | No |
| goods\_code  | 商品code| VARCHAR(50) | No | NULL | No |
| product\_code  | 基础系统code| VARCHAR(50) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | resource\_id | Yes |

<a name="table-resources_op_log"></a>
## resources\_op\_log

> **资源操作记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| resource\_id  | 资源包id| BIGINT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | Yes | 0 | No |
| store\_name  | 门店名称| VARCHAR(100) | Yes | NULL | No |
| op\_time  | 操作时间| INT | Yes | NULL | No |
| op\_type  | 操作类型。occupy:占用资源, release:释放资源| VARCHAR(100) | Yes | NULL | No |
| op\_num  | 操作数量| INT | Yes | NULL | No |
| operator\_id  | 操作员id| BIGINT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-salesperson_active_article_share_log"></a>
## salesperson\_active\_article\_share\_log

> **活动文章表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员ID| BIGINT | Yes | NULL | No |
| article\_id  | 活动文章ID| BIGINT | Yes | NULL | No |
| article\_title  | 活动文章标题| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-salesperson_active_article_statistics"></a>
## salesperson\_active\_article\_statistics

> **导购员活动转发数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 激活id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| add\_date  | 统计日期 Ymd| INT | Yes | NULL | No |
| data\_value  | 统计数据| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_salesperson\_id | salesperson\_id | No |
| ix\_add\_date | add\_date | No |

<a name="table-salesperson_coupon_statistics"></a>
## salesperson\_coupon\_statistics

> **导购员优惠券数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| coupon\_id  | 优惠券id| BIGINT | Yes | NULL | No |
| date  | 统计日期 Ymd| BIGINT | Yes | NULL | No |
| send\_num  | 赠送张数| BIGINT | Yes | NULL | No |
| pay\_num  | 支付使用| BIGINT | Yes | NULL | No |
| receive\_num  | 领取张数| BIGINT | Yes | NULL | No |
| reg\_num  | 分享注册数| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_salesperson\_date | salesperson\_id, date | No |

<a name="table-salesperson_items_shelves"></a>
## salesperson\_items\_shelves

> ****

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 活动ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| activity\_id  | 活动id| BIGINT | Yes | NULL | No |
| activity\_type  | 活动类型 full\_discount:满折,full\_minus:满减,full\_gift:满赠,self\_select:任选优惠,plus\_price\_buy:加价购,group拼团,seckill秒杀,package打包,limited\_time\_sale限时特惠| VARCHAR(255) | Yes | NULL | No |
| distributor\_id  | 门店id, 0是所有门店| BIGINT | No | 0 | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| start\_time  | 活动开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 活动结束时间| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_activity\_type | activity\_type | No |
| ix\_item\_id | item\_id | No |

<a name="table-salesperson_leaderboard"></a>
## salesperson\_leaderboard

> **导购排名**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购id| BIGINT | Yes | NULL | No |
| date  | 日期| INT | Yes | NULL | No |
| sales  | 销售额| BIGINT | Yes | NULL | No |
| number  | 销售订单数量| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_distributor | company\_id, distributor\_id | No |

<a name="table-salesperson_leaderboard_distributor"></a>
## salesperson\_leaderboard\_distributor

> **导购店铺排名**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| date  | 日期| INT | Yes | NULL | No |
| sales  | 销售额| BIGINT | Yes | NULL | No |
| number  | 销售订单数量| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_distributor | company\_id, distributor\_id | No |

<a name="table-salesperson_notice"></a>
## salesperson\_notice

> **导购通知**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| notice\_id  | 通知id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| title  | 通知标题| VARCHAR(255) | Yes | NULL | No |
| content  | 通知内容| LONGTEXT | Yes | NULL | No |
| distributor\_id  | 店铺id| LONGTEXT | No | NULL | No |
| all\_distributor  | 店铺id| LONGTEXT | No | 0 | No |
| notice\_type  | 通知类型，1系统通知，2总部通知，3其他通知| INT | Yes | 1 | No |
| sent\_times  | 发送次数| INT | No | 0 | No |
| is\_delete  | 是否已删除| INT | No | 0 | No |
| withdraw  | 是否撤回| INT | No | 0 | No |
| last\_sent\_time  | 最后发送时间| INT | No | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |
| status  | 状态，1未发送，2已发送，3已撤回| INT | No | 1 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | notice\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_title | title | No |

<a name="table-salesperson_notice_log"></a>
## salesperson\_notice\_log

> **导购通知**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | 主键id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| notice\_id  | 通知id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| INT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_distributor\_id | distributor\_id | No |
| ix\_notice\_id | notice\_id | No |

<a name="table-salesperson_operator_log"></a>
## salesperson\_operator\_log

> **商家操作日志表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | 0 | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| operator\_id  | 操作者id| INT | Yes | 0 | No |
| request\_uri  | 请求资源信息| VARCHAR(255) | No | NULL | No |
| ip  | ip地址| VARCHAR(255) | No | NULL | No |
| params  | 请求参数| JSON | No | NULL | No |
| operator\_name  | 操作内容| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |

<a name="table-salesperson_profit_statistics"></a>
## salesperson\_profit\_statistics

> **导购员销售提成数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| date  | 统计日期 Ymd| BIGINT | Yes | NULL | No |
| unconfirmed\_seller\_fee  | 未确认绑定会员提成| BIGINT | Yes | NULL | No |
| confirm\_seller\_fee  | 已确认绑定会员提成| BIGINT | Yes | NULL | No |
| unconfirmed\_offline\_seller\_fee  | 未确认门店开单提成| BIGINT | Yes | NULL | No |
| confirm\_offline\_seller\_fee  | 已确认门店开单提成| BIGINT | Yes | NULL | No |
| unconfirmed\_popularize\_seller\_fee  | 未确认客户推广提成| BIGINT | Yes | NULL | No |
| confirm\_popularize\_seller\_fee  | 已确认客户推广提成| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_salesperson\_date | salesperson\_id, date | No |

<a name="table-salesperson_rel_coupon"></a>
## salesperson\_rel\_coupon

> **导购员优惠券数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| coupon\_id  | 优惠券id| BIGINT | Yes | NULL | No |
| send\_num  | 赠送张数| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-salesperson_rel_notice"></a>
## salesperson\_rel\_notice

> **导购通知关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| notice\_id  | 通知id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_notice\_id | notice\_id | No |
| ix\_salesperson\_id | salesperson\_id | No |

<a name="table-salesperson_sales_statistics"></a>
## salesperson\_sales\_statistics

> **导购员销售额数据统计表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| date  | 统计日期 Ymd| BIGINT | Yes | NULL | No |
| popularize\_order\_fee  | 推广销售额| BIGINT | Yes | NULL | No |
| popularize\_order\_count  | 推广订单数| BIGINT | Yes | NULL | No |
| offline\_order\_fee  | 门店开单金额| BIGINT | Yes | NULL | No |
| offline\_order\_count  | 门店开单数| BIGINT | Yes | NULL | No |
| total\_refund\_fee  | 退款金额| BIGINT | Yes | NULL | No |
| total\_refund\_count  | 退款单数| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_salesperson\_date | salesperson\_id, date | No |

<a name="table-salesperson_signup_log"></a>
## salesperson\_signup\_log

> **导购到/签退记录**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| sign\_type  | signin 签到, signout 主动签退, forceout 被动签退| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_salesperson\_id | salesperson\_id | No |

<a name="table-salesperson_task"></a>
## salesperson\_task

> **导购任务表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| task\_id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| start\_time  | 开始时间| BIGINT | Yes | NULL | No |
| end\_time  | 结束时间| BIGINT | Yes | NULL | No |
| task\_name  | 任务名称| VARCHAR(255) | Yes | NULL | No |
| task\_type  | 任务类型 1 转发分享 2 获取新客 3 客户下单 4 会员福利| SMALLINT | Yes | NULL | No |
| task\_quota  | 任务指标| SMALLINT | Yes | NULL | No |
| pics  | 任务指标| JSON | No | NULL | No |
| task\_content  | 任务内容| LONGTEXT | Yes | NULL | No |
| use\_all\_distributor  | 是否是全部店铺| TINYINT(1) | No |  | No |
| disabled  | 任务指标| VARCHAR(30) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | task\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-salesperson_task_record"></a>
## salesperson\_task\_record

> **导购任务表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| task\_id  | 任务id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购id| BIGINT | Yes | NULL | No |
| times  | 次数| SMALLINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_task | company\_id, task\_id | No |

<a name="table-salesperson_task_record_logs"></a>
## salesperson\_task\_record\_logs

> **导购任务表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| task\_id  | 任务id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 导购id| BIGINT | Yes | NULL | No |
| remark  | 任务记录备注| JSON | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-salesperson_task_rel_distributor"></a>
## salesperson\_task\_rel\_distributor

> **导购任务表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| task\_id  | ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 门店id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | task\_id, company\_id, distributor\_id | Yes |

<a name="table-self_delivery_staff"></a>
## self\_delivery\_staff

> **自配送员工信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| operator\_id  | | BIGINT | Yes | NULL | No |
| distributor\_id  | 配送员所属店铺id| INT | No | 0 | No |
| shop\_id  | 配送员所属门店id| INT | No | 0 | No |
| staff\_attribute  | 配送员属性。full\_time:全职;part\_time:兼职;| VARCHAR(255) | Yes | full_time | No |
| staff\_no  | 配送员编号。| VARCHAR(255) | No | NULL | No |
| staff\_type  | 配送员类型。platform:平台;distributor:店铺;shop:商家;| VARCHAR(255) | Yes | distributor | No |
| payment\_method  | 结算方式。order:订单;amount:订单金额;| VARCHAR(255) | Yes | order | No |
| payment\_fee  | 结合payment\_method计算使用，结算费用 分 或 百分比| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_operator\_id | operator\_id | No |

<a name="table-selfservice_form_setting"></a>
## selfservice\_form\_setting

> **自助表单配置**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| field\_title  | 表单项标题(中文描述)| VARCHAR(255) | Yes | NULL | No |
| pic\_name  | 图片描述| VARCHAR(50) | No | NULL | No |
| field\_name  | 表单项英文名称(英文或拼音描述),唯一标示| VARCHAR(255) | Yes | NULL | No |
| form\_element  | 表单元素,text:文本,textarea:文本域,select:选择框,radio:单选,checkbox:多选框,date:日期选择,time:时间选择,area:地区地址选择, image:图片上传,number:纯数字| VARCHAR(255) | No | NULL | No |
| image\_url  | 元素配图| VARCHAR(255) | No | NULL | No |
| status  | 状态;1:有效，2:弃用| INT | Yes | 1 | No |
| sort  | 排序，数字越大越靠前| INT | Yes | 1 | No |
| is\_required  | 是否必填| TINYINT(1) | Yes |  | No |
| options  | 表单元素为选择类时选择项（json）当form\_element in (select,  radio, checkbox)时，此项必填| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-selfservice_form_template"></a>
## selfservice\_form\_template

> **自助表单模板**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| tem\_name  | 表单模板名称| VARCHAR(255) | Yes | NULL | No |
| tem\_type  | 表单模板类型；ask\_answer\_paper：问答考卷，basic\_entry：基础录入| VARCHAR(255) | Yes | NULL | No |
| content  | 表单模板内容| LONGTEXT | Yes | NULL | No |
| status  | 状态; 1:有效，2:弃用| INT | Yes | 1 | No |
| key\_index  | 表单关键指数| LONGTEXT | No | NULL | No |
| form\_style  | 表单关键指数, single:单页问卷, multiple:多页问卷| VARCHAR(255) | No | NULL | No |
| header\_link\_title  | 头部文字| VARCHAR(500) | No | NULL | No |
| header\_bg\_pic  | 头部背景图片| VARCHAR(300) | No | NULL | No |
| header\_height  | 头部留白高度(px)| VARCHAR(20) | No | NULL | No |
| header\_title  | 头部文字内容| VARCHAR(500) | No | NULL | No |
| bottom\_title  | 表单关键指数| VARCHAR(500) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-selfservice_registration_activity"></a>
## selfservice\_registration\_activity

> **报名问卷活动**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| activity\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| temp\_id  | 表单模板id| BIGINT | Yes | NULL | No |
| activity\_name  | 活动名称| VARCHAR(200) | Yes | NULL | No |
| area  | 活动城市(省市)| VARCHAR(100) | No | NULL | No |
| place  | 活动地点| VARCHAR(100) | No | NULL | No |
| address  | 详情地址| VARCHAR(200) | No | NULL | No |
| intro  | 活动简介| VARCHAR(500) | No | NULL | No |
| show\_fields  | 前端展示字段| VARCHAR(100) | No | NULL | No |
| pics  | 活动轮播图| LONGTEXT | Yes | NULL | No |
| gift\_points  | 奖励积分| INT | Yes | NULL | No |
| is\_allow\_duplicate  | 是否允许重复报名(1或0)| INT | Yes | NULL | No |
| is\_allow\_cancel  | 是否允许取消报名(1或0)| INT | Yes | NULL | No |
| is\_offline\_verify  | 是否线下核销(1或0)| INT | Yes | NULL | No |
| is\_need\_check  | 是否需要审核(1或0)| INT | Yes | NULL | No |
| is\_white\_list  | 是否自动加入内购白名单(1或0)| INT | Yes | NULL | No |
| enterprise\_ids  | 内购白名单企业ID| LONGTEXT | No |  | No |
| group\_no  | 活动分组编码| VARCHAR(15) | No |  | No |
| member\_level  | 适用会员等级| VARCHAR(50) | No | NULL | No |
| distributor\_ids  | 适用店铺| VARCHAR(100) | No |  | No |
| join\_tips  | 活动参与提示信息| VARCHAR(200) | No | NULL | No |
| submit\_form\_tips  | 表单填写提示信息| LONGTEXT | No | NULL | No |
| content  | 图文详情| LONGTEXT | No | NULL | No |
| start\_time  | 活动开始时间| INT | Yes | NULL | No |
| end\_time  | 活动结束时间| INT | Yes | NULL | No |
| join\_limit  | 可参与次数| INT | Yes | 0 | No |
| is\_sms\_notice  | 是否短信通知| TINYINT(1) | Yes | 1 | No |
| is\_wxapp\_notice  | 是否小程序模板通知| TINYINT(1) | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | activity\_id | Yes |
| idx\_temp\_id | temp\_id | No |
| idx\_start\_time | start\_time | No |
| idx\_group\_no | group\_no | No |

<a name="table-selfservice_registration_activity_rel_shop"></a>
## selfservice\_registration\_activity\_rel\_shop

> **报名活动关联店铺**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| activity\_id  | 报名活动ID| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_activity\_id | activity\_id | No |
| idx\_distributor\_id | distributor\_id | No |

<a name="table-selfservice_registration_record"></a>
## selfservice\_registration\_record

> **报名记录**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| record\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| activity\_id  | 活动id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | 0 | No |
| record\_no  | 报名编号| BIGINT | Yes | 0 | No |
| group\_no  | 活动分组编码| VARCHAR(15) | No |  | No |
| form\_id  | 表单id| BIGINT | Yes | NULL | No |
| get\_points  | 获取到积分| BIGINT | Yes | NULL | No |
| verify\_code  | 核销码| BIGINT | Yes | NULL | No |
| verify\_time  | 核销时间| BIGINT | Yes | 0 | No |
| verify\_operator  | 核销员| VARCHAR(50) | No |  | No |
| true\_name  | 真实姓名| VARCHAR(30) | No |  | No |
| is\_white\_list  | 是否加入白名单| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| form\_mobile  | 表单填写手机号| VARCHAR(255) | Yes |  | No |
| wxapp\_appid  | 会员小程序appid| VARCHAR(32) | No | NULL | No |
| open\_id  | 会员小程序openid| VARCHAR(32) | No | NULL | No |
| status  | 状态: pending 待审核，passed 已通过，rejected 已拒绝, canceled 已取消, verified 已核销| VARCHAR(32) | Yes | pending | No |
| content  | 报名内容| LONGTEXT | Yes | NULL | No |
| reason  | 拒绝原因| LONGTEXT | No | NULL | No |
| remark  | 备注| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| company\_id  | 公司\_ID| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | record\_id | Yes |
| idx\_activity\_id | activity\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_true\_name | true\_name | No |
| idx\_created | created | No |
| idx\_status | status | No |
| idx\_company\_id | company\_id | No |

<a name="table-selfservice_user_daily_record"></a>
## selfservice\_user\_daily\_record

> **用户日常数据记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| operator\_id  | 操作员id| BIGINT | No | NULL | No |
| operator  | 操作员名称或手机| VARCHAR(255) | No | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| record\_date  | 记录提交日期| INT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | No | NULL | No |
| temp\_id  | 模板id| BIGINT | No | NULL | No |
| form\_data  | 记录表单内容| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-service_orders"></a>
## service\_orders

> **服务订单表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| title  | 订单标题| VARCHAR(255) | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| shop\_id  | 店铺id| BIGINT | Yes | 0 | No |
| store\_name  | 店铺名称| VARCHAR(255) | No | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| consume\_type  | 核销类型，every：每个物料都要核销(例如3个物料要核销3次)，all：所有物料作为一个整体核销一次(例如3个物料只需要核销1次)| VARCHAR(15) | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| item\_brief  | 商品描述| VARCHAR(255) | No | NULL | No |
| item\_pics  | 商品图片| VARCHAR(255) | No | NULL | No |
| source\_id  | 订单来源id| BIGINT | No | NULL | No |
| bargain\_id  | 活动id| BIGINT | No | NULL | No |
| monitor\_id  | 订单监控页面id| BIGINT | No | NULL | No |
| salesman\_id  | 导购员ID| BIGINT | No | 0 | No |
| item\_num  | 购买商品数量| VARCHAR(255) | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| total\_fee  | 订单金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| step\_paid\_fee  | 分阶段付款已支付金额，以分为单位| INT UNSIGNED | No | 0 | No |
| order\_class  | 订单种类。可选值有 normal 普通订单;groups 拼团订单| VARCHAR(255) | Yes | normal | No |
| order\_status  | 订单状态。可选值有 DONE—订单完成;NOTPAY—未支付;PART\_PAYMENT-部分付款;WAIT\_GROUPS\_SUCCESS-等待拼团成功;PAYED-已支付;CANCEL—已取消| VARCHAR(255) | Yes | NULL | No |
| order\_source  | 订单来源。可选值有 member 用户自主下单;shop 商家代客下单| VARCHAR(255) | No | member | No |
| operator\_desc  | 操作员信息| VARCHAR(100) | No | NULL | No |
| order\_type  | 订单类型| VARCHAR(255) | No | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |
| auto\_cancel\_time  | 订单自动取消时间| VARCHAR(255) | Yes | NULL | No |
| date\_type  | 有效期的类型, DATE\_TYPE\_FIX\_TIME\_RANGE: 指定日期范围内，DATE\_TYPE\_FIX\_TERM:固定天数后| VARCHAR(255) | No | NULL | No |
| begin\_date  | 有效期开始时间| INT | No | NULL | No |
| end\_date  | 有效期结束时间| INT | No | NULL | No |
| fixed\_term  | 有效期的有效天数| INT | No | NULL | No |
| cost\_fee  | 商品成本价，以分为单位| INT UNSIGNED | Yes | NULL | No |
| item\_fee  | 商品总金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| member\_discount  | 会员折扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount  | 优惠券抵扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount\_desc  | 优惠券使用详情| LONGTEXT | No | NULL | No |
| member\_discount\_desc  | 会员折扣使用详情| LONGTEXT | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id | Yes |

<a name="table-servicelabels"></a>
## servicelabels

> **数值属性表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| label\_id  | 数值属性ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| label\_name  | 数值属性名称| VARCHAR(255) | Yes | NULL | No |
| label\_price  | 价格,单位为‘分’| INT | Yes | NULL | No |
| service\_type  | 会员数值属性类型，point：积分类型，deposit：预存类型，timescard：次卡类型| VARCHAR(30) | Yes | NULL | No |
| label\_desc  | 数值属性描述| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | label\_id | Yes |

<a name="table-shipping_templates"></a>
## shipping\_templates

> **运费模板表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| template\_id  | 运费模板id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 商家id| BIGINT | Yes | NULL | No |
| name  | 运费模板名称| VARCHAR(50) | Yes |  | No |
| is\_free  | 是否包邮| VARCHAR(255) | Yes | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| supplier\_id  | 供应商id| BIGINT UNSIGNED | Yes | 0 | No |
| valuation  | 运费计算参数来源| VARCHAR(1) | Yes | 1 | No |
| protect  | 物流保价| TINYINT(1) | No |  | No |
| protect\_rate  | 保价费率| NUMERIC(6, 3) | No | 0.000 | No |
| minprice  | 保价费最低值| NUMERIC(10, 2) | No | 0.00 | No |
| status  | 是否开启| TINYINT(1) | Yes | 1 | No |
| fee\_conf  | 运费模板中运费信息对象，包含默认运费和指定地区运费| LONGTEXT | No | NULL | No |
| nopost\_conf  | 不包邮地区| LONGTEXT | No | [] | No |
| free\_conf  | 指定包邮的条件| LONGTEXT | No | NULL | No |
| create\_time  | 创建时间| INT | Yes | NULL | No |
| update\_time  | 最后修改时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | template\_id | Yes |

<a name="table-shop_comments"></a>
## shop\_comments

> **店铺评论表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 评论id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| VARCHAR(255) | Yes | NULL | No |
| user\_id  | 用户id| VARCHAR(255) | Yes | NULL | No |
| shop\_id  | 店铺id| VARCHAR(255) | Yes | 0 | No |
| content  | 评论内容| VARCHAR(2000) | Yes | NULL | No |
| pics  | 评论图片| JSON | No | NULL | No |
| is\_reply  | 评论是否回复| TINYINT(1) | No |  | No |
| reply\_content  | 评论回复内容| VARCHAR(2000) | No | NULL | No |
| stuck  | 是否置顶| TINYINT(1) | Yes |  | No |
| hid  | 是否隐藏| TINYINT(1) | Yes |  | No |
| reply\_time  | 回复时间| BIGINT | No | NULL | No |
| source  | 评论来源| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id | Yes |

<a name="table-shop_menu"></a>
## shop\_menu

> **商家和平台端菜单管理**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| shopmenu\_id  | 菜单id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id，company\_id为0的时候表示通用| INT | Yes | NULL | No |
| alias\_name  | 菜单别名,唯一值| VARCHAR(255) | No | NULL | No |
| name  | 菜单名称| VARCHAR(255) | Yes | NULL | No |
| url  | 菜单对应路由| VARCHAR(255) | Yes | NULL | No |
| sort  | 排序| INT | No | NULL | No |
| is\_menu  | 是否为菜单| TINYINT(1) | No | NULL | No |
| pid  | 上级菜单id| BIGINT | Yes | 0 | No |
| apis  | API权限集| LONGTEXT | No | NULL | No |
| icon  | 菜单图标| VARCHAR(255) | No | NULL | No |
| is\_show  | 是否显示| TINYINT(1) | Yes | NULL | No |
| version  | 菜单版本,1:平台菜单;2:IT端菜单,3:店铺菜单,4:供应商菜单,5:经销商菜单,6:商户菜单| SMALLINT | Yes | 1 | No |
| disabled  | 是否有效| TINYINT(1) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | shopmenu\_id, company\_id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-shop_menu_rel_type"></a>
## shop\_menu\_rel\_type

> **菜单类型关联**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| rel\_id  | 关联ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| shopmenu\_id  | 菜单id| BIGINT | Yes | NULL | No |
| menu\_type  | 菜单类型| INT | Yes | 1 | No |
| company\_id  | 公司ID| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | rel\_id | Yes |
| ix\_shopmenu\_id | shopmenu\_id | No |

<a name="table-shop_notice"></a>
## shop\_notice

> **店铺公告表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| notice\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| type  | 公告类型。可选值有 notice-公告;helper-店主助手| VARCHAR(255) | Yes | NULL | No |
| title  | 公告标题| VARCHAR(255) | Yes | NULL | No |
| web\_link  | 网页链接| VARCHAR(255) | Yes | NULL | No |
| is\_publish  | 是否发布 0:不发布 1:发布| TINYINT(1) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | notice\_id | Yes |

<a name="table-shop_rel_salesperson"></a>
## shop\_rel\_salesperson

> **店铺管理员关联店铺表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| shop\_id  | 店铺id| BIGINT | Yes | NULL | No |
| salesperson\_id  | 店铺管理员id| BIGINT | Yes | NULL | No |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| store\_type  | 店铺类型，shop：门店, distributor:店铺| VARCHAR(255) | Yes | shop | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | shop\_id, salesperson\_id | Yes |
| ix\_company\_id | company\_id | No |

<a name="table-shop_salesperson"></a>
## shop\_salesperson

> **门店人员**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| salesperson\_id  | 门店人员ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| name  | 姓名| VARCHAR(500) | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(255) | Yes | NULL | No |
| created\_time  | 创建时间| VARCHAR(255) | Yes | NULL | No |
| salesperson\_type  | 人员类型 admin: 管理员; verification\_clerk:核销员; shopping\_guide:导购员| VARCHAR(255) | Yes | admin | No |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| user\_id  | 关联会员id| INT | Yes | 0 | No |
| child\_count  | 导购员引入的会员数| INT | Yes | 0 | No |
| is\_valid  | 是否有效| VARCHAR(255) | Yes | true | No |
| shop\_id  | 门店id| VARCHAR(255) | No | NULL | No |
| shop\_name  | 门店名称| VARCHAR(255) | No | NULL | No |
| number  | 导购员编号| VARCHAR(50) | No | NULL | No |
| friend\_count  | 导购员会员好友数| INT | Yes | 0 | No |
| work\_userid  | 企业微信userid[如果是内部应用则是明文，如果是第三方应用则是密文]| VARCHAR(255) | No | NULL | No |
| work\_clear\_userid  | 企业微信userid[用于对接导购存储明文userid]| VARCHAR(255) | No | NULL | No |
| avatar  | 企业微信头像| VARCHAR(255) | No | NULL | No |
| work\_configid  | 企业微信userid| VARCHAR(255) | No | NULL | No |
| work\_qrcode\_configid  | 企业微信userid| VARCHAR(255) | No | NULL | No |
| role  | 导购权限集合| VARCHAR(255) | No | NULL | No |
| salesperson\_job  | 职务| VARCHAR(50) | No |  | No |
| employee\_status  | 员工类型 [1 员工] [2 编外]| INT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | salesperson\_id | Yes |

<a name="table-sms_idiograph"></a>
## sms\_idiograph

> **短信签名表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | company\_id| BIGINT | Yes | NULL | No |
| shopex\_uid  | shopex账号id| BIGINT | Yes | NULL | No |
| idiograph  | 签名内容| VARCHAR(20) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-sms_template"></a>
## sms\_template

> **短信模板表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | company\_id| BIGINT | Yes | NULL | No |
| sms\_type  | 短信类型| VARCHAR(255) | Yes | notice | No |
| tmpl\_type  | 模板分类| VARCHAR(255) | Yes | NULL | No |
| content  | 模板内容| LONGTEXT | Yes | NULL | No |
| is\_open  | 是否开启| VARCHAR(255) | Yes | NULL | No |
| tmpl\_name  | 模板名称| VARCHAR(255) | Yes | NULL | No |
| send\_time\_desc  | 短信发送触发时间描述| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-sources"></a>
## sources

> **小程序来源列表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| source\_id  | 来源id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| source\_name  | 来源名称| VARCHAR(255) | Yes | NULL | No |
| tags\_id  | 会员标签| LONGTEXT | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | source\_id | Yes |

<a name="table-statement_details"></a>
## statement\_details

> **结算单明细**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商ID| BIGINT | Yes | 0 | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| statement\_id  | 结算单ID| BIGINT | Yes | NULL | No |
| statement\_no  | 结算单号| VARCHAR(20) | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| total\_fee  | 实付金额，以分为单位| INT | Yes | NULL | No |
| freight\_fee  | 运费金额，以分为单位| INT | Yes | NULL | No |
| intra\_city\_freight\_fee  | 同城配金额，以分为单位| INT | Yes | NULL | No |
| rebate\_fee  | 分销佣金，以分为单位| INT | Yes | NULL | No |
| refund\_fee  | 退款金额，以分为单位| INT | Yes | NULL | No |
| statement\_fee  | 结算金额，以分为单位| INT | Yes | NULL | No |
| pay\_type  | 支付方式| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| num  | 购买数量| INT | No | NULL | No |
| item\_fee  | 销售总金额，以分为单位| INT | No | NULL | No |
| commission\_fee  | 佣金金额，以分为单位| INT | No | NULL | No |
| cost\_fee  | 结算金额，以分为单位| INT | No | NULL | No |
| point\_fee  | 积分抵扣 按分计算| INT | No | NULL | No |
| refund\_num  | 退货数量| INT | No | NULL | No |
| refund\_point  | 退款积分| INT | No | NULL | No |
| refund\_cost\_fee  | 退货成本| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_statement\_id | statement\_id | No |
| idx\_supplier\_id | supplier\_id | No |
| idx\_created | created | No |

<a name="table-statement_period_setting"></a>
## statement\_period\_setting

> **结算周期设置**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商ID| BIGINT | Yes | NULL | No |
| period  | 结算周期 day:天 week:周 month:月| VARCHAR(255) | Yes | NULL | No |
| merchant\_type  | 商户类型：distributor 经销商,supplier 供应商| VARCHAR(30) | No | distributor | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_supplier\_id | supplier\_id | No |
| idx\_distributor\_id | distributor\_id | No |

<a name="table-statements"></a>
## statements

> **结算单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | NULL | No |
| supplier\_id  | 供应商ID| BIGINT | Yes | 0 | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| merchant\_type  | 商户类型：distributor 经销商,supplier 供应商| VARCHAR(30) | No | distributor | No |
| statement\_no  | 结算单号| VARCHAR(20) | Yes | NULL | No |
| order\_num  | 订单数量| INT UNSIGNED | Yes | NULL | No |
| total\_fee  | 实付金额，以分为单位| INT | Yes | NULL | No |
| freight\_fee  | 运费金额，以分为单位| INT | Yes | NULL | No |
| intra\_city\_freight\_fee  | 同城配金额，以分为单位| INT | Yes | NULL | No |
| rebate\_fee  | 分销佣金，以分为单位| INT | Yes | NULL | No |
| refund\_fee  | 退款金额，以分为单位| INT | Yes | NULL | No |
| statement\_fee  | 结算金额，以分为单位| INT | Yes | NULL | No |
| start\_time  | 结算周期开始时间| INT | Yes | NULL | No |
| end\_time  | 结算周期结束时间| INT | Yes | NULL | No |
| confirm\_time  | 确认时间| INT | No | NULL | No |
| statement\_time  | 结算时间| INT | No | NULL | No |
| statement\_status  | 结算状态 ready:待商家确认 confirmed待平台结算 done:已结算| VARCHAR(255) | Yes | ready | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| point\_fee  | 积分抵扣 按分计算| INT | No | NULL | No |
| refund\_num  | 退货数量| INT | No | NULL | No |
| refund\_point  | 退款积分| INT | No | NULL | No |
| refund\_cost\_fee  | 退货成本| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_merchant\_type | merchant\_type | No |
| idx\_supplier\_id | supplier\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_start\_time | start\_time | No |

<a name="table-sub_orders"></a>
## sub\_orders

> **服务类子订单表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| item\_id  | 商品id| BIGINT | Yes | NULL | No |
| label\_id  | 数值属性ID| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| label\_name  | 数值属性名称| VARCHAR(255) | Yes | NULL | No |
| label\_price  | 价格,单位为‘分’| INT | Yes | NULL | No |
| num  | 数值属性值，例如买了50个次卡，就是填50；赠送了10个经验，就是填10| BIGINT | Yes | NULL | No |
| limit\_time  | 有效期，例如30天| BIGINT | Yes | NULL | No |
| is\_not\_limit\_num  | 限制核销次数,1:不限制；2:限制| INT | Yes | 2 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | order\_id, item\_id, label\_id | Yes |

<a name="table-super_admin_accounts"></a>
## super\_admin\_accounts

> **平台账号表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| account\_id  | 账号id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| login\_name  | 登录账号名| VARCHAR(255) | Yes | NULL | No |
| password  | 密码| VARCHAR(255) | Yes | NULL | No |
| name  | 姓名| VARCHAR(255) | Yes | NULL | No |
| super  | 是否超级管理员| TINYINT(1) | Yes |  | No |
| status  | 是否启用| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | account\_id | Yes |

<a name="table-superadmin_wxapp_template"></a>
## superadmin\_wxapp\_template

> **小程序模板表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| key\_name  | 小程序英文描述| VARCHAR(255) | Yes | NULL | No |
| name  | 小程序模板名称| VARCHAR(255) | No | NULL | No |
| tag  | 小程序标签| VARCHAR(255) | No | NULL | No |
| template\_id  | 模板id| INT | No | NULL | No |
| template\_id\_2  | 模板id(直播版)| INT | No | NULL | No |
| version  | 版本号| VARCHAR(255) | No | NULL | No |
| is\_only  | 是否为唯一属性，如果为唯一属性那么当前模版只能绑定一个小程序| TINYINT(1) | Yes |  | No |
| description  | 模板详细描述| VARCHAR(255) | No | NULL | No |
| domain  | 合法域名配置| LONGTEXT | No | NULL | No |
| is\_disabled  | 是否禁用| TINYINT(1) | Yes |  | No |
| platform  | 使用平台。可选值有 development-开发环境;preissue-预发布环境;production-正式环境;| VARCHAR(255) | Yes | development | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| uniq\_857ebfc6d824a5cf | key\_name | Yes |
| primary | id | Yes |

<a name="table-supplier"></a>
## supplier

> **供应商**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 商户id| BIGINT | Yes | NULL | No |
| supplier\_name  | 供应商名称| VARCHAR(100) | No | NULL | No |
| contact  | 联系人| VARCHAR(30) | No |  | No |
| mobile  | 手机号| VARCHAR(30) | No |  | No |
| business\_license  | 营业执照| VARCHAR(200) | No | NULL | No |
| wechat\_qrcode  | 企业微信二维码| VARCHAR(200) | No | NULL | No |
| service\_tel  | 客服电话| VARCHAR(30) | No | NULL | No |
| bank\_name  | 收款银行| VARCHAR(50) | No | NULL | No |
| bank\_account  | 收款账号| VARCHAR(50) | No | NULL | No |
| is\_check  | 是否审核| BIGINT | Yes | NULL | No |
| audit\_remark  | 审核备注| VARCHAR(500) | No | NULL | No |
| adapay\_mch\_id  | 汇付商户ID| VARCHAR(50) | No | NULL | No |
| wx\_openid  | 微信公众号openid| VARCHAR(100) | No | NULL | No |
| operator\_id  | 管理员id| BIGINT | Yes | NULL | No |
| add\_time  | 创建时间| DATETIME | No | NULL | No |
| modify\_time  | 更新时间| DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_supplier\_name | supplier\_name | No |
| idx\_mobile | mobile | No |
| idx\_is\_check | is\_check | No |

<a name="table-supplier_items"></a>
## supplier\_items

> **商品表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| item\_id  | 商品ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| item\_type  | 商品类型，services：服务商品，normal: 普通商品| VARCHAR(15) | Yes | services | No |
| item\_category  | 商品主类目| VARCHAR(15) | No | null | No |
| consume\_type  | 核销类型，every：每个物料都要核销(例如3个物料要核销3次)，all：所有物料作为一个整体核销一次(例如3个物料只需要核销1次)| VARCHAR(15) | Yes | every | No |
| item\_name  | 商品名称| VARCHAR(255) | Yes | NULL | No |
| item\_bn  | 商品编号| VARCHAR(255) | Yes | NULL | No |
| barcode  | 商品条形码| LONGTEXT | Yes | NULL | No |
| brief  | 简洁的描述| VARCHAR(255) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| price  | 销售价,单位为‘分’| INT | Yes | NULL | No |
| cost\_price  | 成本价,单位为‘分’| INT | No | 0 | No |
| item\_unit  | 商品计量单位| VARCHAR(255) | No | NULL | No |
| special\_type  | 商品特殊类型 drug 处方药 normal 普通商品| VARCHAR(255) | No | normal | No |
| item\_address\_province  | 产地省| VARCHAR(255) | No | NULL | No |
| item\_address\_city  | 产地市| VARCHAR(255) | No | NULL | No |
| regions\_id  | 产地地区id| VARCHAR(255) | No | NULL | No |
| regions  | 产地地区| LONGTEXT | No | NULL | No |
| store  | 库存| INT | No | NULL | No |
| sales  | 销量| INT | No | 0 | No |
| rebate\_conf  | 分销配置| JSON | No | NULL | No |
| rebate  | 推广商品 1已选择 0未选择 2申请加入 3拒绝| INT | No | NULL | No |
| rebate\_type  | 分佣计算方式| VARCHAR(255) | No | default | No |
| approve\_status  | 商品状态 onsale 前台可销售，offline\_sale前端不展示，instock 不可销售, only\_show 前台仅展示| VARCHAR(255) | Yes | NULL | No |
| audit\_status  | 审核状态 submiting待提交 approved成功 processing审核中 rejected审核拒绝| VARCHAR(255) | No | approved | No |
| audit\_reason  | 审核拒绝原因| LONGTEXT | No | NULL | No |
| market\_price  | 原价,单位为‘分’| INT | Yes | NULL | No |
| goods\_function  | 商品功能| VARCHAR(255) | No | NULL | No |
| goods\_series  | 商品系列| VARCHAR(255) | No | NULL | No |
| goods\_color  | 商品颜色| VARCHAR(255) | No | NULL | No |
| goods\_brand  | 商品品牌| VARCHAR(255) | No | NULL | No |
| is\_default  | 商品是否为默认商品| TINYINT(1) | No | 1 | No |
| default\_item\_id  | 默认商品ID| BIGINT | No | 0 | No |
| goods\_id  | 产品ID| BIGINT | No | 0 | No |
| nospec  | 商品是否为单规格| VARCHAR(255) | No | true | No |
| weight  | 商品重量| DOUBLE PRECISION | No | 0 | No |
| sort  | 商品排序| INT | Yes | 0 | No |
| is\_epidemic  | 是否为疫情需要登记的商品  1:是 0:否| INT | No | 0 | No |
| templates\_id  | 运费模板id| INT | No | NULL | No |
| pics  | 图片| JSON | Yes | NULL | No |
| pics\_create\_qrcode  | 图片是否生成小程序码| JSON | No | NULL | No |
| video\_type  | 视频类型 local:本地视频 tencent:腾讯视频| VARCHAR(255) | Yes | local | No |
| videos  | 视频| LONGTEXT | No | NULL | No |
| video\_pic\_url  | 视频封面图| LONGTEXT | No | NULL | No |
| intro  | 图文详情| LONGTEXT | No | NULL | No |
| purchase\_agreement  | 购买协议| LONGTEXT | No | NULL | No |
| is\_show\_specimg  | 详情页是否显示规格图片| TINYINT(1) | Yes |  | No |
| enable\_agreement  | 开启购买协议| TINYINT(1) | Yes |  | No |
| date\_type  | 有效期的类型, DATE\_TYPE\_FIX\_TIME\_RANGE:指定日期范围内, DATE\_TYPE\_FIX\_TERM:固定天数后| VARCHAR(255) | No | NULL | No |
| begin\_date  | 有效期开始时间| INT | No | NULL | No |
| end\_date  | 有效期结束时间| INT | No | NULL | No |
| fixed\_term  | 有效期的有效天数| INT | No | NULL | No |
| brand\_logo  | 品牌图片| VARCHAR(1024) | No | NULL | No |
| is\_point  | 是否积分兑换 true可以 false不可以| TINYINT(1) | No |  | No |
| point  | 积分个数| INT | No | 0 | No |
| distributor\_id  | 店铺id,为0时表示该商品为商城商品，否则为店铺自有商品| INT | Yes | 0 | No |
| volume  | 商品体积| DOUBLE PRECISION | No | NULL | No |
| item\_source  | 商品来源:mall:主商城;distributor:店铺自有;openapi:开放接口;| VARCHAR(255) | Yes | mall | No |
| brand\_id  | 品牌id| INT | No | 0 | No |
| tax\_rate  | 税率, 百分之～/100| INT | Yes | NULL | No |
| crossborder\_tax\_rate  | 跨境税率，百分比，小数点2位| VARCHAR(10) | Yes | NULL | No |
| profit\_type  | 分润类型, 默认为0配置分润,1主类目分润,2商品指定分润(比例),3商品指定分润(金额)| INT | No | 0 | No |
| origincountry\_id  | 产地国id| BIGINT | Yes | 0 | No |
| taxstrategy\_id  | 税费策略id| BIGINT | Yes | 0 | No |
| taxation\_num  | 计税单位份数| INT | Yes | 0 | No |
| profit\_fee  | 分润金额,单位为分 冗余字段| INT | No | 0 | No |
| type  | 商品类型，0普通，1跨境商品，可扩展| INT | Yes | 0 | No |
| is\_profit  | 是否支持分润| TINYINT(1) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| is\_gift  | 是否为赠品| TINYINT(1) | No |  | No |
| is\_package  | 是否为打包产品| TINYINT(1) | No |  | No |
| tdk\_content  | tdk详情| LONGTEXT | No | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| is\_market  | 供应商控制商品是否可售，0不可售，1可售| INT | Yes | 1 | No |
| goods\_bn  | SPU编码| VARCHAR(255) | No | NULL | No |
| supplier\_goods\_bn  | 供应商货号| VARCHAR(255) | No | NULL | No |
| audit\_date  | 商品审核时间| INT | No | NULL | No |
| is\_medicine  | 是否为药品，0否 1是| SMALLINT | Yes | 0 | No |
| is\_prescription  | 是否为处方药，0否 1是| SMALLINT | Yes | 0 | No |
| start\_num  | 起订量| INT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | item\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_default\_item\_id | default\_item\_id | No |
| ix\_item\_category | item\_category | No |
| ix\_item\_bn | item\_bn | No |
| ix\_goods\_id | goods\_id | No |
| ix\_supplier\_id | supplier\_id | No |
| ix\_is\_default | is\_default | No |
| ix\_is\_medicine | is\_medicine | No |
| ix\_is\_prescription | is\_prescription | No |
| ix\_default\_item\_list | company\_id, default\_item\_id, approve\_status, item\_type, item\_category | No |

<a name="table-supplier_items_attr"></a>
## supplier\_items\_attr

> **新供应商商品属性表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品ID| BIGINT | Yes | NULL | No |
| attribute\_id  | 商品属性id| BIGINT | Yes | 0 | No |
| is\_del  | 是否需要删除| BIGINT | Yes | 0 | No |
| attribute\_type  | 商品属性类型 unit 单位，brand 品牌，item\_params 商品参数, item\_spec 规格, category 商品销售分类| VARCHAR(15) | Yes | NULL | No |
| attr\_data  | 属性值| LONGTEXT | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_item\_id | item\_id | No |

<a name="table-supplier_items_commission"></a>
## supplier\_items\_commission

> **商品佣金费率**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 商户id| BIGINT | Yes | NULL | No |
| item\_id  | 商品| BIGINT | Yes | NULL | No |
| goods\_id  | 产品ID| BIGINT | No | 0 | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| commission\_ratio  | 佣金比例| INT | Yes | 0 | No |
| add\_time  | 创建时间| DATETIME | No | NULL | No |
| modify\_time  | 更新时间| DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_goods\_id | goods\_id | No |

<a name="table-supplier_order"></a>
## supplier\_order

> **供应商订单**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| order\_id  | 订单号| BIGINT | Yes | NULL | No |
| title  | 订单标题| VARCHAR(255) | No | NULL | No |
| shop\_id  | 门店id| BIGINT | No | 0 | No |
| cost\_fee  | 商品成本价，以分为单位| INT UNSIGNED | Yes | NULL | No |
| commission\_fee  | 佣金(分)| INT | Yes | 0 | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| act\_id  | 营销活动ID，团购ID，社区拼团ID，秒杀活动ID等| BIGINT | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| order\_class  | 订单种类。可选值有 normal:普通订单;groups:拼团订单;;community 社区活动订单;bargain:助力订单;seckill:秒杀订单;shopguide:导购订单;pointsmall:积分商城;excard:兑换券| VARCHAR(255) | Yes | normal | No |
| freight\_fee  | 运费价格，以分为单位| INT | No | 0 | No |
| freight\_type  | 运费类型-用于积分商城 cash:现金 point:积分| VARCHAR(255) | Yes | cash | No |
| item\_fee  | 商品金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| total\_fee  | 订单金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| market\_fee  | 销售价总金额，以分为单位| VARCHAR(255) | No | NULL | No |
| step\_paid\_fee  | 分阶段付款已支付金额，以分为单位| INT UNSIGNED | No | 0 | No |
| total\_rebate  | 订单总分销金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| distributor\_id  | 分销商id| BIGINT UNSIGNED | Yes | 0 | No |
| receipt\_type  | 收货方式。可选值有 【logistics 物流】【ziti 店铺自提】【dada 达达同城配】【merchant 商家自配】| VARCHAR(255) | Yes | logistics | No |
| ziti\_code  | 店铺自提码| BIGINT | Yes | 0 | No |
| ziti\_status  | 店铺自提状态。可选值有 PENDING:等待自提;DONE:自提完成;NOTZITI:自提完成; APPROVE:审核通过,药品自提需要审核| VARCHAR(255) | No | NOTZITI | No |
| order\_status  | 订单状态。可选值有 DONE—订单完成;NOTPAY—未支付;PART\_PAYMENT-部分付款;WAIT\_GROUPS\_SUCCESS-等待拼团成功;PAYED-已支付;CANCEL—已取消;WAIT\_BUYER\_CONFIRM-待用户收货| VARCHAR(255) | Yes | NULL | No |
| pay\_status  | 支付状态。可选值有 NOTPAY—未支付;PAYED-已支付;ADVANCE\_PAY-预付款完成;TAIL\_PAY-支付尾款中| VARCHAR(255) | Yes | NOTPAY | No |
| order\_source  | 订单来源。可选值有 member-用户自主下单;shop-商家代客下单| VARCHAR(255) | No | member | No |
| order\_type  | 订单类型。可选值有 normal:普通实体订单| VARCHAR(255) | Yes | normal | No |
| is\_distribution  | 是否分销订单| TINYINT(1) | Yes |  | No |
| source\_id  | 订单来源id| BIGINT | No | NULL | No |
| delivery\_corp  | 快递公司| VARCHAR(255) | No | NULL | No |
| delivery\_corp\_source  | 快递代码来源| VARCHAR(255) | No | NULL | No |
| delivery\_code  | 快递单号| VARCHAR(255) | No | NULL | No |
| delivery\_img  | 快递发货凭证| VARCHAR(255) | No | NULL | No |
| delivery\_time  | 发货时间| INT | No | NULL | No |
| end\_time  | 订单完成时间| BIGINT | No | NULL | No |
| delivery\_status  | 发货状态。可选值有 DONE—已发货;PENDING—待发货;PARTAIL-部分发货| VARCHAR(255) | Yes | PENDING | No |
| cancel\_status  | 取消订单状态。可选值有 NO\_APPLY\_CANCEL 未申请;WAIT\_PROCESS 等待审核;REFUND\_PROCESS 退款处理;SUCCESS 取消成功;FAILS 取消失败| VARCHAR(255) | Yes | NO_APPLY_CANCEL | No |
| receiver\_name  | 收货人姓名| VARCHAR(500) | No | NULL | No |
| receiver\_mobile  | 收货人手机号| VARCHAR(255) | No | NULL | No |
| receiver\_zip  | 收货人邮编| VARCHAR(255) | No | NULL | No |
| receiver\_state  | 收货人所在省份| VARCHAR(255) | No | NULL | No |
| receiver\_city  | 收货人所在城市| VARCHAR(255) | No | NULL | No |
| receiver\_district  | 收货人所在地区| VARCHAR(255) | No | NULL | No |
| receiver\_address  | 收货人详细地址| LONGTEXT | No | NULL | No |
| member\_discount  | 会员折扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| coupon\_discount  | 优惠券抵扣金额，以分为单位| INT UNSIGNED | Yes | NULL | No |
| discount\_fee  | 订单优惠金额，以分为单位| INT | Yes | 0 | No |
| discount\_info  | 订单优惠详情| LONGTEXT | No | NULL | No |
| coupon\_discount\_desc  | 优惠券使用详情| LONGTEXT | No | NULL | No |
| member\_discount\_desc  | 会员折扣使用详情| LONGTEXT | No | NULL | No |
| fee\_type  | 货币类型| VARCHAR(5) | Yes | CNY | No |
| fee\_rate  | 货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| fee\_symbol  | 货币符号| VARCHAR(255) | Yes | ￥ | No |
| item\_point  | 商品消费总积分| INT UNSIGNED | No | 0 | No |
| point  | 消费积分| INT UNSIGNED | No | 0 | No |
| pay\_type  | 支付方式| VARCHAR(255) | No |  | No |
| pay\_channel  | adapay支付渠道| VARCHAR(255) | No |  | No |
| remark  | 订单备注| VARCHAR(255) | No | NULL | No |
| invoice  | 发票信息| JSON | No | NULL | No |
| invoice\_number  | 发票号| VARCHAR(255) | No |  | No |
| is\_invoiced  | 是否已开发票| TINYINT(1) | No | 0 | No |
| send\_point  | 是否分发积分0否 1是| INT | Yes | 0 | No |
| type  | 订单类型，0普通订单,1跨境订单,....其他| INT | Yes | 0 | No |
| point\_fee  | 积分抵扣金额，以分为单位| INT | No | 0 | No |
| point\_use  | 积分抵扣使用的积分数| INT | No | 0 | No |
| pack  | 包装| VARCHAR(255) | No | NULL | No |
| operator\_id  | 操作者id| INT | No | 0 | No |
| source\_from  | 订单来源 pc,h5,wxapp,aliapp,unknow,dianwu| VARCHAR(10) | No | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| is\_settled  | 是否分账(斗拱)| TINYINT(1) | Yes |  | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_order\_id | order\_id | No |
| idx\_order\_status | order\_status | No |
| idx\_receiver\_mobile | receiver\_mobile | No |
| idx\_supplier\_id | supplier\_id | No |
| idx\_create\_time | create\_time | No |

<a name="table-systemlink_oms_queuelog"></a>
## systemlink\_oms\_queuelog

> **联通oms通信日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| api\_type  | 日志同步类型, response:响应，request:请求| VARCHAR(255) | Yes | NULL | No |
| worker  | api| VARCHAR(255) | Yes | NULL | No |
| params  | 任务参数| JSON | No | NULL | No |
| result  | 返回数据| JSON | No | NULL | No |
| status  | 运行状态：running,success,fail| VARCHAR(255) | Yes | running | No |
| runtime  | 运行时间(秒)| VARCHAR(255) | No | NULL | No |
| msg\_id  | msg\_id| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-template_orders"></a>
## template\_orders

> **小程序开通表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| template\_orders\_id  | 小程序模版开通ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| operator\_id  | operator\_id| BIGINT | Yes | NULL | No |
| template\_name  | 模版名称| VARCHAR(255) | Yes | NULL | No |
| total\_fee  | 购买模版金额，以分为单位| VARCHAR(255) | Yes | NULL | No |
| order\_status  | 订单状态。可选值有 DONE—订单完成；NOTPAY—未支付；CANCEL—已取消| VARCHAR(255) | Yes | NULL | No |
| create\_time  | 订单创建时间| INT | Yes | NULL | No |
| update\_time  | 订单更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | template\_orders\_id | Yes |

<a name="table-theme_member_center_share"></a>
## theme\_member\_center\_share

> **会员中心分享信息表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| theme\_member\_center\_share\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| share\_title  | 页面名称| VARCHAR(50) | Yes | NULL | No |
| share\_description  | 页面描述| VARCHAR(150) | Yes | NULL | No |
| share\_pic\_wechatapp  | 分享图片小程序| VARCHAR(150) | No |  | No |
| share\_pic\_h5  | 分享图片h5| VARCHAR(150) | No |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | theme\_member\_center\_share\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-theme_pc_template"></a>
## theme\_pc\_template

> **pc页面装修**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| theme\_pc\_template\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| template\_title  | 页面名称| VARCHAR(50) | Yes | NULL | No |
| template\_description  | 页面描述| VARCHAR(150) | Yes | NULL | No |
| page\_type  | 页面类型 index 首页 custom | VARCHAR(15) | No | index | No |
| status  | 启用状态 1启用 2未启用| INT | No | 2 | No |
| version  | 版本号| VARCHAR(10) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| deleted\_at  | | DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | theme\_pc\_template\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-theme_pc_template_content"></a>
## theme\_pc\_template\_content

> **pc页面装修组件内容**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| theme\_pc\_template\_content\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| theme\_pc\_template\_id  | | BIGINT | Yes | NULL | No |
| name  | 配置名称| VARCHAR(20) | Yes | NULL | No |
| params  | 配置参数| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | theme\_pc\_template\_content\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-thirdparty_saaserp_log"></a>
## thirdparty\_saaserp\_log

> **联通saasErp通信日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| api\_type  | 日志同步类型, response:响应，request:请求| VARCHAR(255) | Yes | NULL | No |
| worker  | api| VARCHAR(255) | Yes | NULL | No |
| params  | 任务参数| JSON | No | NULL | No |
| result  | 返回数据| JSON | No | NULL | No |
| status  | 运行状态：running,success,fail| VARCHAR(255) | Yes | running | No |
| runtime  | 运行时间(秒)| VARCHAR(255) | No | NULL | No |
| msg\_id  | msg\_id| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-thirdparty_shop_bind"></a>
## thirdparty\_shop\_bind

> **矩阵节点绑定**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| name  | 名称| VARCHAR(255) | Yes | NULL | No |
| node\_id  | 节点| VARCHAR(255) | Yes | NULL | No |
| node\_type  | 节点类型| VARCHAR(255) | Yes | NULL | No |
| status  | 绑定状态 1:已绑定 0：未绑定| SMALLINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_node\_type | node\_type | No |
| idx\_status | status | No |
| idx\_node | company\_id, node\_type, status | No |

<a name="table-trade"></a>
## trade

> **交易单表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| trade\_id  | 交易单号| VARCHAR(64) | Yes | NULL | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| company\_id  | 企业ID| VARCHAR(255) | Yes | NULL | No |
| shop\_id  | 门店ID| VARCHAR(255) | No | NULL | No |
| distributor\_id  | 店铺ID| VARCHAR(255) | No | NULL | No |
| dealer\_id  | 经销商ID| VARCHAR(255) | No | 0 | No |
| trade\_source\_type  | 交易单来源类型。可选值有 membercard-会员卡购买;normal-实体订单购买;servers-服务订单购买;normal\_community-社区订单购买;diposit-预存款购买;order\_pay-买单购买;| VARCHAR(255) | No | NULL | No |
| user\_id  | 购买用户| VARCHAR(255) | Yes | NULL | No |
| mobile  | 购买用户手机号| VARCHAR(255) | No | NULL | No |
| open\_id  | 用户open\_id| VARCHAR(255) | No | NULL | No |
| discount\_info  | 优惠金额，优惠金额，优惠原因json结构| LONGTEXT | No | NULL | No |
| mch\_id  | 商户号，微信支付| VARCHAR(255) | No | NULL | No |
| total\_fee  | 应付总金额,以分为单位| INT UNSIGNED | Yes | 0 | No |
| discount\_fee  | 订单优惠金额| INT | Yes | 0 | No |
| fee\_type  | 货币类型| VARCHAR(16) | Yes | NULL | No |
| pay\_fee  | 支付金额| INT UNSIGNED | Yes | 0 | No |
| trade\_no  | 每日交易序号| VARCHAR(255) | Yes | 0 | No |
| trade\_state  | 交易状态。可选值有 SUCCESS—支付成功;REFUND—转入退款;NOTPAY—未支付;CLOSED—已关闭;REVOKED—已撤销;PAYERROR--支付失败(其他原因，如银行返回失败)| VARCHAR(255) | Yes | NULL | No |
| pay\_type  | 支付方式。wxpay-微信支付;deposit-预存款支付;pos-刷卡;point-积分| VARCHAR(255) | Yes | NULL | No |
| pay\_channel  | adapay支付渠道| VARCHAR(255) | No |  | No |
| transaction\_id  | 支付订单号| VARCHAR(255) | No | NULL | No |
| authorizer\_appid  | 公众号的appid| VARCHAR(64) | No | NULL | No |
| wxa\_appid  | 支付小程序的appid| VARCHAR(64) | No | NULL | No |
| bank\_type  | 付款银行| VARCHAR(255) | No | NULL | No |
| body  | 交易商品简单描述| VARCHAR(255) | Yes | NULL | No |
| detail  | 交易商品详情| VARCHAR(255) | Yes | NULL | No |
| time\_start  | 交易起始时间| VARCHAR(255) | Yes | NULL | No |
| time\_expire  | 交易结束时间| VARCHAR(255) | No | NULL | No |
| div\_members  | 分账对象信息列表，最多仅支持7个分账方，json 数组形式| VARCHAR(500) | No |  | No |
| refunded\_fee  | 实际退款金额，以分为单位| INT UNSIGNED | No | 0 | No |
| adapay\_fee\_mode  | adapay手续费收取模式| VARCHAR(255) | No |  | No |
| adapay\_fee  | 分账手续费，以分为单位| INT UNSIGNED | No | 0 | No |
| adapay\_div\_status  | 分账状态。可选值有NOTDIV—未分账;DIVED-已分账;| VARCHAR(255) | No | NULL | No |
| cur\_fee\_type  | 系统配置货币类型| VARCHAR(5) | Yes | CNY | No |
| cur\_fee\_rate  | 系统配置货币汇率| DOUBLE PRECISION | Yes | 1 | No |
| cur\_fee\_symbol  | 系统配置货币符号| VARCHAR(255) | Yes | ￥ | No |
| cur\_pay\_fee  | 系统货币支付金额| INT UNSIGNED | Yes | 0 | No |
| coupon\_fee  | 优惠券抵扣金额，以分为单位| INT UNSIGNED | Yes | 0 | No |
| coupon\_info  | 优惠券信息json结构| LONGTEXT | No | NULL | No |
| inital\_request  | 统一下单原始请求json结构| LONGTEXT | No | NULL | No |
| inital\_response  | 支付结果通知json结构| LONGTEXT | No | NULL | No |
| merchant\_id  | 商户id| BIGINT | Yes | 0 | No |
| is\_settled  | 是否分账| TINYINT(1) | Yes |  | No |
| payment\_params  | 支付参数| LONGTEXT | No | NULL | No |
| supplier\_id  | 供应商id| INT | Yes | 0 | No |
| bspay\_req\_date  | 斗拱支付的请求日期| VARCHAR(255) | No | NULL | No |
| bspay\_div\_members  | 斗拱分账对象信息列表，最多仅支持7个分账方，json 数组形式| VARCHAR(500) | No |  | No |
| bspay\_div\_status  | 斗拱分账状态。可选值有NOTDIV—未分账;DIVED-已分账;| VARCHAR(255) | No | NULL | No |
| bspay\_fee\_mode  | 斗拱手续费收取模式 1:外扣 2:内扣| VARCHAR(255) | No |  | No |
| bspay\_fee  | 斗拱分账手续费，以分为单位| INT UNSIGNED | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | trade\_id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_distributor\_id | distributor\_id | No |
| ix\_order\_id | order\_id | No |
| idx\_supplier\_id | supplier\_id | No |
| ix\_user\_id | user\_id | No |
| ix\_list | company\_id, order\_id | No |
| idx\_merchant\_id | merchant\_id | No |

<a name="table-trade_rate"></a>
## trade\_rate

> **订单评价表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| rate\_id  | 评价id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| item\_id  | 商品ID| BIGINT | No | NULL | No |
| goods\_id  | 产品ID| BIGINT | No | 0 | No |
| order\_id  | 订单号| VARCHAR(64) | No | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| rate\_pic  | 评价图片| LONGTEXT | No | NULL | No |
| rate\_pic\_num  | 评价图片数量| INT | No | 0 | No |
| content  | 评价内容| LONGTEXT | No | NULL | No |
| content\_len  | 评价内容长度| INT | No | 0 | No |
| is\_reply  | 评价是否回复。0:否；1:是| TINYINT(1) | Yes | 0 | No |
| disabled  | 是否删除。0:否；1:是| TINYINT(1) | Yes | 0 | No |
| anonymous  | 是否匿名。0:否；1:是| TINYINT(1) | Yes | 0 | No |
| star  | 评价星级| INT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| unionid  | 微信unionid| VARCHAR(60) | No | NULL | No |
| item\_spec\_desc  | 商品规格描述| LONGTEXT | No |  | No |
| order\_type  | 订单类型。可选值有 normal:普通实体订单, pointsmall:积分商城订单| VARCHAR(255) | Yes | normal | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | rate\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_goods\_id | goods\_id | No |
| idx\_order\_id | order\_id | No |

<a name="table-trade_rate_reply"></a>
## trade\_rate\_reply

> **订单评价回复/评论表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| reply\_id  | 回复id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| rate\_id  | 评价id| BIGINT | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | No | NULL | No |
| operator\_id  | 操作员的id| BIGINT | No | NULL | No |
| content  | 评价内容| VARCHAR(255) | No | NULL | No |
| content\_len  | 评价内容长度| INT | No | 0 | No |
| role  | 回复角色.seller：卖家；buyer：买家| VARCHAR(25) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |
| unionid  | 微信unionid| VARCHAR(60) | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | reply\_id | Yes |
| idx\_rate\_id | rate\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-transcript_properties"></a>
## transcript\_properties

> **成绩单考评项目表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| prop\_id  | 属性ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| transcript\_id  | 成绩单模板id| BIGINT | Yes | NULL | No |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| prop\_name  | 属性名称| VARCHAR(255) | Yes | NULL | No |
| prop\_unit  | 属性单位| VARCHAR(255) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | prop\_id | Yes |

<a name="table-transcripts"></a>
## transcripts

> **成绩单配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| transcript\_id  | 成绩单模板id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| transcript\_name  | 门店名称| VARCHAR(100) | No | NULL | No |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| template\_name  | 小程序模板name| VARCHAR(255) | Yes | NULL | No |
| transcript\_status  | 状态| VARCHAR(255) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | transcript\_id | Yes |

<a name="table-user_deposit"></a>
## user\_deposit

> **用户储值金额表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| deposit\_id  | 用户储值ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| money  | 充值金额/消费金额。 单位是分| BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | deposit\_id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_user\_id | user\_id | No |

<a name="table-user_signin"></a>
## user\_signin

> **用户签到表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| sign\_date  | 签到日期| DATE | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_company\_id | company\_id | No |
| ix\_user\_id | user\_id | No |
| ix\_sign\_date | sign\_date | No |

<a name="table-user_signin_logs"></a>
## user\_signin\_logs

> **用户签到奖励记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| type  | 1日常签到，2，规则打标，3活动规则达标| INT | Yes | NULL | No |
| reward\_title  | 获奖标题| VARCHAR(255) | Yes | NULL | No |
| activity\_id  | 活动id| BIGINT | Yes | NULL | No |
| reward\_text  | 奖项记录多条| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-user_signin_rules"></a>
## user\_signin\_rules

> **用户签到规则表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| rule\_name  | 规则名称| VARCHAR(255) | Yes | NULL | No |
| type  | 1连续2累计| BIGINT | Yes | NULL | No |
| days\_required   | 需要的天数| BIGINT | Yes | NULL | No |
| reward\_text  | 奖励类型 points积分，coupon券，coupons券包| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-user_task_activity"></a>
## user\_task\_activity

> **签到日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| area\_id  | 区域id| BIGINT | Yes | 0 | No |
| title  | 活动标题| VARCHAR(255) | Yes | NULL | No |
| begin\_time  | 开始时间| BIGINT | Yes | 0 | No |
| end\_time  | 结束时间| BIGINT | Yes | 0 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-user_task_activity_rule"></a>
## user\_task\_activity\_rule

> **签到活动规则**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| activity\_id  | 活动id| BIGINT | Yes | 0 | No |
| rule\_type  | 活动类型| VARCHAR(255) | Yes | NULL | No |
| rule\_detail\_type  | 活动详细类型，理解为二级类型| VARCHAR(255) | Yes | NULL | No |
| rule\_name  | 规则名称| VARCHAR(255) | Yes | NULL | No |
| sign\_type  | 1连续2累计| BIGINT | Yes | NULL | No |
| rule\_desc  | 规则名称| VARCHAR(255) | Yes | NULL | No |
| hidde\_tag  | 用户标签| VARCHAR(255) | Yes | NULL | No |
| finish\_tag  | 完成标签| VARCHAR(255) | Yes | NULL | No |
| binding\_distributors  | 指定店铺| VARCHAR(255) | Yes | NULL | No |
| binding\_category  | 指定管理分类| VARCHAR(255) | Yes | NULL | No |
| share\_pic  | 分享图| VARCHAR(255) | Yes | NULL | No |
| qr\_code  | 企微二维码| VARCHAR(255) | Yes | NULL | No |
| frequency  | 频次，1每天2每周3每月0为活动周期内| BIGINT | Yes | NULL | No |
| common\_condition  | 常规的门槛，比如限制金额，限制页面，等等| VARCHAR(255) | Yes | NULL | No |
| prize\_text  | 奖励信息| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-user_task_finish_rule"></a>
## user\_task\_finish\_rule

> **活动规则完成任务**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | ID| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| activity\_id  | 活动id| BIGINT | Yes | 0 | No |
| user\_id  | 用户id| BIGINT | Yes | 0 | No |
| rule\_id  | 规则| VARCHAR(255) | Yes | NULL | No |
| finish\_status  | 1完成，2未完成| INT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-user_transcripts"></a>
## user\_transcripts

> **用户成绩单记录表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| record\_id  | 记录id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| shop\_id  | 公司id| BIGINT | No | NULL | No |
| transcript\_id  | 成绩单id| BIGINT | Yes | NULL | No |
| transcript\_name  | 成绩单名称| VARCHAR(255) | Yes | NULL | No |
| indicator\_details  | 指标详情| JSON | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | record\_id | Yes |

<a name="table-wechat_authorization"></a>
## wechat\_authorization

> **微信授权表(公众号,小程序)**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| authorizer\_appid  | (公众号，小程序)微信appid| VARCHAR(64) | Yes | NULL | No |
| authorizer\_appsecret  | (公众号，小程序)微信appsecret| VARCHAR(255) | No | NULL | No |
| operator\_id  | 授权操作者id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| authorizer\_refresh\_token  | (公众号，小程序)微信refresh\_token| VARCHAR(255) | No | NULL | No |
| nick\_name  | (公众号，小程序)昵称| VARCHAR(50) | Yes | NULL | No |
| head\_img  | (公众号，小程序)头像| VARCHAR(255) | No | NULL | No |
| service\_type\_info  | (公众号，小程序)类型。可选值有 0代表订阅号；1代表由历史老帐号升级后的订阅号；2代表服务号；3代表小程序(自定义)| INT | No | NULL | No |
| verify\_type\_info  | (公众号，小程序)认证类型。-1代表未认证;0代表微信认证;1代表新浪微博认证;2代表腾讯微博认证;3代表已资质认证通过但还未通过名称认证;4代表已资质认证通过、还未通过名称认证，但通过了新浪微博认证;5代表已资质认证通过、还未通过名称认证，但通过了腾讯微博认证| INT | No | NULL | No |
| user\_name  | (公众号，小程序)原始 ID| VARCHAR(32) | No | NULL | No |
| signature  | (小程序)账号介绍| LONGTEXT | No | NULL | No |
| principal\_name  | (公众号，小程序)主体名称| VARCHAR(255) | No | NULL | No |
| alias  | (公众号)授权方公众号所设置的微信号，可能为空| VARCHAR(50) | No | NULL | No |
| business\_info  | (公众号，小程序)用以了解以下功能的开通状况（0代表未开通，1代表已开通）。open\_store:是否开通微信门店功能;open\_scan:是否开通微信扫商品功能;open\_pay:是否开通微信支付功能;open\_card:是否开通微信卡券功能;open\_shake:是否开通微信摇一摇功能| JSON | No | NULL | No |
| qrcode\_url  | (公众号，小程序)二维码图片的URL| VARCHAR(255) | No | NULL | No |
| miniprograminfo  | (小程序)小程序配置，根据这个字段判断是否为小程序类型授权| JSON | No | NULL | No |
| func\_info  | (公众号，小程序)授权给开发者的权限集列表,逗号隔开| VARCHAR(255) | No | NULL | No |
| bind\_status  | 绑定状态 bind绑定 unbind绑定解除| VARCHAR(255) | Yes | NULL | No |
| auto\_publish  | (小程序)自动发布,第三方授权模式才有用，直连用不到此配置。1:自动发布,0:不自动发布| SMALLINT | Yes | 0 | No |
| is\_direct  | 是否直连。1:直连模式,0:第三方授权模式| SMALLINT | Yes | 0 | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |
| deleted\_at  | | DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | authorizer\_appid | Yes |

<a name="table-wechat_tags"></a>
## wechat\_tags

> **微信粉丝标签表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 公众号appid| VARCHAR(64) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| tag\_name  | 标签名称| VARCHAR(50) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id, authorizer\_appid, company\_id | Yes |

<a name="table-wechat_weapp"></a>
## wechat\_weapp

> **微信小程序提交审核表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| authorizer\_appid  | 微信appid| VARCHAR(64) | Yes | NULL | No |
| operator\_id  | 绑定操作者id| BIGINT | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| reason  | 审核失败原因| LONGTEXT | No | NULL | No |
| audit\_status  | 审核状态，其中0为审核成功，1为审核失败，2为审核中, 3为待提交审核| INT | Yes | NULL | No |
| release\_status  | 发布状态，其中0为未发布，1为已发布| INT | Yes | NULL | No |
| audit\_time  | 审核时间| VARCHAR(255) | No | NULL | No |
| template\_id  | 小程序模板ID| VARCHAR(255) | Yes | NULL | No |
| template\_name  | 小程序模板名称| VARCHAR(255) | Yes | NULL | No |
| release\_ver  | 小程序已发布的版本| VARCHAR(255) | No | NULL | No |
| template\_ver  | 小程序模板版本| VARCHAR(255) | No | NULL | No |
| visitstatus  | 小程序线上代码的可见状态 0不可见 1可见| INT | Yes | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |
| deleted\_at  | | DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | authorizer\_appid | Yes |

<a name="table-wechat_weapp_customize_page"></a>
## wechat\_weapp\_customize\_page

> **小程序自定义页面**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| template\_name  | 小程序模板名称| VARCHAR(255) | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| page\_name  | 页面名称| VARCHAR(255) | Yes | NULL | No |
| page\_description  | 页面描述| VARCHAR(255) | Yes | NULL | No |
| page\_share\_title  | 分享标题| VARCHAR(255) | No | NULL | No |
| page\_share\_desc  | 分享描述| VARCHAR(255) | No | NULL | No |
| page\_share\_imageUrl  | 分享图片| VARCHAR(255) | No | NULL | No |
| is\_open  | 是否开启0否1是| INT | Yes | 0 | No |
| page\_type  | 页面类型 salesperson:导购首页| VARCHAR(255) | Yes | normal | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-wechat_weapp_setting"></a>
## wechat\_weapp\_setting

> **小程序模板装修表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| template\_name  | 小程序模板名称| VARCHAR(50) | Yes | NULL | No |
| company\_id  | 公司ID| BIGINT | Yes | NULL | No |
| page\_name  | 页面名称| VARCHAR(50) | Yes | NULL | No |
| name  | 配置名称| VARCHAR(50) | Yes | NULL | No |
| version  | 配置版本| VARCHAR(10) | Yes | v1.0.0 | No |
| params  | 配置参数| LONGTEXT | Yes | NULL | No |
| pages\_template\_id  | 页面模板id| INT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_page\_nme | page\_name | No |
| idx\_company\_id | company\_id | No |
| ix\_pages\_template\_id | pages\_template\_id | No |
| idx\_pagename\_version\_name\_companyid\_templatename | page\_name, version, name, company\_id, template\_name | No |

<a name="table-wechat_weapp_template"></a>
## wechat\_weapp\_template

> **小程序模板表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| template\_name  | 小程序模板名称| VARCHAR(50) | Yes | NULL | No |
| template\_open\_status  | 小程序模板开通状态| VARCHAR(10) | Yes | NULL | No |
| template\_money  | 小程序模板开通金额，默认免费| VARCHAR(255) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |
| deleted\_at  | | DATETIME | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-wechatfans_bind_wechattag"></a>
## wechatfans\_bind\_wechattag

> **粉丝关联标微信签表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | 标签id| BIGINT | Yes | NULL | No |
| open\_id  | open\_id| VARCHAR(40) | Yes | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| authorizer\_appid  | 公众号appid| VARCHAR(64) | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id, open\_id, company\_id | Yes |

<a name="table-work_wechat_message"></a>
## work\_wechat\_message

> **企业微信通知**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| distributor\_id  | 店铺id| BIGINT | Yes | NULL | No |
| operator\_id  | 接受消息用户id| BIGINT | Yes | NULL | No |
| msg\_type  | 消息类型:1售后订单，2待发货订单，3未妥投订单| SMALLINT | No | NULL | No |
| content  | 内容| LONGTEXT | No | NULL | No |
| add\_time  | 添加时间| INT | No | NULL | No |
| up\_time  | 修改时间| INT | No | NULL | No |
| is\_read  | 是否已读:0,未读;1,已读| SMALLINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
| idx\_distributor\_id | distributor\_id | No |
| idx\_operator\_id | operator\_id | No |

<a name="table-work_wechat_message_manager_template"></a>
## work\_wechat\_message\_manager\_template

> **企业微信管理员通知模板**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 主键id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| template\_id  | 企业微信通知模板id| VARCHAR(255) | Yes | NULL | No |
| disabled  | 模版是否禁用| TINYINT(1) | Yes |  | No |
| title  | 企业微信通知模板标题| VARCHAR(255) | No |  | No |
| description  | 企业微信通知模板内容| VARCHAR(255) | No |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_template\_id | template\_id | No |

<a name="table-work_wechat_message_template"></a>
## work\_wechat\_message\_template

> **企业微信通知模板**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 企业微信通知模板| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| template\_id  | 企业微信通知模板id| VARCHAR(255) | Yes | NULL | No |
| disabled  | 模版是否开启| TINYINT(1) | Yes |  | No |
| emphasis\_first\_item  | 是否放大第一个| TINYINT(1) | Yes |  | No |
| title  | 企业微信通知模板标题| VARCHAR(255) | No |  | No |
| description  | 企业微信通知模板内容| VARCHAR(255) | No |  | No |
| content  | 通知主体消息| JSON | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-work_wechat_rel"></a>
## work\_wechat\_rel

> **企业微信用户关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 企业微信用户关联表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| work\_userid  | 通讯录成员id| VARCHAR(255) | No |  | No |
| salesperson\_id  | 导购员id| BIGINT | No | 0 | No |
| external\_userid  | 企业微信外部成员id| VARCHAR(255) | No |  | No |
| unionid  | 企业微信外部成员unionid| VARCHAR(255) | No |  | No |
| user\_id  | 会员id| BIGINT | No | 0 | No |
| is\_friend  | 是否好友 0 否 1 是| TINYINT(1) | No | 0 | No |
| is\_bind  | 是否绑定 0 否 1 是| TINYINT(1) | No | 0 | No |
| bound\_time  | 绑定时间| BIGINT | No | 0 | No |
| add\_friend\_time  | 添加好友时间| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id\_user\_id | company\_id, user\_id | No |

<a name="table-work_wechat_rel_logs"></a>
## work\_wechat\_rel\_logs

> **企业微信用户关联关系日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | 企业微信用户关联表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| work\_userid  | 通讯录成员id| VARCHAR(255) | Yes |  | No |
| salesperson\_id  | 导购员id| BIGINT | Yes | 0 | No |
| external\_userid  | 企业微信外部成员id| VARCHAR(255) | Yes |  | No |
| unionid  | 企业微信外部成员unionid| VARCHAR(255) | Yes |  | No |
| user\_id  | 会员id| BIGINT | Yes | 0 | No |
| is\_friend  | 是否好友 0 否 1 是| TINYINT(1) | Yes | 0 | No |
| remarks  | 企业微信用户关联关系日志| VARCHAR(60) | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |

<a name="table-work_wechat_verify_domain_file"></a>
## work\_wechat\_verify\_domain\_file

> **企业微信可信域名校验文件**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| operator\_id  | 授权操作者id| BIGINT | Yes | NULL | No |
| name  | 验证文件名| VARCHAR(255) | Yes |  | No |
| contents  | 验证文件内容| LONGTEXT | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | 更新时间| INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| ix\_name | name | Yes |

<a name="table-wsugc_badge"></a>
## wsugc\_badge

> **角标**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| badge\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| badge\_name  | 角标名称| VARCHAR(250) | Yes | NULL | No |
| badge\_memo  | 角标备注| VARCHAR(250) | No | NULL | No |
| mobile  | 手机号| VARCHAR(50) | No | NULL | No |
| p\_order  | 排序| INT | Yes | 0 | No |
| created  | 添加时间| INT UNSIGNED | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| ai\_verify\_time  | 机器审核时间| BIGINT | No | 0 | No |
| manual\_verify\_time  | 人工审核时间| BIGINT | No | 0 | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| enabled  | 是否启用.| INT | Yes | 1 | No |
| status  | 审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| ai\_refuse\_reason  | 机器拒绝理由| VARCHAR(255) | No | NULL | No |
| manual\_refuse\_reason  | 人工拒绝理由| VARCHAR(255) | No | NULL | No |
| is\_top  | 是否置顶.| INT | Yes | 0 | No |
| user\_id  | 创建的用户| BIGINT | Yes | 0 | No |
| source  | 来源 1用户,2官方| INT | No | 1 | No |
| operator\_id  | 管理员id| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | badge\_id | Yes |
| idx\_user\_id | user\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_mobile | mobile | No |

<a name="table-wsugc_comment"></a>
## wsugc\_comment

> **笔记评论**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| comment\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | Yes | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| parent\_comment\_id  | 父级评论id| BIGINT | Yes | NULL | No |
| reply\_comment\_id  | 回复评论id| BIGINT | Yes | NULL | No |
| reply\_user\_id  | 回复会员id| BIGINT | Yes | NULL | No |
| content  | 内容| LONGTEXT | No |  | No |
| likes  | 点赞数| VARCHAR(255) | Yes | NULL | No |
| ip  | ip| VARCHAR(255) | No | NULL | No |
| province  | 省份| VARCHAR(255) | No | NULL | No |
| city  | 城市| VARCHAR(255) | No | NULL | No |
| district  | 区县| VARCHAR(255) | No | NULL | No |
| p\_order  | 排序| INT | No | 0 | No |
| status  | 审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| enable  | 上架状态(0下架,1上架)| INT | Yes | 1 | No |
| disabled  | 是否无效| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| ai\_verify\_time  | 机器审核时间| BIGINT | No | 0 | No |
| manual\_verify\_time  | 人工审核时间| BIGINT | No | 0 | No |
| ai\_refuse\_reason  | 机器拒绝理由| VARCHAR(255) | No | NULL | No |
| manual\_refuse\_reason  | 人工拒绝理由| VARCHAR(255) | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | comment\_id | Yes |

<a name="table-wsugc_comment_like"></a>
## wsugc\_comment\_like

> **评论点赞**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| comment\_like\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | Yes | NULL | No |
| comment\_id  | 评论id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| disabled  | 是否无效| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | comment\_like\_id | Yes |
| idx\_post\_id | post\_id | No |
| idx\_comment\_id | comment\_id | No |
| idx\_disabled | disabled | No |

<a name="table-wsugc_follower"></a>
## wsugc\_follower

> ****

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| follower\_id  | id| INT UNSIGNED AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| follower\_user\_id  | 粉丝会员id| BIGINT | Yes | NULL | No |
| disabled  | 是否无效| TINYINT(1) | Yes |  | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | follower\_id | Yes |

<a name="table-wsugc_image_tag"></a>
## wsugc\_image\_tag

> **图片tag关联表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| image\_tag\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| image\_id  | 图片id| BIGINT | Yes | NULL | No |
| tag\_id  | 标签id| BIGINT | Yes | NULL | No |
| enabled  | 是否启用| INT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | image\_tag\_id | Yes |
| idx\_image\_id | image\_id | No |
| idx\_tag\_id | tag\_id | No |

<a name="table-wsugc_message"></a>
## wsugc\_message

> **消息**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| message\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| type  | 消息类型.system系统消息;replyPost回复消息likePost笔记点赞 favoritePost收藏笔记 followerUser关注了您| VARCHAR(255) | Yes | NULL | No |
| sub\_type  | 消息类型及子类型.系统消息(system):approve通过,reject拒绝,unenable下架; 回复消息(reply):replyPost评论了您的笔记,replyComment回复了您的评论; 收藏笔记(favoritePost):favorite收藏,unfavorite取消收藏; 关注(followerUser):follow关注,unfollow取关;  点赞(like):likePost点赞笔记,likeComment点赞评论| VARCHAR(255) | Yes | NULL | No |
| source  | 来源 1用户,2官方(系统通知)| INT | No | 1 | No |
| from\_user\_id  | 来自用户| BIGINT | Yes | 0 | No |
| from\_nickname  | 来自昵称| VARCHAR(255) | No |  | No |
| to\_user\_id  | 发给用户| BIGINT | Yes | 0 | No |
| to\_nickname  | 发给昵称| VARCHAR(255) | No |  | No |
| post\_id  | 笔记id| BIGINT | Yes | 0 | No |
| comment\_id  | 评论id| BIGINT | No | 0 | No |
| title  | 通知标题| VARCHAR(255) | No | NULL | No |
| content  | 通知内容| VARCHAR(255) | No | NULL | No |
| created  | 添加时间| INT UNSIGNED | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| hasread  | 是否已读.| TINYINT(1) | Yes |  | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | message\_id | Yes |
| idx\_to\_user\_id | to\_user\_id | No |
| idx\_type | type | No |
| idx\_post\_id | post\_id | No |
| idx\_comment\_id | comment\_id | No |
| idx\_hasread | hasread | No |
| idx\_company\_id | company\_id | No |

<a name="table-wsugc_post"></a>
## wsugc\_post

> **笔记**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| post\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| operator\_id  | 管理员id| BIGINT | No | 0 | No |
| source  | 来源 1用户,2官方| INT | No | 1 | No |
| title  | 标题| VARCHAR(255) | Yes | NULL | No |
| likes  | 点赞数| INT | Yes | NULL | No |
| ip  | ip地址| VARCHAR(255) | No | NULL | No |
| mobile  | 手机号| VARCHAR(255) | No | NULL | No |
| cover  | 封面图| VARCHAR(255) | No | NULL | No |
| video  | 视频| VARCHAR(255) | No | NULL | No |
| video\_ratio  | 视频比例| VARCHAR(255) | No | NULL | No |
| video\_place  | 视频位置| VARCHAR(255) | No | NULL | No |
| video\_thumb  | 视频缩略图| VARCHAR(255) | No | NULL | No |
| position  | 坐标| VARCHAR(255) | No | NULL | No |
| is\_top  | 是否置顶.| INT | Yes | 0 | No |
| address  | 地址| VARCHAR(255) | No | NULL | No |
| topics  | 话题| LONGTEXT | No | NULL | No |
| badges  | 角标| LONGTEXT | No | NULL | No |
| goods  | 商品| LONGTEXT | No | NULL | No |
| images  | 多图| LONGTEXT | No |  | No |
| image\_path  | 多图相对路径| LONGTEXT | No |  | No |
| image\_tag  | 图片的tag信息| LONGTEXT | No |  | No |
| content  | 内容| LONGTEXT | No |  | No |
| p\_order  | 排序| INT | No | 0 | No |
| share\_nums  | 分享次数| INT | No | 0 | No |
| view\_auth  | 可见状态0所有，1仅自己| INT | Yes | 0 | No |
| is\_draft  | 是否草稿0否，1是| INT | Yes | 0 | No |
| enabled  | 发布状态| INT | Yes | 0 | No |
| disabled  | 是否无效(删除)| INT | Yes | 0 | No |
| status  | 审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| title\_status  | 标题审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| content\_status  | 内容审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| image\_status  | 图片审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| trace\_ids  | 微信内容审查-图片内容追踪id集合,仅ID ,111:false,2222:false,| LONGTEXT | Yes | NULL | No |
| mediacheck\_traceid  | 微信内容审查-图片内容追踪id集合| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| ai\_verify\_time  | 机器审核时间| BIGINT | No | 0 | No |
| manual\_verify\_time  | 人工审核时间| BIGINT | No | 0 | No |
| ai\_refuse\_reason  | 机器拒绝理由| VARCHAR(255) | No | NULL | No |
| manual\_refuse\_reason  | 人工拒绝理由| VARCHAR(255) | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | post\_id | Yes |
| idx\_user\_id | user\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-wsugc_post_badge"></a>
## wsugc\_post\_badge

> **笔记角标**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| post\_badge\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | Yes | NULL | No |
| badge\_id  | 角标id| BIGINT | Yes | NULL | No |
| created  | 添加时间| INT UNSIGNED | Yes | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | post\_badge\_id | Yes |
| idx\_post\_id | post\_id | No |
| idx\_badge\_id | badge\_id | No |

<a name="table-wsugc_post_favorite"></a>
## wsugc\_post\_favorite

> **笔记收藏**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| post\_favorite\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| disabled  | 是否无效| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | post\_favorite\_id | Yes |
| idx\_post\_id | post\_id | No |
| idx\_user\_id | user\_id | No |
| idx\_disabled | disabled | No |

<a name="table-wsugc_post_goods"></a>
## wsugc\_post\_goods

> **笔记**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| post\_goods\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | Yes | NULL | No |
| goods\_id  | 视频id| BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | post\_goods\_id | Yes |
| idx\_post\_id | post\_id | No |

<a name="table-wsugc_post_image"></a>
## wsugc\_post\_image

> **笔记的图片**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| post\_image\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | No | 0 | No |
| user\_id  | user\_id| BIGINT | No | 0 | No |
| image\_id  | image\_id| BIGINT | No | 0 | No |
| image\_url  | 图片地址相对| VARCHAR(255) | Yes | NULL | No |
| p\_order  | 排序| INT | No | 50 | No |
| activity\_joiner\_condition  | 学员要求| LONGTEXT | No | NULL | No |
| activity\_brief  | 活动简介| LONGTEXT | No | NULL | No |
| yuyue\_begin\_time  | 活动报名开始时间| INT | No | NULL | No |
| yuyue\_end\_time  | 活动报名结束时间| INT | No | NULL | No |
| cat\_id  | 活动类型| LONGTEXT | No | NULL | No |
| start\_time  | 活动开始时间| INT | Yes | NULL | No |
| end\_time  | 活动结束时间| INT | Yes | NULL | No |
| join\_limit  | 可参与次数| INT | Yes | 0 | No |
| limit\_number  | 限制人数| INT | Yes | 0 | No |
| teacher\_title  | 老师头衔| VARCHAR(255) | Yes |  | No |
| teacher\_name  | 可参与次数| VARCHAR(255) | Yes |  | No |
| teacher\_brief  | 可参与次数| LONGTEXT | Yes |  | No |
| teacher\_avatar  | 可参与次数| VARCHAR(255) | Yes |  | No |
| is\_sms\_notice  | 是否短信通知| TINYINT(1) | Yes | 1 | No |
| is\_wxapp\_notice  | 是否小程序模板通知| TINYINT(1) | Yes | 1 | No |
| enabled  | 是否启用| INT | Yes | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | post\_image\_id | Yes |
| idx\_post\_id | post\_id | No |

<a name="table-wsugc_post_like"></a>
## wsugc\_post\_like

> **笔记点赞**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| post\_like\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | Yes | NULL | No |
| user\_id  | 会员id| BIGINT | Yes | NULL | No |
| disabled  | 是否无效| TINYINT(1) | Yes |  | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | post\_like\_id | Yes |
| idx\_post\_id | post\_id | No |
| idx\_disabled | disabled | No |

<a name="table-wsugc_post_reviewlog"></a>
## wsugc\_post\_reviewlog

> **笔记审核日志**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| log\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| post\_id  | 笔记id| BIGINT | No | NULL | No |
| operator\_id  | 操作员id| BIGINT | No | NULL | No |
| operator  | 操作员名称或手机| VARCHAR(255) | No | NULL | No |
| user\_id  | 用户id| BIGINT | Yes | NULL | No |
| record\_date  | 记录提交日期| INT | Yes | NULL | No |
| shop\_id  | 门店id| BIGINT | No | NULL | No |
| temp\_id  | 模板id| BIGINT | No | NULL | No |
| form\_data  | 记录表单内容| LONGTEXT | Yes | NULL | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | log\_id | Yes |
| idx\_post\_id | post\_id | No |
| idx\_company\_id | company\_id | No |

<a name="table-wsugc_post_topic"></a>
## wsugc\_post\_topic

> ****

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| post\_topic\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| post\_id  | 笔记id| BIGINT | Yes | NULL | No |
| topic\_id  | 话题id| VARCHAR(50) | Yes | NULL | No |
| created  | 添加时间| INT UNSIGNED | Yes | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | post\_topic\_id | Yes |
| idx\_post\_id | post\_id | No |
| idx\_topic\_id | topic\_id | No |

<a name="table-wsugc_setting"></a>
## wsugc\_setting

> **ugc通用设置**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| keyname  | 键名| VARCHAR(255) | No | NULL | No |
| value  | 值| LONGTEXT | No | NULL | No |
| type  | 类型| VARCHAR(255) | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| created  | 添加时间| INT UNSIGNED | Yes | NULL | No |
| updated  | | INT | No | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_type | type | No |
| idx\_keyname | keyname | No |
| idx\_company\_id | company\_id | No |

<a name="table-wsugc_tag"></a>
## wsugc\_tag

> **图片tag**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| tag\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| tag\_name  | 标签名称| VARCHAR(250) | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(50) | No | NULL | No |
| user\_id  | 创建的用户| BIGINT | Yes | 0 | No |
| enabled  | 是否启用| INT | Yes | 1 | No |
| status  | 审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| ai\_verify\_time  | 机器审核时间| BIGINT | No | 0 | No |
| manual\_verify\_time  | 人工审核时间| BIGINT | No | 0 | No |
| ai\_refuse\_reason  | 机器拒绝理由| VARCHAR(255) | No | NULL | No |
| manual\_refuse\_reason  | 人工拒绝理由| VARCHAR(255) | No | NULL | No |
| created  | | INT | Yes | NULL | No |
| p\_order  | 排序| INT UNSIGNED | Yes | 0 | No |
| updated  | | INT | No | NULL | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| source  | 来源 1用户,2官方| INT | No | 1 | No |
| operator\_id  | 管理员id| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | tag\_id | Yes |
| idx\_user\_id | user\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_mobile | mobile | No |

<a name="table-wsugc_topic"></a>
## wsugc\_topic

> **话题**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| topic\_id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| topic\_name  | 话题名称| VARCHAR(250) | Yes | NULL | No |
| mobile  | 手机号| VARCHAR(50) | No | NULL | No |
| p\_order  | 排序| INT | Yes | 0 | No |
| created  | 添加时间| INT UNSIGNED | Yes | NULL | No |
| updated  | | INT | No | NULL | No |
| ai\_verify\_time  | 机器审核时间| BIGINT | No | 0 | No |
| manual\_verify\_time  | 人工审核时间| BIGINT | No | 0 | No |
| company\_id  | | BIGINT | Yes | NULL | No |
| enabled  | 是否启用.| INT | Yes | 1 | No |
| status  | 审核状态(0待审核,1审核通过,2机器拒绝,3待人工审核,4人工拒绝)| INT | Yes | 0 | No |
| ai\_refuse\_reason  | 机器拒绝理由| VARCHAR(255) | No | NULL | No |
| manual\_refuse\_reason  | 人工拒绝理由| VARCHAR(255) | No | NULL | No |
| is\_top  | 是否置顶.| INT | Yes | 0 | No |
| user\_id  | 创建的用户| BIGINT | Yes | 0 | No |
| source  | 来源 1用户,2官方| INT | No | 1 | No |
| operator\_id  | 管理员id| BIGINT | No | 0 | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | topic\_id | Yes |
| idx\_user\_id | user\_id | No |
| idx\_company\_id | company\_id | No |
| idx\_mobile | mobile | No |

<a name="table-wx_external_config"></a>
## wx\_external\_config

> **外部小程序配置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| wx\_external\_config\_id  | 外部小程序配置表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| app\_id  | 小程序APPID| VARCHAR(255) | Yes | NULL | No |
| app\_name  | 小程序名称| VARCHAR(255) | No | NULL | No |
| app\_desc  | 描述| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | wx\_external\_config\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-wx_external_routes"></a>
## wx\_external\_routes

> **外部小程序路径表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| wx\_external\_routes\_id  | 外部小程序路径表id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | 公司company id| BIGINT | Yes | NULL | No |
| wx\_external\_config\_id  | 外部小程序配置表id| BIGINT | Yes | NULL | No |
| route\_name  | 页面名称| VARCHAR(255) | Yes | NULL | No |
| route\_info  | 页面路径| VARCHAR(255) | Yes | NULL | No |
| route\_desc  | 描述| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | wx\_external\_routes\_id | Yes |
| idx\_company\_id | company\_id | No |

<a name="table-wxshops"></a>
## wxshops

> **微信门店表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| wx\_shop\_id  | 自增id| BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| map\_poi\_id  | 从腾讯地图换取的位置点id，即search\_map\_poi接口返回的sosomap\_poi\_uid字段| VARCHAR(255) | No | NULL | No |
| store\_name  | 腾讯地图的门店名称| VARCHAR(100) | No | NULL | No |
| poi\_id  | 门店id| VARCHAR(255) | No | NULL | No |
| lng  | 腾讯地图纬度| VARCHAR(255) | No | NULL | No |
| lat  | 腾讯地图经度| VARCHAR(255) | No | NULL | No |
| address  | 腾讯地图门店地址| VARCHAR(500) | Yes | NULL | No |
| category  | 腾讯地图门店类目| VARCHAR(255) | No | NULL | No |
| distributor\_id  | 门店所属店铺ID| BIGINT | Yes | 0 | No |
| pic\_list  | 门店图片，可传多张图片pic\_list字段是一个json| LONGTEXT | No | NULL | No |
| contract\_phone  | 联系电话| VARCHAR(20) | Yes | NULL | No |
| add\_type  | 1,公众号主体；2,相关主体; 3,无主体| SMALLINT | Yes | NULL | No |
| hour  | 营业时间，格式11:11-12:12| VARCHAR(20) | Yes | NULL | No |
| credential  | 经营资质证件号| VARCHAR(30) | No | NULL | No |
| company\_name  | 主体名字 临时素材mediaid，如果复用公众号主体，则company\_name为空，如果不复用公众号主体，则company\_name为具体的主体名字| VARCHAR(30) | No | NULL | No |
| qualification\_list  | 相关证明材料，临时素材mediaid，不复用公众号主体时，才需要填| VARCHAR(255) | No | NULL | No |
| card\_id  | 卡券id，如果不需要添加卡券，该参数可为空，目前仅开放支持会员卡、买单和刷卡支付券，不支持自定义code，需要先去公众平台卡券后台创建cardid| VARCHAR(20) | No | NULL | No |
| status  | 审核状态，1：审核成功，2：审核中，3：审核失败，4：管理员拒绝, 5: 无需审核| SMALLINT | Yes | NULL | No |
| errmsg  | 审核失败原因| VARCHAR(255) | No | NULL | No |
| company\_id  | 公司id| BIGINT | Yes | NULL | No |
| audit\_id  | 微信返回的审核id| VARCHAR(20) | No | NULL | No |
| resource\_id  | 资源包id| BIGINT | No | NULL | No |
| expired\_at  | 过期时间| BIGINT | No | NULL | No |
| is\_default  | 是否是默认门店| TINYINT(1) | Yes |  | No |
| country  | 非中国国家名称| VARCHAR(100) | No | NULL | No |
| city  | 非中国门店所在城市| VARCHAR(100) | No | NULL | No |
| is\_domestic  | 是否是中国国内门店 1:国内(包含港澳台),2:非国内| SMALLINT | No | 1 | No |
| is\_direct\_store  | 是否为直营店 1:直营店,2:非直营店| SMALLINT | No | 1 | No |
| is\_open  | 是否开启 1:开启,0:关闭| TINYINT(1) | No | 1 | No |
| created  | | INT | Yes | NULL | No |
| updated  | | INT | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | wx\_shop\_id | Yes |

<a name="table-youshu_setting"></a>
## youshu\_setting

> **有数参数设置表**

- 表结构

| ColumnName | Comment | Type | Not null | Default | Autoincrement |
| ------------- |-------------|-------------|-------------|-------------|-------------|
| id  | | BIGINT AUTO_INCREMENT | Yes | NULL | Yes |
| company\_id  | | BIGINT | Yes | NULL | No |
| merchant\_id  | merchant\_id| VARCHAR(255) | No | NULL | No |
| app\_id  | 有数app\_id，正式| VARCHAR(255) | No | NULL | No |
| app\_secret  | 有数app\_secret，正式| VARCHAR(255) | No | NULL | No |
| api\_url  | 有数后端api url，正式| VARCHAR(255) | No | NULL | No |
| sandbox\_app\_id  | 有数app\_id，沙箱| VARCHAR(255) | No | NULL | No |
| sandbox\_app\_secret  | 有数app\_secret，沙箱| VARCHAR(255) | No | NULL | No |
| sandbox\_api\_url  | 有数后端api url，沙箱| VARCHAR(255) | No | NULL | No |
| weapp\_name  | 小程序名称| VARCHAR(255) | No | NULL | No |
| weapp\_app\_id  | 小程序app\_id| VARCHAR(255) | No | NULL | No |
| created\_at  | | DATETIME | Yes | NULL | No |
| updated\_at  | | DATETIME | Yes | NULL | No |

- 索引

| Key name | Column names | Unique |
| ------------- |-------------|-------------|
| primary | id | Yes |
| idx\_company\_id | company\_id | No |
