<?php
return array
(
    'source' => 'seller/order',
    'list' => array
    (
        //'expand' => 'seller/manage.showOrderExpand',
        'stat' => 'seller/manage.showOrderStat',
        'field'      => array
        (
            'seller_id',
            'seller_order_num' => array
            (
                'show' => '"{seller_order_num}" ? "<span>{seller_order_num}</span>" : "-"',
            ),
            'order_num' => array
            (
                //'fixed' => true,
                'width' => '210',
                'show' => '"{order_num}" ? "{order_num}" : "-"',
            ),
            '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' => '数量',
            ),

            //'channel_id',
            'status' => array
            (
                'width' => '100',
                'type' => 'tag',
                # 会alert弹出
                'remote' => 'seller/manage.showOrderExpand',
                '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
        (
            '手动下单' => array('fastadd', array
            (
                'path' => 'order/order_push',
                'param' => array(),
            )),
            '更改订单状态' => array('oper', 'status,official_order_num,official_msg'),
            '发回调' => array('api', 'seller/manage.sendCallBack'),
        ),
        'export' => array
        (
            'out' => '导出',
            //'seller/manage.outKm' => '导出卡密',
        ),
        'search' => array
        (
            'status',
            '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' => '至',
            ),
        ),
    ),

    'update' => array
    (
        'field'    => array
        (
            'status' => array
            (
                'desc' => '【只可以修改未完成状态的订单】',
                'type' => 'radio',
                'option' => array
                (
                    10 => '成功',
                    11 => '失败',
                ),
            ),
            'official_order_num',
            'official_msg',
        ),
    ),

    'oper' => array
    (
        'up_start' => 'seller/manage.editOrder',
        'up_end' => 'seller/manage.addOrderLog',
    ),
);