<?php

$aid = Dever::input('search_option_aid');
$mid = Dever::input('search_option_mid');

$option_type = Dever::input('type');
if ($option_type == 1) {
    $type = array
    (
        1 => '期权交付',
        //2 => '期权发放',
        //3 => '期权兑付',
        4 => '原始期权交付',
        //5 => '原始期权发放',
        //6 => '原始期权兑付',
    );
    $type_value = '1';
} else {
    $type = array
    (
        //1 => '期权交付',
        2 => '期权发放',
        //3 => '期权兑付',
        //4 => '原始期权交付',
        5 => '原始期权发放',
        //6 => '原始期权兑付',
    );
    $type_value = '2';
}

$status = array
(
    1 => '操作成功',
    2 => '操作失败',
);
return array
(
    # 表名
    'name' => 'push_cash',
    # 显示给用户看的名称
    'lang' => '发放资金',
    'order' => 99,
    'menu' => false,
    'end' => array
    (
        'insert' => 'option/lib/manage.cashUpdate',
    ),
    # 数据结构
    'struct' => array
    (
    
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            //'list'        => true,
        ),

        'aid'      => array
        (
            'type'      => 'int-11',
            'name'      => '期权登录账户',
            'default'   => '-1',
            'desc'      => '期权登录账户',
            'match'     => 'is_string',
            'update'    => 'hidden',
            'value'     => $aid,
        ),

        'mid'      => array
        (
            'type'      => 'int-11',
            'name'      => '期权账户',
            'default'   => '-1',
            'desc'      => '期权账户',
            'match'     => 'is_string',
            'update'    => 'hidden',
            'value'     => $mid,
        ),

        'type'        => array
        (
            'type'      => 'tinyint-1',
            'name'      => '操作类型',
            'default'   => $type_value,
            'desc'      => '操作类型',
            'match'     => 'is_numeric',
            'option'    => $type,
            'update'    => 'radio',
        ),

        'cash'      => array
        (
            'type'      => 'decimal-11,2',
            'name'      => '操作金额-金额单位为元',
            'default'   => '',
            'desc'      => '操作金额',
            'match'     => 'is_numeric',
            'update'    => 'text',
        ),

        'desc'      => array
        (
            'type'      => 'varchar-600',
            'name'      => '备注',
            'default'   => '',
            'desc'      => '备注',
            'match'     => 'option',
            'update'    => 'textarea',
        ),

        'admin_founder' => array
        (
            'type'      => 'int-11',
            'name'      => '插入操作人',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            //'list'        => true,
        ),

        'admin_editor' => array
        (
            'type'      => 'int-11',
            'name'      => '更新操作人',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            //'list'        => true,
        ),

        'status'        => array
        (
            'type'      => 'int-11',
            'name'      => '发放状态',
            'default'   => '1',
            'desc'      => '发放状态',
            'match'     => 'is_numeric',
            'update'    => 'hidden',
            'option'    => $status,
        ),

        'state'     => array
        (
            'type'      => 'tinyint-1',
            'name'      => '状态',
            'default'   => '1',
            'desc'      => '请选择状态',
            'match'     => 'is_numeric',
        ),
        
        'cdate'     => array
        (
            'type'      => 'int-11',
            'name'      => '交易时间',
            'match'     => array('is_numeric', time()),
            'desc'      => '',
            # 只有insert时才生效
            //'insert'    => true,
            'search'    => 'date',
            'list'      => 'date("Y-m-d H:i", {cdate})',
            'list_order'  => 2,
        ),
    ),

    'alter' => array
    (
        5 => array
        (
            array('update', 'cash', 'cash', 'decimal-11,2 0 操作金额'),
        ),
        'version' => 5,
    ),

    'manage' => array
    (
        'insert' => false,
        'delete' => false,
        'edit' => false,
        'page_list' => 'push_cash',

        'list_button' => array
        (
            
        ),
    ),

    'request' => array
    (
        
    ),
);