<?php
$status = array
(
    1 => array('name' => '提现申请中', 'style' => 'font-weight:bold;color:blue'),
    2 => array('name' => '受理成功', 'style' => 'font-weight:bold;color:green'),
    //3 => array('name' => '受理失败', 'style' => 'font-weight:bold;color:#CD3700'),
);

$mtype = array
(
	1 => '自动提现',
	2 => '手动提现',
);
return array
(
    # 表名
    'name' => 'yspay_tixian_log',
    # 显示给用户看的名称
    'lang' => '银联提现日志列表',
    'order' => -200,
    'menu' => false,
    # 数据结构
    'struct' => array
    (
    
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            'update'    => 'hidden',
            //'list'        => true,
        ),

        'shop_id'      => array
        (
            'type'      => 'int-11',
            'name'      => '门店名称',
            'default'   => '',
            'desc'      => '所属门店',
            'match'     => 'is_numeric',
            'update'    => 'text',
            'searchs'    => array
            (
                'api' => 'shop/info-like',
                'col' => 'name',
                'result' => 'id',
            ),
            'list'		=> 'Dever::load("shop/info-one#name", {shop_id})',
        ),

        'mid'      => array
        (
            'type'      => 'varchar-50',
            'name'      => '分账商户号',
            'default'   => '',
            'desc'      => '分账商户号',
            'match'     => 'option',
            'update'    => 'text',
            'searchs'    => 'fulltext',
            'list'		=> true,
        ),

        'order_num'      => array
        (
            'type'      => 'varchar-100',
            'name'      => '订单号',
            'default'   => '',
            'desc'      => '订单号',
            'match'     => 'is_string',
            'update'    => 'text',
            'list'		=> true,
        ),

        'type'      => array
        (
            'type'      => 'varchar-10',
            'name'      => '类型',
            'default'   => '',
            'desc'      => '类型',
            'match'     => 'is_numeric',
            'update'    => 'text',
        ),

        'cash'      => array
        (
            'type'      => 'int-11',
            'name'      => '提现金额',
            'default'   => '0',
            'desc'      => '提现金额',
            'match'     => 'option',
            'update'    => 'text',
            'list'      => 'round({cash}/100, 2)',
        ),

        'tdate'     => array
        (
            'type'      => 'int-11',
            'name'      => '提现时间',
            'default'   => '',
            'match'     => 'is_numeric',
            'desc'      => '',
            'search'    => 'date',
            'list'      => '"{tdate}" ? date("Y-m-d H:i", \'{tdate}\') : "-"',
            'order'		=> 'desc',
        ),

        'mtype'      => array
        (
            'type'      => 'int-11',
            'name'      => '提现类型',
            'default'   => '1',
            'desc'      => '提现类型',
            'match'     => 'is_numeric',
            'update'    => 'text',
        ),

        'status'        => array
        (
            'type'      => 'tinyint-1',
            'name'      => '提现状态',
            'default'   => '1',
            'desc'      => '提现状态',
            'match'     => 'is_numeric',
            'option'    => $status,
            'search'    => 'select',
            'list'      => true,
        ),

        'desc'      => array
        (
            'type'      => 'varchar-800',
            'name'      => '备注',
            'default'   => '-',
            'desc'      => '备注',
            'match'     => 'is_numeric',
            'update'    => 'text',
            'list'      => true,
        ),

        'response'        => array
        (
            'type'      => 'text-255',
            'name'      => '回调响应数据',
            'default'   => '',
            'desc'      => '回调响应数据',
            'match'     => 'is_string',
        ),

        '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:s", {cdate})',
        ),
    ),

    'manage' => array
    (
        'edit' => false,
        'insert' => false,
        'delete' => false,
    ),

    'request' => array
    (
        'getAll' => array
        (
            'option' => array
            (
                'shop_id' => 'yes',
                'state' => 1,
            ),
            'type' => 'all',
            'col' => '*|store_id',
        ),
    ),
);