<?php
/**
 * 分红记录
 * Created by PhpStorm.
 * User: wxj
 * Date: 2019/10/31
 * Time: 15:02
 */

namespace JinDouYun\Dao\Holders;

use JinDouYun\Dao\BaseDao;

class DHoldersBonus extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'holders_bonus';
        $this->_primary = 'id';
        $this->_fields = [
            'id',// int unsigned NOT NULL AUTO_INCREMENT,
            'hol_id', // int NOT NULL,
            'en_id',// int NOT NULL,
            'mark',// varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '分红说明',
            'type',// tinyint NOT NULL COMMENT '分红类型1原始股份分红2分红股份分红',
            'number',// decimal(10,2) NOT NULL COMMENT '分红金额',
            'before',// decimal(10,2) NOT NULL COMMENT '变动前',
            'after',// decimal(10,2) NOT NULL COMMENT '变动后',
            'total',// decimal(10,2) NOT NULL COMMENT '分红总金额',
            'shares',// decimal(10,2) NOT NULL COMMENT '持有股份',
            'createTime',// int NOT NULL COMMENT '时间',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}