<?php
/**
 * 订单退货Dao
 * Created by PhpStorm.
 * User: 小威
 * Date: 2019/12/03
 * Time: 15:40
 */

namespace JinDouYun\Dao\Order;

use JinDouYun\Dao\BaseDao;

class DOrderReturn extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'order_return';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '主键id',
            "no", //char(22) DEFAULT NULL COMMENT '销售退货单号',
            "originNo", //char(22) DEFAULT NULL COMMENT '来源订单单号',
            "originId", //int(10) DEFAULT NULL COMMENT '来源订单id',
            "num", //int(10) DEFAULT NULL COMMENT '退货商品数量',
            "shopId", //int(10) DEFAULT NULL COMMENT '商铺id',
            "shopName", //varchar(50) DEFAULT NULL COMMENT '商铺名称',
            "operatorId", //int(10) DEFAULT NULL COMMENT '制单人id',
            "operatorName", //varchar(30) DEFAULT NULL COMMENT '制单人姓名',
            "customerId", //int(10) DEFAULT NULL COMMENT '客户id',
            "customerName", //varchar(50) DEFAULT NULL COMMENT '客户名称',
            "auditId", //int(10) DEFAULT NULL COMMENT '审核人id',
            "auditName", //varchar(30) DEFAULT NULL COMMENT '审核人姓名',
            "remark", //varchar(255) DEFAULT NULL COMMENT '备注',
            "auditTime", //int(10) DEFAULT NULL COMMENT '审核时间',
            "auditStatus", //tinyint(3) DEFAULT '1' COMMENT '审核状态 1:待审核 2:已审核 3:审核失败 4:审核中',
            "orderStatus", //tinyint(3) DEFAULT NULL COMMENT '单据状态 1:待审核 2:待入库',
            "inStatus", //tinyint(3) DEFAULT NULL COMMENT '入库状态 4:未入库 5:已入库',
            "deleteStatus", //tinyint(3) DEFAULT '5' COMMENT '删除状态 4:已删除 5:正常',
            "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
            "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间',
            "extend", //json DEFAULT NULL COMMENT '扩展字段',
            'auditFailReason'
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}