<?php
$email = function()
{
    $array = array();
    $data = Dever::db('mail/email-state');
    if($data)
    {
        $array += $data;
    }
    return $array;
};
$config = array
(
    # 表名
    'name' => 'feature',
    # 显示给用户看的名称
    'lang' => '功能列表',
    'order' => -10,

    # 数据结构 不同的字段放这里
    'struct' => array
    (
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            //'list'        => true,
        ),

        'name'      => array
        (
            'type'      => 'varchar-100',
            'name'      => '邮件名称',
            'default'   => '',
            'desc'      => '邮件名称',
            'match'     => 'is_string',
            'update'    => 'text',
            'list'      => true,
        ),

        'key'      => array
        (
            'type'      => 'varchar-100',
            'name'      => '功能标识',
            'default'   => '',
            'desc'      => '功能标识',
            'match'     => 'is_string',
            'update'    => 'text',
            'list'      => true,
        ),

        'email_id'        => array
        (
            'type'      => 'varchar-800',
            'name'      => '用户名称',
            'default'   => '',
            'desc'      => '用户名称',
            'match'     => 'option',
            'update'    => 'checkbox',
            'option'    => $email,
            //'list'      => 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,
            //'search'  => 'date',
            //'list'        => 'date("Y-m-d H:i:s", {cdate})',
        ),
    ),

    'manage' => array
    (
        // 'insert' => false,
        // 'edit' => false,
        // 'delete' => false,
        // 'num' => false,
        // // 'excel' => $excel,
        // 'button' => $button,
        
    ),

    # request 请求接口定义
    'request' => array
    (
        'getExcelAll' => array
        (
            # 匹配的正则或函数 选填项
            'option' => array
            (
                'start' => array('yes-month', '>='),
                'end' => array('yes-month', '<='),
                'state' => 1,
            ),
            'type' => 'all',
            'col' => '*',
        ),
    ),
);

return $config;