<?php
$extend = Dever::load('common', 'manage')->extend();
$uid = $extend['data_id'];
return array
(
    'source' => 'place/info',
    'list' => array
    (
        'where' => array('uid' => $uid),
        'field'      => array
        (
            'name',
            'type',
            'code',
            'status' => array
            (
                'type' => 'switch',
                'show'  => '{status}',
                'active_value' => 1,
                'inactive_value' => 2,
            ),
        ),
        'button' => array
        (
            '新增' => array('add', array('uid' => $uid)),
        ),
        'data_button' => array
        (
            '编辑' => 'edit',
            '预览' => array('link', Dever::url('place/url.place', array(), true)),
        ),
        'search'    => array
        (
            'name',
        ),
    ),
    'update' => array
    (
        'tab' => array
        (
            '基本信息' => 'uid,name,code,password,price,logo,bg,content',
            '支付设置' => 'pay_account,money_id,score,score_per',
        ),
        'field'    => array
        (
            'uid' => array
            (
                'type' => 'hidden',
            ),
            'name' => array
            (
                'rules' => true,
            ),
            'code' => array
            (
                //'rules' => true,
                'desc' => '设置身份码之后，用户将可以通过身份码快速进入，身份码不能重复',
            ),
            'pay_account' => array
            (
                'type' => 'select',
                'option'    => 'Dever::call("place/manage.getAccountList")',
            ),
            'money_id' => array
            (
                'tips' => '设置支付使用的货币',
            ),
            'score' => array
            (
                'rules' => true,
                'desc' => '设置购买资源所使用的积分名称，除“商品”外，其余资源均使用积分支付',
            ),
            'score_per' => array
            (
                'rules' => true,
                'desc' => '设置积分与1元货币的换算数字，如输入100就是100个积分换算成1元货币'
            ),
            'logo' => array
            (
                'type' => 'upload',
                'upload' => 1,
                'yun' => true,
                'multiple' => false,
                'tip' => '',
                'style' => 'pic',
            ),
            'bg' => array
            (
                'type' => 'upload',
                'upload' => 1,
                'yun' => true,
                'multiple' => false,
                'tip' => '',
                'style' => 'pic',
            ),
            'content' => array
            (
                'type' => 'editor',
                'editorMenu' => array
                (
                    'uploadImage' => 1,
                    'uploadVideo' => 3,
                ),
            ),

            'type' => array
            (
                'type' => 'radio',
                'control' => true,
            ),

            'password' => array
            (
                'desc' => '设置密码后，用户输入密码才能进入',
            ),

            'price' => array
            (
                'desc' => '设置价格后，用户购买后才能进入',
            ),


            'vip_name' => array
            (
                'desc' => '设置“会员”的称谓，未设置则显示“会员”',
            ),

            'agent_name' => array
            (
                'desc' => '设置“代理”的称谓，未设置则显示“代理”',
            ),
        ),
        'control' => array
        (
            'password' => array
            (
                'type' => 4,
            ),
            'price' => array
            (
                'type' => 5,
            ),
        ),
        'start' => 'place/manage.checkPlaceCode',
        'end' => ['manage/system.update?system=sector', 'place/manage.updatePlaceCode'],
    ),
);