<?php
# 获取分类权限
$status = array
(
    1 => '申请中',
    2 => '审核通过',
    3 => '审核未通过',
);

return array
(
    # 表名
    'name' => 'apply',
    # 显示给用户看的名称
    'lang' => '门店合作申请',
    # 后台菜单排序
    'order' => 1,
    //'menu' => false,
    'ends' => array
    (
        'insert' => 'shop/lib/manage.upInfo',
        'update' => 'shop/lib/manage.upInfo',
    ),
    # 数据结构
    'struct' => array
    (
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            'list'      => true,
            'order'     => 'desc',
        ),
        
        'name'      => array
        (
            'type'      => 'varchar-100',
            'name'      => '申请人姓名',
            'default'   => '',
            'desc'      => '申请人姓名',
            'match'     => 'is_string',
            'update'    => 'text',
            'search'    => 'fulltext',
            'list'      => true,
        ),

        'mobile'      => array
        (
            'type'      => 'bigint-11',
            'name'      => '申请人电话',
            'default'   => '',
            'desc'      => '申请人电话',
            'match'     => 'is_numeric',
            'update'    => 'text',
            'search'    => 'fulltext',
            'list'      => true,
        ),

        'area'       => array
        (
            'type'      => 'varchar-500',
            'name'      => '所在城市',
            'default'   => '',
            'desc'      => '所在城市',
            'match'     => 'option',
            'search'    => 'linkage',
            'update'    => 'linkage',
            'option'    => Dever::url('api.get?level_total=2', 'area'),
            'list'      => 'Dever::load("area/api.string", "{area}")',
        ),

        'province'      => array
        (
            'type'      => 'int-11',
            'name'      => '省份',
            'default'   => '',
            'desc'      => '省份',
            'match'     => 'option',
            //'update'  => 'text',
        ),

        'city'      => array
        (
            'type'      => 'int-11',
            'name'      => '城市',
            'default'   => '',
            'desc'      => '城市',
            'match'     => 'option',
            //'update'  => 'text',
        ),

        'lng'       => array
        (
            'type'      => 'varchar-100',
            'name'      => '经度',
            'default'   => '',
            'desc'      => '经度',
            'match'     => 'option',
            //'update'    => 'text',
            //'list'        => true,
        ),

        'lat'       => array
        (
            'type'      => 'varchar-100',
            '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,
        ),

        '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,
            'list'      => 'date("Y-m-d H:i:s", {cdate})',
        ),
    ),

    'manage' => array
    (
        'insert' => false,
    ),

    'request' => array
    (
        
    ),
);