<?php
/**
 * Created by PhpStorm.
 * User: Gss
 * Date: 2021/3/26 0026
 * Time: 10:44
 */

namespace JinDouYun\Dao\Customer;


use JinDouYun\Dao\BaseDao;

class DMemberBalanceDetail extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'qianniao_member_balance_detail_1';
        $this->_primary = 'id';
        $this->_fields = [
                'id',//int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '会员余额明细表',
                'customerId',//int(10) DEFAULT NULL COMMENT '客户id',
                'userCenterId',//int(10) DEFAULT NULL COMMENT '账户id',
                'type',//int(1) NOT NULL COMMENT '金额类型   5收入/4支出',
                'purpose',//varchar(255) NOT NULL COMMENT '用途',
                'beforeMoney',//decimal(15,4) NOT NULL COMMENT '变动之前余额',
                'money',//decimal(15,4) NOT NULL COMMENT '变动金额',
                'afterMoney',//decimal(15,4) NOT NULL COMMENT '变动之后金额',
                'orderIds',// int(10) DEFAULT NULL COMMENT '订单id',
                'accountId',// int(10) DEFAULT NULL COMMENT '账户id',
                'accountNumber',// varchar(255) DEFAULT NULL COMMENT '账号',
                'accountName',// varchar(255) DEFAULT NULL COMMENT '账号名称',
                'remark',//text COMMENT '备注',
                'createTime',//int(10) NOT NULL COMMENT '创建时间',
                'updateTime',//int(10) DEFAULT NULL COMMENT '更新时间',
                'extend',//json DEFAULT NULL COMMENT '扩展字段',
                'explain',// varchar(255) DEFAULT NULL COMMENT '会员充值扣除说明',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}