<?php

$group = function()
{
	$array = array();
	$info = Dever::db('main/group')->state();
	if($info)
	{
		$array += $info;
	}
	return $array;
};

$type = array
(
    1 => '全职',
    2 => '兼职',
);

$config = array
(
    # 表名
    'name' => 'zhaopin',
    # 显示给用户看的名称
    'lang' => '招聘信息',
    # 后台菜单排序
    'order' => 1,
    'config_type' => $type,
    # 数据结构
    'struct' => array
    (
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            //'search'    => 'order',
            //'list'      => true,
            'order'     => 'desc',
        ),
        
        'name'      => array
        (
            'type'      => 'varchar-80',
            'name'      => '职位名称',
            'default'   => '',
            'desc'      => '职位名称',
            'match'     => 'is_string',
            'update'    => 'text',
            'search'    => 'fulltext',
            'list'      => true,
        ),

        'group_id'		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '所属部门',
			'default' 	=> '1',
			'desc' 		=> '所属部门',
			'match' 	=> 'is_numeric',
			'update'	=> 'select',
			'option'	=> $group,
			'search'	=> 'select',
			'list'		=> true,
		),

        'type'        => array
        (
            'type'      => 'int-11',
            'name'      => '职位类型',
            'default'   => '1',
            'desc'      => '职位类型',
            'match'     => 'is_numeric',
            'update'    => 'radio',
            'option'    => $type,
            'search'    => 'select',
            'list'      => true,
        ),

        'area'      => array
        (
            'type'      => 'varchar-80',
            'name'      => '所在地区',
            'default'   => '',
            'desc'      => '所在地区',
            'match'     => 'is_string',
            'update'    => 'text',
        ),

        'desc'      => array
        (
            'type'      => 'text-255',
            'name'      => '岗位描述',
            'default'   => '',
            'desc'      => '岗位描述',
            'match'     => 'is_string',
            'update'    => 'editor',
            'key'		=> 1,
        ),

        'content'      => array
        (
            'type'      => 'text-255',
            'name'      => '任职要求',
            'default'   => '',
            'desc'      => '任职要求',
            'match'     => 'is_string',
            'update'    => 'editor',
            'key'		=> 1,
        ),

        'reorder'		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '排序(数值越大越靠前)',
			'default' 	=> '1',
			'desc' 		=> '请输入排序',
			'match' 	=> 'option',
			'update'	=> 'text',
			'search'	=> 'order',
			'list'		=> true,
			'order'		=> 'desc',
			'edit'		=> true,
		),

        'state'     => array
        (
            'type'      => 'tinyint-1',
            'name'      => '状态',
            'default'   => '1',
            'desc'      => '请选择状态',
            'match'     => 'is_numeric',
        ),
        
        'cdate'     => array
        (
            'type'      => 'int-11',
            'name'      => '录入时间',
            'match'     => array('is_numeric', time()),
            'desc'      => '',
            # 只有insert时才生效
            'insert'    => true,
            'list'      => 'date("Y-m-d H:i:s", {cdate})',
        ),
    ),

    'manage' => array
    (
        'button' => array
        (
        	'部门管理' => array('list', 'group&oper_parent=zhaopin&oper_project=main'),
        ),
    ),

    'request' => array
    (
        
    )
);

return $config;