ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
```[sql] CREATE TABLE ns_fenxiao ( fenxiao_id int(11) NOT NULL AUTO_INCREMENT, fenxiao_no varchar(255) NOT NULL DEFAULT '' COMMENT '分销商编号', fenxiao_name varchar(255) NOT NULL DEFAULT '' COMMENT '分销店铺名', mobile varchar(20) NOT NULL DEFAULT '0' COMMENT '联系电话', member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员ID', level_id int(11) NOT NULL DEFAULT 0 COMMENT '分销商等级id', level_name varchar(255) NOT NULL DEFAULT '' COMMENT '等级名称', parent int(11) NOT NULL DEFAULT 0 COMMENT '上级ID', grand_parent int(11) NOT NULL DEFAULT 0 COMMENT '上上级id', account decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '当前佣金', account_withdraw decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '已提现佣金', account_withdraw_apply decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现中佣金', status tinyint(3) NOT NULL DEFAULT 1 COMMENT '状态(1已审核 2拒绝 -1已冻结)', create_time int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', audit_time int(11) NOT NULL DEFAULT 0 COMMENT '成为经分销商时间', lock_time int(11) NOT NULL DEFAULT 0 COMMENT '冻结时间', one_fenxiao_order_num int(11) NOT NULL DEFAULT 0 COMMENT '一级分销订单总数', one_fenxiao_order_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '一级分销订单总额', one_child_num int(11) NOT NULL DEFAULT 0 COMMENT '一级下线人数', one_child_fenxiao_num int(11) NOT NULL DEFAULT 0 COMMENT '一级下线分销商', two_child_fenxiao_num int(11) NOT NULL DEFAULT 0 COMMENT '二级下线分销商', total_commission decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '累计佣金', PRIMARY KEY (fenxiao_id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销商表'; CREATE TABLE ns_fenxiao_account ( id int(11) UNSIGNED NOT NULL AUTO_INCREMENT, account_no varchar(255) NOT NULL DEFAULT '' COMMENT '账单编号', fenxiao_id int(11) NOT NULL DEFAULT 0 COMMENT '分销商ID', fenxiao_name varchar(255) NOT NULL DEFAULT '' COMMENT '分销商名称', money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '费用', type varchar(50) NOT NULL DEFAULT '1' COMMENT '类型(withdraw提现 order订单结算)', type_name varchar(255) NOT NULL DEFAULT '' COMMENT '类型名称', relate_id int(11) NOT NULL DEFAULT 0 COMMENT '关联id', create_time int(11) NOT NULL DEFAULT 0 COMMENT '时间', PRIMARY KEY (id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销商流水表'; CREATE TABLE ns_fenxiao_apply ( apply_id int(11) UNSIGNED NOT NULL AUTO_INCREMENT, fenxiao_name varchar(255) NOT NULL DEFAULT '' COMMENT '分销商店铺名', parent int(11) NOT NULL DEFAULT 0 COMMENT '上级分销商ID', member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员ID', mobile varchar(20) NOT NULL DEFAULT '0' COMMENT '联系电话', nickname varchar(50) NOT NULL DEFAULT '' COMMENT '用户昵称', headimg varchar(255) NOT NULL DEFAULT '' COMMENT '用户头像', level_id int(11) NOT NULL DEFAULT 0 COMMENT '申请等级', level_name varchar(50) NOT NULL DEFAULT '' COMMENT '等级名称', order_complete_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '订单完成-消费金额', order_complete_num int(10) NOT NULL DEFAULT 0 COMMENT '订单完成-消费次数', reg_time int(11) NOT NULL DEFAULT 0 COMMENT '注册时间', create_time int(11) NOT NULL DEFAULT 0 COMMENT '申请时间', update_time int(11) NOT NULL DEFAULT 0, status tinyint(1) NOT NULL DEFAULT 1 COMMENT '申请状态(1申请中 2通过 -1拒绝)', PRIMARY KEY (apply_id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销商申请表'; CREATE TABLE dasfdfs.ns_fenxiao_goods ( fenxiao_goods_id int(11) UNSIGNED NOT NULL AUTO_INCREMENT, goods_id int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品ID', one_rate decimal(10,2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '一级佣金', two_rate decimal(10,2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '二级佣金', three_rate decimal(10,2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '三级佣金', state tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否参与', PRIMARY KEY (fenxiao_goods_id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销商品表'; CREATE TABLE ns_fenxiao_goods_collect ( collect_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id', fenxiao_id int(11) NOT NULL DEFAULT 0 COMMENT '分销商id', goods_id int(11) NOT NULL DEFAULT 0 COMMENT '商品id', sku_id int(11) NOT NULL DEFAULT 0 COMMENT 'skuid', create_time int(11) NOT NULL DEFAULT 0 COMMENT '收藏时间', site_id int(10) NOT NULL DEFAULT 0 COMMENT '站点id', PRIMARY KEY (collect_id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销商关注商品表'; CREATE TABLE ns_fenxiao_goods_sku ( goods_sku_id int(11) UNSIGNED NOT NULL AUTO_INCREMENT, goods_id int(11) NOT NULL DEFAULT 0 COMMENT '商品ID', sku_id int(11) NOT NULL DEFAULT 0 COMMENT '商品skuID', level_id int(11) NOT NULL DEFAULT 0 COMMENT '分销等级ID', one_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '一级佣金比例', one_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '一级佣金金额', two_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '二级佣金比例', two_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '二级佣金金额', three_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '三级佣金比例', three_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '三级佣金金额', PRIMARY KEY (goods_sku_id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销商品sku表'; CREATE TABLE ns_fenxiao_level ( level_id int(11) UNSIGNED NOT NULL AUTO_INCREMENT, level_num varchar(10) NOT NULL DEFAULT '' COMMENT '等级权重', level_name varchar(30) NOT NULL DEFAULT '' COMMENT '等级名称', one_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '一级佣金比例', two_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '二级佣金比例', three_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '三级佣金比例', upgrade_type tinyint(3) NOT NULL DEFAULT 0 COMMENT '升级方式(0满足任意条件 1满足全部条件)', fenxiao_order_num int(11) NOT NULL DEFAULT 0 COMMENT '订单总数', fenxiao_order_meney decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '订单总金额', one_fenxiao_order_num int(11) NOT NULL DEFAULT 0 COMMENT '一级分销订单总数', one_fenxiao_order_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '一级分销订单总额', order_num int(11) NOT NULL DEFAULT 0 COMMENT '自购订单总数', order_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '自购订单总额', child_num int(11) NOT NULL DEFAULT 0 COMMENT '下线人数', child_fenxiao_num int(11) NOT NULL DEFAULT 0 COMMENT '下线分销商人数', one_child_num int(11) NOT NULL DEFAULT 0 COMMENT '一级下线人数', one_child_fenxiao_num int(11) NOT NULL DEFAULT 0 COMMENT '一级下线分销商', status tinyint(3) NOT NULL DEFAULT 0 COMMENT '状态(0关闭 1启用)', create_time int(11) NOT NULL DEFAULT 0, update_time int(11) NOT NULL DEFAULT 0, PRIMARY KEY (level_id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销等级配置表'; CREATE TABLE ns_fenxiao_order ( fenxiao_order_id int(11) UNSIGNED NOT NULL AUTO_INCREMENT, order_id int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单ID', order_no varchar(255) NOT NULL DEFAULT '' COMMENT '订单编号', order_goods_id int(11) NOT NULL DEFAULT 0 COMMENT '订单项ID', site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点ID', site_name varchar(255) NOT NULL DEFAULT '' COMMENT '站点名称', goods_id int(11) NOT NULL DEFAULT 0 COMMENT '商品ID', sku_id int(11) NOT NULL DEFAULT 0 COMMENT '商品skuid', sku_name varchar(255) NOT NULL DEFAULT '' COMMENT '商品sku名称', sku_image varchar(255) NOT NULL DEFAULT '' COMMENT '商品图片', price decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '商品卖价', num int(11) NOT NULL DEFAULT 0 COMMENT '商品数量', real_goods_money decimal(10,2) NOT NULL COMMENT '商品总价', member_id int(11) NOT NULL DEFAULT 0 COMMENT '购买人ID', member_name varchar(255) NOT NULL DEFAULT '' COMMENT '购买人名称', member_mobile varchar(255) NOT NULL DEFAULT '' COMMENT '购买人电话', full_address varchar(255) NOT NULL DEFAULT '' COMMENT '购买人详细地址', commission decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '总佣金', commission_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '分销总比率', one_fenxiao_id int(11) NOT NULL DEFAULT 0 COMMENT '一级分销商ID', one_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '一级分销比例', one_commission decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '一级分销佣金', one_fenxiao_name varchar(255) NOT NULL DEFAULT '' COMMENT '一级分销商名', two_fenxiao_id int(11) NOT NULL DEFAULT 0 COMMENT '二级分销商ID', two_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '二级分销比例', two_commission decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '二级分销佣金', two_fenxiao_name varchar(255) NOT NULL DEFAULT '' COMMENT '二级分销商名', three_fenxiao_id int(11) NOT NULL DEFAULT 0 COMMENT '三级分销商ID', three_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '三级分销比例', three_commission decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '三级分销佣金', three_fenxiao_name varchar(255) NOT NULL DEFAULT '' COMMENT '三级分销商名', is_settlement tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否结算', is_refund tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否退款', PRIMARY KEY (fenxiao_order_id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '分销配置表'; CREATE TABLE ns_fenxiao_withdraw ( id int(11) NOT NULL AUTO_INCREMENT, withdraw_no varchar(255) NOT NULL DEFAULT '' COMMENT '提现流水号', member_id int(11) NOT NULL DEFAULT 0 COMMENT '会员id', fenxiao_id int(11) NOT NULL DEFAULT 0 COMMENT '分销商id', fenxiao_name varchar(255) NOT NULL DEFAULT '' COMMENT '分销商名称', withdraw_type varchar(32) NOT NULL DEFAULT '' COMMENT '提现类型(weixin-微信 alipay-支付宝 balance-余额 bank银行卡)', bank_name varchar(50) NOT NULL DEFAULT '' COMMENT '提现银行名称', account_number varchar(50) NOT NULL DEFAULT '' COMMENT '提现银行账号', realname varchar(10) NOT NULL DEFAULT '' COMMENT '提现账户姓名', mobile varchar(20) NOT NULL DEFAULT '' COMMENT '手机', money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现金额', withdraw_rate decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现手续费率', withdraw_rate_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现手续费金额', real_money decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '实际到账金额', status smallint(6) NOT NULL DEFAULT 1 COMMENT '当前状态 1待审核 2已审核 -1 已拒绝', remark varchar(255) NOT NULL DEFAULT '' COMMENT '备注', create_time int(11) NOT NULL DEFAULT 0 COMMENT '申请日期', payment_time int(11) NOT NULL DEFAULT 0 COMMENT '到账日期', modify_time int(11) NOT NULL DEFAULT 0 COMMENT '修改日期', transfer_type int(11) NOT NULL DEFAULT 1 COMMENT '转账方式 1 线下转账 2线上转账', transfer_name varchar(50) NOT NULL DEFAULT '' COMMENT '转账银行名称', transfer_remark varchar(255) NOT NULL DEFAULT '' COMMENT '转账备注', transfer_no varchar(255) NOT NULL DEFAULT '' COMMENT '转账流水号', transfer_account_no varchar(255) NOT NULL DEFAULT '' COMMENT '转账银行账号', PRIMARY KEY (id) ) ENGINE = INNODB, CHARACTER SET utf8, COLLATE utf8_general_ci, COMMENT = '会员余额提现记录表'; ```