<?php
return array
(
    # 表名
    'name' => 'info_stat',
    # 显示给用户看的名称
    'lang' => '数据统计',
    # 后台菜单排序
    'order' => 2,
    // 'menu' => false,
    # 数据结构
    'struct' => array
    (
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            // 'list'      => true,
            'order'     => 'desc',
        ),


        'day'     => array
        (
            'type'      => 'int-11',
            'name'      => '日期',
            'default'   => '',
            'match'     => 'is_numeric',
            'desc'      => '',
            'list'      => 'date("Y-m-d", {day})',
            'list_order' => 1,
            // 'search'    => 'day',
            // 'search_button' => array
            // (
            //     'sum' => 'num,yes_num,cash,daili_num,agent_cash,no_num,no_cash',
            //     'option' => array(
            //         'day' => '按天',
            //         'week' => '按周',
            //         'month' => '按月',
            //     ),
            //     'group' => '',
            // ),
            // 'order'     => 'desc',
            // 'list'      => 'Dever::showDay("{day}")',
        ),


        'group_id'      => array
        (
            'type'      => 'int-11',
            'name'      => '部门',
            'default'   => '-1',
            'desc'      => '部门',
            'match'     => 'is_string',
            'update'    => 'linkage',
            'search'    => 'linkage',
            'option'    => Dever::url('lib/appoint.get?level_total=1', 'work'),
           	'list'      => 'Dever::load("clue/lib/manage.group",{group_id})', 
        ),

        'group_num'        => array
        (
            'type'      => 'int-11',
            'name'      => '跟进成员数',
            'default'   => '0',
            'desc'      => '数量',
            'match'     => 'option',
            'update'    => 'hidden',
            'list'      => true,
        ),
        'num'        => array
        (
            'type'      => 'int-11',
            'name'      => '全部有效线索',
            'default'   => '0',
            'desc'      => '数量',
            'match'     => 'option',
            'update'    => 'hidden',
            'list'      => true,
        ),
        'd_num'        => array
        (
            'type'      => 'int-11',
            'name'      => '待分派',
            'default'   => '0',
            'desc'      => '数量',
            'match'     => 'option',
            'update'    => 'hidden',
            'list'      => true,
        ),
        'dg_num'        => array
        (
            'type'      => 'int-11',
            'name'      => '待跟进',
            'default'   => '0',
            'desc'      => '数量',
            'match'     => 'option',
            'update'    => 'hidden',
            'list'      => true,
        ),
        'g_num'        => array
        (
            'type'      => 'int-11',
            'name'      => '跟进数',
            'default'   => '0',
            'desc'      => '数量',
            'match'     => 'option',
            'update'    => 'hidden',
            'list'      => true,
        ),

        'qx_num'        => array
        (
            'type'      => 'int-11',
            'name'      => '取消关闭',
            'default'   => '0',
            'desc'      => '数量',
            'match'     => 'option',
            'update'    => 'hidden',
            'list'      => true,
        ),
        'f_num'        => array
        (
            'type'      => 'int-11',
            'name'      => '成功关闭',
            'default'   => '0',
            'desc'      => '数量',
            'match'     => 'option',
            'update'    => 'hidden',
            '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'    => 'day',
            // 'list'      => 'date("Y-m-d", {cdate})',
            // 'list_order' => 1,
        ),
    ),

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

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