<?php
return array
(
    # 表名
    'name' => 'info_code',
    # 显示给用户看的名称
    'lang' => '活动核销码',
    # 后台菜单排序
    'order' => 2,
    'menu' => false,
    'start' => array
    (
    	'insert' => 'active/lib/manage.insertInfoCode',
    ),
    'end' => array 
    (
    	'insert' => 'active/lib/manage.updateInfoCode',
    	'update' => 'active/lib/manage.updateInfoCode',
    ),
    # 数据结构
    'struct' => array
    (
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            'list'      => true,
            'order'     => 'desc',
        ),

        'code'      => array
        (
            'type'      => 'varchar-200',
            'name'      => '核销码/手机号',
            'default'   => '',
            'desc'      => '核销码',
            'match'     => 'is_string',
            'update'    => 'text',
            'value'     => '',
            // 'search'    => 'fulltext',
            // 'list'      => true,
            'bind'        => array('onblur', 'loading', array('url' => Dever::url("active/lib/manage.search"))),
        ),

        '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'    => 'day',
            'list'      => 'date("Y-m-d H:i:s", {cdate})',
            'list_order' => 5,
        ),
    ),

    'manage' => array
    (
    	'insert' => false,
        'delete' => false,
        'edit' => false,
        'page_list' => 'info_code',        
    ),

    'request' => array
    (
        'getAll' => array
        (
            # 匹配的正则或函数 选填项
            'option' => array
            (
                'join_id' => 'yes',
                'state' => 1,
            ),
            'type' => 'all',
            'order' => array('cdate' => 'desc'),
            'col' => '*',
        ),
    ),
);
