<?php
return array
(
    'list' => array
    (
        'field'      => array
        (
            'id' => array
            (
                'name' => '商品ID',
            ),
            'name',
            'cate_id',
            'status' => array
            (
                'type' => 'switch',
                'show'  => '{status}',
                'active_value' => 1,
                'inactive_value' => 2,
            ),
            'cdate',
        ),
        'search'      => array
        (
            'name' => 'like',
            'cdate' => array
            (
                'name' => '创建时间',
                'type' => 'date',
                'date_type' => 'datetimerange',
                'value_format' => 'YYYY-MM-DD HH:mm:ss',
                'start_placeholder' => '开始日期',
                'end_placeholder' => '结束日期',
                'range_separator' => '至',
            ),
        ),
        'data_button' => array
        (
            '编辑' => 'edit',
        ),
        'button' => array
        (
            '新增' => 'add',
        ),
    ),
    'update' => array
    (
        'field'    => array
        (
            'name',
            'cate_id' => 'radio',
            'spec_type' => array
            (
                'type' => 'radio',
                'control' => true,
            ),
            'goods/info_sku' => array
            (
                'name' => '单规格设置',
                'where'  => array('info_id' => 'id', 'key' => '-1'),
                # 默认值，如果有默认值则无法添加和删除
                'default' => array
                (
                    # 默认值
                    array
                    (
                        'code' => '',
                        'value' => '',
                    ),
                ),
            ),

            'goods/info_sku#' => array
            (
                'name' => '多规格设置',
                'where' => array('info_id' => 'id', 'key' => array('!=', '-1')),
                'type' => 'sku',
                # 设置规格表名
                'spec' => 'goods/info_spec',
                # 设置规格表关联字段
                'spec_field' => 'info_id',
                # 获取规格数据的接口
                'spec_data' => 'goods/manage.spec',
            ),
        ),
        'control' => array
        (
            'goods/info_sku' => array
            (
                'spec_type' => 1,
            ),

            'goods/info_sku#' => array
            (
                'spec_type' => 2,
            ),
        ),
    ),
);