<?php

namespace JinDouYun\Dao\Customer;

use JinDouYun\Dao\BaseDao;

class DCustomer extends BaseDao
{
    public function __construct($serviceDB = 'default')
    {
        $this->_table = 'customer';
        $this->_primary = 'id';
        $this->_fields = [
            "id", //int(11) NOT NULL AUTO_INCREMENT COMMENT '客户信息id',
            "userCenterId", //int(11) DEFAULT NULL COMMENT '客户id',
            "enterpriseId", //int(11) NOT NULL COMMENT '企业id',
            "shopId", //int(11) DEFAULT NULL COMMENT '商铺id',
            "departmentId", //int(11) DEFAULT NULL COMMENT '销售部门id',
            "integral", //decimal(10,2) DEFAULT '0.00' COMMENT '积分',
            "integralTotal", //decimal(10,2) DEFAULT '0.00' COMMENT '累计积分',
            "status", //tinyint(1) DEFAULT NULL COMMENT '账号状态（ 0待补全 1待审核  2已审核 3未通过 4审核中）',
            "auditFailReason", //text CHARACTER SET utf8 COMMENT '审核拒绝原因',
            "name", //varchar(50) NOT NULL COMMENT '客户名称',
            "code", //varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '客户编码',
            "condition", //varchar(255) DEFAULT NULL COMMENT '搜索条件',
            "avatar", //varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '客户头像',
            "type", //tinyint(3) DEFAULT NULL COMMENT '客户类型',
            "reservoirId", //int(10) DEFAULT NULL COMMENT '库位id',
            "provinceCode", //varchar(20) CHARACTER SET utf8 NOT NULL COMMENT '客户地址省编码',
            "cityCode", //varchar(20) CHARACTER SET utf8 NOT NULL COMMENT '客户地址市编码',
            "districtCode", //varchar(20) CHARACTER SET utf8 NOT NULL COMMENT '客户地址区编码',
            "address", //varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '客户地址详细地址',
            "managerMobile", //varchar(11) CHARACTER SET utf8 DEFAULT NULL COMMENT '负责人电话',
            "salesManId", //int(10) DEFAULT NULL COMMENT '业务员id',
            "salesManCode", //varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '业务员编码',
            "salesManName", //varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '业务员名称',
            "birthday", //int(10) DEFAULT NULL COMMENT '客户生日',
            "enableStatus", //int(1) DEFAULT '5' COMMENT '启用状态(5启用  4禁用)',
            "deleteStatus", //int(1) DEFAULT '5' COMMENT '删除状态(5未删除   4已删除)',
            "isCommission", //tinyint(1) DEFAULT '4' COMMENT '是否是分销商 4:不是 5:是',
            "commissionPath", //json DEFAULT NULL COMMENT '等级路径 例: 1:5, 2:3, 3:1',
            "createTime", //int(10) DEFAULT NULL COMMENT '创建时间',
            "updateTime", //int(10) DEFAULT NULL COMMENT '修改时间',
            "extend", //json DEFAULT NULL COMMENT '扩展字段',
            "taglib", //json DEFAULT NULL COMMENT '客户指定标签',
            "remark", //varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '备注',
            "longitude", //varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '经度',
            "latitude", //varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '纬度',
            "openId", //varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '微信openId',
            "unionId", //varchar(255) DEFAULT NULL COMMENT '微信unionId',
            "byteOpenId", //varchar(255) DEFAULT NULL COMMENT '抖音openId',
            "money", //decimal(15,4) DEFAULT '0.0000' COMMENT '当前余额',
            "totalPayMoney", //decimal(15,4) DEFAULT '0.0000' COMMENT '总付款金额',
            "payPassword", //varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '余额支付密码',
            "recommenderType",// tinyint(3) NOT NULL DEFAULT '4' COMMENT '推荐人类型 2, 员工   3, 客户',
            "recommenderId",// int(10) DEFAULT NULL COMMENT '推荐人id',
            'is_shareholder',// tinyint DEFAULT '0' COMMENT '是否是股东',
        ];
        $this->_readonly = ['id'];
        $this->_create_autofill = [
            'createTime' => time()
        ];
        $this->_update_autofill = [
            'updateTime' => time()
        ];

        parent::__construct($serviceDB);
    }
}