<?php
/**
 * 职工管理Dao
 * Created by PhpStorm.
 * User: 小威
 * Date: 2019/10/31
 * Time: 18:00
 */

namespace JinDouYun\Dao\Department;

use JinDouYun\Dao\BaseDao;

class DStaff extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'staff';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(10) NOT NULL AUTO_INCREMENT COMMENT '自增id',
            "userCenterId", //int(11) DEFAULT NULL COMMENT '用户中心id',
            "departmentId", //int(11) DEFAULT NULL COMMENT '部门id',
            "shopId", //int(10) DEFAULT '0' COMMENT '商铺id',
            "staffName", //varchar(30) DEFAULT NULL COMMENT '员工姓名',
            "target", //decimal(10,2) DEFAULT '0.00' COMMENT '目标业绩',
            "completed", //decimal(10,2) DEFAULT NULL COMMENT '完成业绩',
            "reward", //decimal(10,2) DEFAULT '0.00' COMMENT '提成',
            "rewardOrder", //decimal(10,2) DEFAULT '0.00' COMMENT '订单提成',
            "rewardGoods", //decimal(10,2) DEFAULT '0.00' COMMENT '商品提成',
            "rewardOut", //decimal(10,2) DEFAULT '0.00' COMMENT '发放提成',
            "rewardTotal", //decimal(10,2) DEFAULT '0.00' COMMENT '累计提成',
            "rewardRuleId", //int(10) DEFAULT NULL COMMENT '提成规则id',
            "roleId", //int(10) DEFAULT NULL COMMENT '角色id',
            "staffCode", //varchar(50) DEFAULT NULL COMMENT '职工编号',
            "mobile", //varchar(11) DEFAULT NULL COMMENT '手机号',
            "sex", //tinyint(3) DEFAULT NULL COMMENT '性别 5:男 4:女',
            "age", //int(10) DEFAULT NULL COMMENT '出生日期',
            "education", //tinyint(3) DEFAULT NULL COMMENT '学历',
            "email", //varchar(50) DEFAULT NULL COMMENT '邮箱',
            "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 '扩展字段',
            "dataField", //json DEFAULT NULL COMMENT '数据域',
            "isSetRule", //tinyint(5) DEFAULT '4' COMMENT '是否自定义规则',
            "rule", //json DEFAULT NULL COMMENT '自定义规则',
            "balance", //decimal(10,2) DEFAULT '0.00' COMMENT '余额',
            "info", // varchar(255) DEFAULT NULL COMMENT '简介',
            "avatar", // varchar(255) DEFAULT NULL COMMENT '头像',
            "evaluate", // varchar(50) DEFAULT '5' COMMENT '评价星级',
            "stock_right", // decimal(10,2) DEFAULT '0.00' COMMENT '股权',
            "cumulative_stock_right", // decimal(10,2) DEFAULT '0.00' COMMENT '累计股权',
            'use_stock',// decimal(10, 2) default NULL COMMENT '可使用股权',
            'used_stock',// decimal(10,2) DEFAULT NULL COMMENT '已使用股权',
            "userId", // varchar(50) DEFAULT NULL COMMENT '钉钉userId',
            "is_shareholder", // tinyint DEFAULT '0' COMMENT '是否是股东',
            'is_clock',// tinyint DEFAULT NULL COMMENT '是否打卡',
            'is_technician',// tinyint DEFAULT NULL COMMENT '是否技师',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}