<?php
$account_id = Dever::input('set')['account_id'] ?? 0;
if (!$account_id) {
    $account_id = Dever::input('field')['account_id'] ?? 0;
}
$account = Dever::load('account', 'place')->getInfo($account_id);
return array
(
    'list' => array
    (
        'where' => array('account_id' => $account_id),
        'field'      => array
        (
            'id',
            'platform_cert_id' => array
            (
                'show' => 'Dever::call("api/app.getCertName", "{platform_cert_id}")',
            ),
            'number',
            'cdate',
        ),
        'data_button' => array
        (
            '编辑' => array('fastedit', array('account_id' => $account_id)),
        ),
        'button' => array
        (
            '新增' => array('fastadd', array('account_id' => $account_id)),
        ),
        'search' => array
        (
            'account_id' => 'hidden',
            'number',
        ),
    ),
    'update' => array
    (
        'desc' => '微信支付的平台证书会自动同步',
        'field'    => array
        (
            'account_id' => 'hidden',
            'platform_cert_id' => array
            (
                'rules' => true,
                'type' => 'select',
                'option'     => 'Dever::call("api/app.getCert", '.$account['platform_id'].')',
                //'remote' => 'api/manage.getCertName',
                //'remote_default' => false,
            ),
            'number' => array
            (
                'rules' => true,
            ),
            'public' => array
            (
                //'rules' => true,
                'type' => 'textarea',
            ),
            'private' => array
            (
                //'rules' => true,
                'type' => 'textarea',
            ),
        ),
    ),
);