<?php
return array
(
    'name' => '商户订单表',
    'cdate' => 'mtime',//mtime保存为微秒，wtime保存为毫秒，默认是秒 暂时不支持，后续升级
    'order' => 'cdate desc',
    'struct' => array
    (
        'order_num' => array
        (
            'name'      => '系统订单号',
            'type'      => 'varchar(100)',
            # 记录为influxdb的fields字段
            //'fields'    => true,
        ),

        'account' => array
        (
            'name'      => '账号',
            'type'      => 'varchar(100)',
        ),

        'other' => array
        (
            'name'      => '其他参数',
            'type'      => 'varchar(2000)',
        ),

        'cate_id' => array
        (
            'name'      => '商品分类id',
            'type'      => 'int(11)',
        ),

        'goods_id' => array
        (
            'name'      => '商品id',
            'type'      => 'int(11)',
        ),

        'sku_id' => array
        (
            'name'      => '规格id',
            'type'      => 'int(11)',
        ),

        'num'        => array
        (
            'type'      => 'int(11)',
            'name'      => '数量',
            'fields'    => true,
        ),

        'cash'      => array
        (
            'type'      => 'decimal(11,2)',
            'name'      => '面值',
            'fields'    => true,
        ),

        'price'      => array
        (
            'type'      => 'decimal(11,2)',
            'name'      => '实付金额',
            'fields'    => true,
        ),

        'buy_price'      => array
        (
            'type'      => 'decimal(11,2)',
            'name'      => '采购金额',
            'fields'    => true,
        ),

        'seller_id' => array
        (
            'name'      => '商户',
            'type'      => 'int(11)',
            'value'     => 'seller/info',
        ),

        'seller_order_num' => array
        (
            'name'      => '商户订单号',
            'type'      => 'varchar(100)',
        ),

        'seller_request' => array
        (
            'name'      => '商户请求数据',
            'type'      => 'varchar(2000)',
            'fields'    => true,
            'base64'    => true,
        ),

        'seller_callback' => array
        (
            'name'      => '商户回调数据',
            'type'      => 'varchar(200)',
            'fields'    => true,
            'base64'    => true,
        ),

        'seller_callback_date' => array
        (
            'name'      => '商户回调时间',
            'type'      => 'int(11)',
        ),

        'seller_callback_num' => array
        (
            'name'      => '商户回调次数',
            'type'      => 'int(11)',
            'default'   => '0',
        ),

        'channel_id' => array
        (
            'name'      => '渠道',
            'type'      => 'int(11)',
            'value'     => 'channel/info',
        ),

        'channel_goods_id' => array
        (
            'name'      => '渠道商品id',
            'type'      => 'int(11)',
        ),

        'channel_goods_discount' => array
        (
            'name'      => '渠道商品折扣',
            'type'      => 'int(11)',
        ),

        'channel_order_date' => array
        (
            'name'      => '渠道下单时间',
            'type'      => 'int(11)',
        ),

        'channel_order_num' => array
        (
            'name'      => '渠道订单号',
            'type'      => 'varchar(100)',
        ),

        'channel_request' => array
        (
            'name'      => '渠道请求数据',
            'type'      => 'varchar(2000)',
            'fields'    => true,
            'base64'    => true,
        ),

        'channel_response' => array
        (
            'name'      => '渠道响应数据',
            'type'      => 'varchar(2000)',
            'fields'    => true,
            'base64'    => true,
        ),

        'channel_callback' => array
        (
            'name'      => '渠道回调数据',
            'type'      => 'varchar(2000)',
            'fields'    => true,
            'base64'    => true,
        ),

        'channel_callback_date' => array
        (
            'name'      => '渠道回调时间',
            'type'      => 'int(11)',
        ),

        'official_order_num' => array
        (
            'name'      => '官方流水号',
            'type'      => 'varchar(100)',
        ),

        'official_msg' => array
        (
            'name'      => '官方充值结果',
            'type'      => 'varchar(1000)',
        ),

        'status' => array
        (
            'name'      => '状态',
            'type'      => 'tinyint(1)',
            'default'   => 1,
            'value'     => array
            (
                1 => '已下单',
                2 => '处理中',
                //3 => '队列中',
                //4 => '失败待处理',
                //5 => '已暂停',
                10 => '成功',
                11 => '失败',
            ),
        ),

        'finish' => array
        (
            'name'      => '完成状态',
            'type'      => 'tinyint(1)',
            'default'   => 2,
            'value'     => array
            (
                1 => '已完成',
                2 => '进行中',
            ),
        ),

        'finish_date' => array
        (
            'name'      => '完成时间',
            'type'      => 'int(11)',
        ),
    ),

    'index' => array
    (
        'search' => 'seller_id,channel_id,order_num,seller_order_num,channel_order_num,account,channel_callback_date,cdate',
    ),
);