<?php

namespace JinDouYun\Dao\Commission;

use JinDouYun\Dao\BaseDao;

/**
 * Description:分销订单记录表
 * Class DCommissionOrder
 * @package JinDouYun\Dao\Commission
 */
class DCommissionOrder extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'commission_order';
        $this->_primary = 'id';
        $this->_fields = [
            "id",//int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
            "userCenterId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id (买家)',
            "customerId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '客户id (买家)',
            "orderId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
            "orderNo",//varchar(50) NOT NULL DEFAULT '' COMMENT '订单号',
            "goodsId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
            "skuId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'skuId',
            "goodsPrice",//decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品金额',
            "retUserCenterId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '返佣用户id',
            "retCustomerId",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '返佣客户id',
            "retMoney",//decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '分销佣金',
            "retLevel",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '返佣用户级别 1,2,3',
            "retGrade",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '返佣用户等级 1-10级',
            "isSettled",//tinyint(3) unsigned NOT NULL DEFAULT '4' COMMENT '是否已结算佣金 (4未结算 5已结算)',
            "settleTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '结算时间',
            "isSelf",//tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否自购返佣金 (4否 5是)',
            "createTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
            "updateTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
            "extends",//json DEFAULT NULL COMMENT '拓展字段',
            "retRate",//decimal(10,2) DEFAULT '0.00' COMMENT '返佣百分比',
            "buyNum",//varchar(50) DEFAULT '0' COMMENT '商品数量',
            "goodsName",//varchar(255) DEFAULT '' COMMENT '商品名称',
            "shopName",//varchar(255) DEFAULT '' COMMENT '店铺名称',
            "unitName",//varchar(50) DEFAULT '' COMMENT '单位名称',
            "specGroup",//json DEFAULT NULL COMMENT '规格组合',
            "goodsImages",//varchar(255) DEFAULT '' COMMENT '商品图片',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}