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

namespace JinDouYun\Dao\Commission;

use JinDouYun\Dao\BaseDao;

class DCommissionBusinessman extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'commission_businessman';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '分销商表',
            "userCenterId", //int(10) DEFAULT NULL COMMENT '用户id',
            "customerId", //int(10) DEFAULT NULL COMMENT '客户id',
            "gradeId", //int(10) DEFAULT NULL COMMENT '等级id',
            "grade", //int(10) DEFAULT NULL COMMENT '等级',
            "info", //json DEFAULT NULL COMMENT '信息',
            "balance", //decimal(8,2) DEFAULT '0.00' COMMENT '余额',
            "waitMoney", //decimal(8,2) DEFAULT '0.00' COMMENT '待入账金额',
            "waitAuditWithdraw", //decimal(8,2) DEFAULT '0.00' COMMENT '提现待审核金额',
            "auditWithdraw", //decimal(8,2) DEFAULT '0.00' COMMENT '提现待入账金额',
            "withdraw", //decimal(8,2) DEFAULT '0.00' COMMENT '已提现金额',
            "totalMoney", //decimal(8,2) DEFAULT '0.00' COMMENT '总金额',
            "statistics", //json DEFAULT NULL COMMENT '升级条件值统计',
            "applicationCondition", //tinyint(1) DEFAULT '0' COMMENT '申请条件 0:无条件 1:资料申请 2:订单申请 3:金额申请 4:商品申请',
            "applicationComplete", //tinyint(1) DEFAULT '4' COMMENT '满足申请条件 4:不满足 5:满足',
            "deleteStatus", //tinyint(1) DEFAULT '5' COMMENT '删除状态 4:删除 5:正常',
            "auditStatus", //tinyint(1) DEFAULT '1' COMMENT '审核状态 1:未审核 2:已审核',
            "auditTime", //int(10) DEFAULT NULL COMMENT '审核时间',
            "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
            "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间',
            "extend", //json DEFAULT NULL COMMENT '扩展字段',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}