<?php
/**
 * Created by PhpStorm.
 * User: XiaoMing
 * Date: 2019/12/18
 * Time: 12:01
 */

namespace JinDouYun\Dao\Market;

use JinDouYun\Dao\BaseDao;

class DActivityGoods extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'activity_goods';
        $this->_primary = 'id';
        $this->_fields = [
            "id",//int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
            "activityId",//int(11) unsigned NOT NULL COMMENT '促销活动id',
            "goodsId",//int(11) unsigned NOT NULL COMMENT '促销活动商品id',
            "shopId",
            "basicGoodsId",// int(11) unsigned NOT NULL COMMENT '促销活动基础商品id',
            "skuId",//int(11) unsigned NOT NULL COMMENT '规格id',
            "price",//decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订货价格',
            "deleteStatus",//tinyint(3) unsigned NOT NULL DEFAULT '5' COMMENT '软删除(5未删除 4已删除)',
            "activityNum",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '活动数量',
            "limitNum",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '限购数量',
            "createTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
            "updateTime",//int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
            "extends",//json DEFAULT NULL COMMENT '拓展字段',
            "haveBuyNum",//int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活动已购数量',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}