DefaultData.class.php 12.4 KB
<?php
/**
 * 应用安装时的初始数据文件
 * data.php
 * $Author$
 */

namespace Common\Sql;

use Common\Common\Cache;

class DefaultData
{

    /**
     * 安装数据
     * @author zhonglei
     */
    public static function installData()
    {
        $cache = Cache::instance();
        $epConfig = $cache->get('Common.EnterpriseConfig');

        return [
            'setting' => array(
                array(
                    'key' => 'manageAuths',
                    'value' => 'a:2:{s:12:"selectedList";a:0:{}s:5:"auths";a:0:{}}',
                    'type' => '1',
                    'comment' => '微信端管理权限'
                ),
                array(
                    'key' => 'jobMode',
                    'value' => 'select',
                    'type' => '0',
                    'comment' => '岗位输入方式'
                ),
                array(
                    'key' => 'roleMode',
                    'value' => 'select',
                    'type' => '0',
                    'comment' => '角色输入方式'
                ),
                array(
                    'key' => 'synctime',
                    'value' => '0',
                    'type' => '0',
                    'comment' => '最后同步时间'
                )
            ),
            'invite_setting' => [
                'content' => '<p>欢迎加入【' . $epConfig['sitename'] . '】!</p><p>这里是学习成长赋能新平台,深度整合公司资料、知识、技能、能力测评以及各种好玩的活动和服务,真正帮助大家达到能力提升、快速高效提高工作效能。</p><p>大家可以通过碎片化时间随时随地参与学习各种新知识、技能,了解公司新动态,公司构建平台的目的是希望同事们可以互动沟通,人人学习、人人分享,大家一起享受企业赋能的无限可能。</p><p>打通员工、公司总部、培训管理之间的时空距离,提升大家学习成长体验,打造不一样的共同成长氛围。</p>',
                'share_content' => '点击链接加入“【' . $epConfig['sitename'] . '】”,一起享受企业赋能之旅吧。',
                'type' => 1,
                'invite_udpids' => '',
                'check_type' => '3',
                'check_udpids' => '',
                'departments' => '',
                'inviter_write' => '',
                'form' => '',
                'qrcode_expire' => 0,
            ],
            'attr' => [
                [
                    'field_name' => 'memUsername',
                    'attr_name' => '姓名',
                    'postion' => 1,
                    'type' => 1,
                    'option' => '',
                    'order' => 1,
                    'is_system' => 1,
                    'is_open' => 1,
                    'is_open_edit' => 0,
                    'is_required' => 1,
                    'is_required_edit' => 0,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 0,
                    'is_required_cp' => 1,
                    'is_required_cp_edit' => 0,
                    'is_show' => 1,
                    'is_show_edit' => 0,
                    'is_allow_user_modify' => 1,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'memGender',
                    'attr_name' => '性别',
                    'postion' => 1,
                    'type' => 7,
                    'option' => serialize(
                        [
                            [
                                'name' => '男',
                                'value' => 1
                            ],
                            [
                                'name' => '女',
                                'value' => 2
                            ]
                        ]
                    ),
                    'order' => 2,
                    'is_system' => 1,
                    'is_open' => 1,
                    'is_open_edit' => 0,
                    'is_required' => 1,
                    'is_required_edit' => 0,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 0,
                    'is_required_cp' => 1,
                    'is_required_cp_edit' => 0,
                    'is_show' => 1,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 1,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'memMobile',
                    'attr_name' => '手机号',
                    'postion' => 2,
                    'type' => 1,
                    'option' => '',
                    'order' => 3,
                    'is_system' => 1,
                    'is_open' => 1,
                    'is_open_edit' => 0,
                    'is_required' => 1,
                    'is_required_edit' => 0,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 0,
                    'is_required_cp' => 1,
                    'is_required_cp_edit' => 0,
                    'is_show' => 1,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 0,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'memEmail',
                    'attr_name' => '邮箱',
                    'postion' => 2,
                    'type' => 1,
                    'option' => '',
                    'order' => 5,
                    'is_system' => 1,
                    'is_open' => 1,
                    'is_open_edit' => 1,
                    'is_required' => 0,
                    'is_required_edit' => 1,
                    'is_show' => 1,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 1,
                    'is_required_cp' => 1,
                    'is_required_cp_edit' => 1,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 1,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'dpName',
                    'attr_name' => '组织',
                    'postion' => 3,
                    'type' => 999,
                    'option' => '',
                    'order' => 6,
                    'is_system' => 1,
                    'is_open' => 1,
                    'is_open_edit' => 0,
                    'is_required' => 1,
                    'is_required_edit' => 0,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 0,
                    'is_required_cp' => 1,
                    'is_required_cp_edit' => 0,
                    'is_show' => 1,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 0,
                    'is_allow_user_modify_edit' => 0,
                ],
                [
                    'field_name' => 'memJob',
                    'attr_name' => '岗位',
                    'postion' => 3,
                    'type' => 1,
                    'option' => '',
                    'order' => 8,
                    'is_system' => 1,
                    'is_open' => 1,
                    'is_open_edit' => 1,
                    'is_required' => 1,
                    'is_required_edit' => 1,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 1,
                    'is_required_cp' => 1,
                    'is_required_cp_edit' => 1,
                    'is_show' => 1,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 0,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'memRole',
                    'attr_name' => '角色',
                    'postion' => 3,
                    'type' => 1,
                    'option' => '',
                    'order' => 9,
                    'is_system' => 1,
                    'is_open' => 1,
                    'is_open_edit' => 1,
                    'is_required' => 1,
                    'is_required_edit' => 1,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 1,
                    'is_required_cp' => 1,
                    'is_required_cp_edit' => 1,
                    'is_show' => 1,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 0,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'memTelephone',
                    'attr_name' => '座机',
                    'postion' => 1,
                    'type' => 1,
                    'option' => '',
                    'order' => 10,
                    'is_system' => 1,
                    'is_open' => 0,
                    'is_open_edit' => 1,
                    'is_required' => 0,
                    'is_required_edit' => 1,
                    'is_open_cp' => 1,
                    'is_open_cp_edit' => 1,
                    'is_required_cp' => 0,
                    'is_required_cp_edit' => 1,
                    'is_show' => 0,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 0,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'memEnglishName',
                    'attr_name' => '英文名',
                    'postion' => 1,
                    'type' => 1,
                    'option' => '',
                    'order' => 11,
                    'is_system' => 1,
                    'is_open' => 0,
                    'is_open_edit' => 1,
                    'is_required' => 0,
                    'is_required_edit' => 1,
                    'is_open_cp' => 0,
                    'is_open_cp_edit' => 1,
                    'is_required_cp' => 0,
                    'is_required_cp_edit' => 1,
                    'is_show' => 0,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 0,
                    'is_allow_user_modify_edit' => 1,
                ],
                [
                    'field_name' => 'memIsleader',
                    'attr_name' => '上级',
                    'postion' => 1,
                    'type' => 7,
                    'option' => serialize(
                        [
                            [
                                'name' => '是',
                                'value' => 1
                            ],
                            [
                                'name' => '否',
                                'value' => 0
                            ]
                        ]
                    ),
                    'order' => 12,
                    'is_system' => 1,
                    'is_open' => 0,
                    'is_open_edit' => 1,
                    'is_required' => 0,
                    'is_required_edit' => 1,
                    'is_open_cp' => 0,
                    'is_open_cp_edit' => 1,
                    'is_required_cp' => 0,
                    'is_required_cp_edit' => 1,
                    'is_show' => 0,
                    'is_show_edit' => 1,
                    'is_allow_user_modify' => 0,
                    'is_allow_user_modify_edit' => 1,
                ]
            ],
            'default_job' => [
                '财务总监',
                '财务经理',
                '财务主管',
                '财务助理',
                '财务实习生',

                '人资总监',
                '人资经理',
                '人资主管',
                '人资助理',
                '人资实习生',

                '行政总监',
                '行政经理',
                '行政主管',
                '行政助理',
                '行政实习生',

                '运营总监',
                '运营经理',
                '运营主管',
                '运营助理',
                '运营实习生',

                '市场总监',
                '市场经理',
                '市场主管',
                '市场助理',
                '市场实习生',
            ],
            'default_role' => [
                '管理者',
                '财务',
                '人资',
                '行政',
                '运营',
                '市场',
            ]
        ];
    }
}