<?php

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

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

return array
(
    # 表名
    'name' => 'order_ps',
    # 显示给用户看的名称
    'lang' => '订单配送表',
    'menu' => false,
    'status' => $status,

    'end' => array
    (
        'insert' => 'card/lib/manage.orderPs',
        'update' => 'card/lib/manage.orderPs',
    ),
    # 数据结构
    '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_id'        => array
        (
            'type'      => 'int-11',
            'name'      => '配送服务商',
            'default'   => '-1',
            'desc'      => '配送服务商',
            'match'     => 'is_numeric',
            'update'    => 'select',
            'option'    => $service,
        ),

        'order_num'        => array
        (
            'type'      => 'varchar-800',
            'name'      => '快递单号-多个用换行隔开',
            'default'   => '',
            'desc'      => '快递单号',
            'match'     => 'is_string',
            'update'    => 'textarea',
        ),

        'num'        => array
        (
            'type'      => 'int-11',
            'name'      => '包裹数量',
            'default'   => '',
            'desc'      => '包裹数量',
            'match'     => 'is_numeric',
            'search'    => 'select',
            'list'        => true,
        ),

        'price'      => array
        (
            'type'      => 'varchar-50',
            'name'      => '快递费用',
            'default'   => '',
            'desc'      => '快递费用',
            'match'     => 'option',
            'update'    => 'text',
            'list'        => true,
        ),

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