<?php
/**
 * 分销设置Dao
 * Created by PhpStorm.
 * User: haoren
 * Date: 2020/07/22
 * Time: 15:00
 */

namespace JinDouYun\Dao\Commission;

use JinDouYun\Dao\BaseDao;

class DCommissionSetting extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'commission_setting';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '分销基础设置表自增id',
            "enterpriseId", //int(10) NOT NULL COMMENT '企业id',
            "level", //tinyint(2) DEFAULT '3' COMMENT '分销层级 1~3级',
            "self", //tinyint(1) DEFAULT '4' COMMENT '分销自购 4:关闭 5:自购返佣',
            "audit", //tinyint(1) DEFAULT '5' COMMENT '分销客户审核 4:关闭 5:开启',
            "businessmanCondition", //tinyint(1) DEFAULT '1' COMMENT '成为分销商条件 0:无条件 1:申请 3:消费次数 4:消费金额 5:购买商品',
            "buyNum", //int(10) DEFAULT NULL COMMENT '消费次数',
            "buyAmount", //decimal(8,2) DEFAULT NULL COMMENT '消费金额',
            "buyGoods", //json DEFAULT NULL COMMENT '指定商品',
            "buyCondition", //tinyint(1) DEFAULT NULL COMMENT '消费条件 4:付款后 5:订单完成',
            "image", //varchar(255) DEFAULT NULL COMMENT '申请图片',
            "infoStatus", //tinyint(1) DEFAULT '5' COMMENT '补全资料 4:不必补全 5:必须补全',
            "info", //json DEFAULT NULL COMMENT '资料内容',
            "descStatus", //tinyint(1) DEFAULT '4' COMMENT '是否展示申请协议 4:不展示 5:展示',
            "title", // varchar(255) DEFAULT NULL COMMENT '申请协议标题',
            "desc", //varchar(255) DEFAULT NULL COMMENT '申请协议',
            "subConditions", //tinyint(1) DEFAULT '1' COMMENT '成为下线条件 1:首次点击链接 2:首次下单 3:首次付款',
            "goods", //tinyint(1) DEFAULT '4' COMMENT '商品默认分销 4:不默认 5:默认 ',
            "mode", //tinyint(1) DEFAULT '5' COMMENT '佣金计算方式 4:订单金额 5:实际支付金额',
            "quota", //decimal(10,2) DEFAULT '0.00' COMMENT '最低提现额度',
            "fee", //int(10) DEFAULT '0' COMMENT '提现手续费(%)',
            "freeStart", //decimal(10,2) DEFAULT '0.00' COMMENT '免手续费区间开始',
            "freeEnd", //decimal(10,2) DEFAULT '0.00' COMMENT '免手续费区间结束',
            "day", //int(10) DEFAULT '0' COMMENT '结算天数',
            "withdrawAudit", //tinyint(1) DEFAULT '5' COMMENT '提现审核方式 4:自动审核 5:手动审核',
            "withdrawGrade", // int(3) DEFAULT '0' COMMENT '提现自动审核最低等级',
            "withdrawAmount", // decimal(8,2) DEFAULT NULL COMMENT '提现自动审核最低金额',
            "autoPay", // tinyint(1) DEFAULT NULL COMMENT '自动打款 4:关闭 5:开启',
            "payType", //tinyint(1) DEFAULT '5' COMMENT '打款方式 4:自动打款到微信 5:手动打款',
            "withdrawType", //tinyint(1) DEFAULT '4' COMMENT '手动打款支持提现方式 4:支付宝 5:银行卡',
            "withdrawInfo", //json DEFAULT NULL COMMENT '手动提现数据 包含:多个银行卡号,支付宝',
            "leaderboard", //tinyint(1) DEFAULT '4' COMMENT '排行榜展示 4:关闭 5:开启',
            "createTime", //int(10) DEFAULT '0' COMMENT '创建时间',
            "updateTime", //int(10) DEFAULT '0' COMMENT '修改时间',
            "extend", //json DEFAULT NULL COMMENT '扩展字段',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}