<?php
$status = Dever::input('search')['status'] ?? array('>=', 10);
return array
(
    //'source' => 'seller/order_log',
    'source' => 'seller/order_bak',
    //'source' => 'seller/order_log1',
    'list' => array
    (
        //'expand' => 'seller/manage.showOrderExpand',
        //'stat' => 'seller/manage.showOrderStat',
        //'where' => array('status' => $status),
        'field'      => array
        (
            'seller_id',
            'seller_order_num' => array
            (
                'show' => '"{seller_order_num}" ? "<span>{seller_order_num}</span>" : "-"',
            ),
            'order_num' => array
            (
                //'fixed' => true,
                'width' => '230',
                'show' => '"{order_num}" ? "<span>{order_num}</span>" : "-"',
            ),
            'account',
            /*
            'cash' => array
            (
                'width' => '230',
                'name' => '商品 / 面值 / 实付',
                'show' => 'Dever::load("manage", "seller")->showOrderCash("{cate_id}", "{goods_id}", "{sku_id}", "{cash}", "{price}")',
            ),
            */
            'goods_id' => array
            (
                'name' => '商品',
                'show' => 'Dever::load("manage", "seller")->showOrderGoods("{cate_id}", "{goods_id}", "{sku_id}")',
            ),
            'cash' => array
            (
                'width' => '60',
                'name' => '面值',
            ),
            'buy_price' => array
            (
                'width' => '60',
                'name' => '成本',
            ),
            'price' => array
            (
                'width' => '60',
                'name' => '售价',
            ),
            'num' => array
            (
                'width' => '60',
                'name' => '数量',
            ),
            //'price',
            //'channel_id',
            'status' => array
            (
                'width' => '100',
                'type' => 'tag',
                # 会alert弹出
                'remote' => 'seller/manage.showOrderLogExpand',
                'style' => 'info',
                'show' => 'Dever::load("manage", "seller")->showOrderStatus("{status}")',
            ),
            'official_order_num' => array
            (
                'show' => '"{official_order_num}" ? "<span>{official_order_num}</span>" : "-"',
            ),
            'cdate' => array
            (
                'name' => '下单时间',
            ),
            'finish_date' => array
            (
                'name' => '完成时间',
                'type' => 'show',
                'show' => '{finish_date} > 0 ? date("Y-m-d H:i", {finish_date}) : "-"',
            ),
        ),
        'data_button' => array
        (
            
        ),
        'button' => array
        (
            
        ),
        'export' => array
        (
            'out' => '导出',
            //'seller/manage.outKm' => '导出卡密',
        ),
        'search' => array
        (
            'status' => array
            (
                'option'     => array
                (
                    10 => '成功',
                    11 => '失败',
                ),
            ),
            'seller_id' => array
            (
                'name' => '选择商户',
            ),
            'channel_id' => array
            (
                'name' => '选择渠道',
            ),
            'order_num',
            'seller_order_num',
            //'channel_order_num',
            'account',
            'sku_id' => array
            (
                'name' => '商品',
                'placeholder' => '请选择商品',
                'type' => 'cascader',
                'option'    => 'Dever::call("goods/manage.getGoodsSku")',
                'search' => function($key, $type, $value) {
                    $value = end($value);
                    return $value;
                }
            ),
            'finish_date' => array
            (
                'name' => '完成时间',
                'type' => 'date',
                'date_type' => 'datetimerange',
                'value_format' => 'YYYY-MM-DD HH:mm:ss',
                'start_placeholder' => '完成时间',
                'end_placeholder' => '完成时间',
                'range_separator' => '至',
            ),
            'cdate' => array
            (
                'name' => '下单时间',
                'type' => 'date',
                'date_type' => 'datetimerange',
                'value_format' => 'YYYY-MM-DD HH:mm:ss',
                'start_placeholder' => '下单时间',
                'end_placeholder' => '下单时间',
                'range_separator' => '至',
            ),
        ),
    ),
);