<?php

$status = array
(
    1 => '待处理',
    2 => '配送中',
    3 => '已配送',
    4 => '未配送',
);

$service = function()
{
    $info = Dever::db('shop/service')->select(array('type' => 2));
    return $info;
};

return array
(
    # 表名
    'name' => 'dh_order_ps',
    # 显示给用户看的名称
    'lang' => '订单配送表',
    'menu' => false,
    'status' => $status,
    'end' => array
    (
        'insert' => 'shop/lib/manage.sellOrderPs',
        'update' => 'shop/lib/manage.sellOrderPs',
    ),
    # 数据结构
    'struct' => array
    (
    
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            'update'    => 'hidden',
            //'list'        => true,
        ),

        'order_id'      => array
        (
            'type'      => 'int-11',
            'name'      => '订单表id',
            'default'   => '',
            'desc'      => '订单表id',
            'match'     => 'is_numeric',
            'update'      => 'hidden',
            'value'     => Dever::input('search_option_order_id'),
        ),

        'service'       => array
        (
            'type'      => 'text-1000',
            'name'      => '快递信息',
            'default'   => '',
            'desc'      => '配送发货',
            'match'     => 'is_string',
            'update'    => array
            (
                array
                (
                    'col'       => 'service_id',
                    'name'      => '配送服务商',
                    'default'   => '-1',
                    'desc'      => '配送服务商',
                    'match'     => 'is_numeric',
                    'update'    => 'select',
                    'option'    => $service,
                ),

                array
                (
                    'col'       => 'order_num',
                    'type'      => 'varchar-500',
                    'name'      => '快递单号-填写一个单号即可',
                    'default'   => '',
                    'desc'      => '快递单号',
                    'match'     => 'is_string',
                    'update'    => 'text',
                ),
            ),
        ),

        'status'        => array
        (
            'type'      => 'int-11',
            'name'      => '状态',
            'default'   => '1',
            'desc'      => '状态',
            'match'     => 'is_numeric',
            //'update'  => 'select',
            'option'    => $status,
            'search'    => 'select',
            'list'      => true,
            'edit'      => true,
        ),

        'qu_date'     => array
        (
            'type'      => 'int-11',
            'name'      => '取件时间',
            'default'   => '',
            'match'     => 'is_numeric',
            'desc'      => '取件时间',
        ),

        'qs_date'     => array
        (
            'type'      => 'int-11',
            'name'      => '签收时间',
            'default'   => '',
            'match'     => 'is_numeric',
            'desc'      => '签收时间',
        ),

        '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
    (
        
    ),

    'request' => array
    (
        
    ),
);