<?php
$id = Dever::input('id');
$show = false;
$account_setting = array();
if ($id) {
    $account = Dever::load('account', 'place')->getInfo($id);
    $setting = Dever::db('platform_setting', 'api')->select(array('platform_id' => $account['platform_id']));
    if ($setting) {
        $show = true;
        foreach ($setting as $k => $v) {
            $account_setting[] = array('platform_setting_name' => $v['name'], 'platform_setting_id' => $v['id'], 'value' => '');
        }
    }
}
$extend = Dever::load('common', 'manage')->extend();
$uid = $extend['data_id'];
return array
(
    'list' => array
    (
        'where' => array('uid' => $uid),
        'field'      => array
        (
            'id',
            'name',
            'type',
            'cdate',
        ),
        'button' => array
        (
            '新增' => array('fastadd', array('field' => 'uid,name,type','uid' => $uid)),
        ),
        'data_button' => array
        (
            '设置' => array('edit', 'uid,name,place/account_setting'),
            '证书' => array('route', array
            (
                'path' => 'sector_place/account_cert',
                'param' => array
                (
                    'set' => array('account_id' => 'id', 'menu' => 'sector_place/account', 'parent' => 'sector_place/account'),
                ),
            )),
        ),
        'search' => array
        (
            'name',
            'type',
        ),
    ),
    'update' => array
    (
        'field'    => array
        (
            'uid' => array
            (
                'type' => 'hidden',
            ),
            'name' => array
            (
                'rules' => true,
            ),
            'type' => array
            (
                'type' => 'radio',
                'rules' => true,
                'desc' => '【保存后不能更改】',
            ),
            'place/account_setting' => array
            (
                'show' => $show,
                'name' => '参数配置',
                'where'  => array('account_id' => 'id'),
                'default' => $account_setting,
            ),
        ),
    ),
);