<?php

return array
(
    # 表名
    'name' => 'info_column',
    # 显示给用户看的名称
    'lang' => '商品栏目关联表',
    'menu' => false,

    # 数据结构
    'struct' => array
    (
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            //'list'        => true,
        ),
        
        'info_id'       => array
        (
            'type'      => 'int-11',
            'name'      => '商品ID',
            'default'   => '',
            'desc'      => '商品ID',
            'match'     => 'is_numeric',
            'update'    => 'text',
            'list'      => true,
        ),

        'column_id'       => array
        (
            'type'      => 'int-11',
            'name'      => '栏目ID',
            'default'   => '',
            'desc'      => '栏目ID',
            'match'     => 'is_numeric',
            'update'    => 'text',
            'list'      => true,
        ),

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

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

    'request' => array
    (
        'getData' => array
        (
            # 匹配的正则或函数 选填项
            'option' => array
            (
                'column_id' => array('yes-t_1.column_id'),
                'status' => array('yes-t_2.status', 1),
                'state' => array('yes-t_2.state', 1),
            ),
            # 联表
            'join' => array
            (
                array
                (
                    'table' => 'goods/info',
                    'type' => 'left join',
                    'on' => array('info_id','id'),
                    'col' => 'info_id',
                ),
            ),
            'type' => 'all',
            'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
            'col' => '*,t_2.*',
        ),
    ),
);