<?php
# 获取分类权限
$status = array
(
    1 => '离线',
    2 => '在线，工作状态正常',
    3 => '在线，工作状态不正常',
    10 => '绑定失败',
);

return array
(
    # 表名
    'name' => 'print',
    # 显示给用户看的名称
    'lang' => '打印设备',
    # 后台菜单排序
    'order' => 10,
    'menu' => false,
    'check' => 'number',
    'end' => array
    (
        'insert' => 'shop/lib/manage.printInsert',
        'update' => 'shop/lib/manage.printUpdate',
    ),
    # 数据结构
    'struct' => array
    (
        'id'        => array
        (
            'type'      => 'int-11',
            'name'      => 'ID',
            'default'   => '',
            'desc'      => '',
            'match'     => 'is_numeric',
            'search'    => 'order',
            'list'      => true,
            'order'     => 'desc',
        ),

        'shop_id'      => array
        (
            'type'      => 'int-11',
            'name'      => '所属门店',
            'default'   => '',
            'desc'      => '所属门店',
            'match'     => 'is_numeric',
            'update'    => 'hidden',
            'search'    => 'hidden',
            'value'     => Dever::input('search_option_shop_id'),
            'list'      => 'Dever::load("shop/info-one#name", {shop_id})',
        ),
        
        'name'      => array
        (
            'type'      => 'varchar-200',
            'name'      => '设备名称',
            'default'   => '',
            'desc'      => '请输入设备名称',
            'match'     => 'is_string',
            'update'    => 'text',
            'search'    => 'fulltext',
            'list'      => true,
        ),

        'number'      => array
        (
            'type'      => 'varchar-100',
            'name'      => '打印机编号',
            'default'   => '',
            'desc'      => '打印机编号',
            'match'     => 'is_string',
            'update'    => 'text',
            'search'    => 'fulltext',
            'list'      => true,
        ),

        'key'      => array
        (
            'type'      => 'varchar-100',
            'name'      => '打印机识别码',
            'default'   => '',
            'desc'      => '打印机识别码',
            'match'     => 'is_string',
            'update'    => 'text',
            'search'    => 'fulltext',
            'list'      => true,
        ),

        'phonenum'      => array
        (
            'type'      => 'varchar-100',
            'name'      => '流量卡号码',
            'default'   => '',
            'desc'      => '流量卡号码',
            'match'     => 'option',
            'update'    => 'text',
            //'search'    => 'fulltext',
            //'list'      => true,
        ),

        'status'        => array
        (
            'type'      => 'int-11',
            'name'      => '打印机状态',
            'default'   => '1',
            'desc'      => '打印机状态',
            'match'     => 'is_numeric',
            //'update'  => 'select',
            'option'    => $status,
            'search'    => 'select',
            'list'      => 'Dever::load("shop/lib/manage.printStatus", "{status}", "{number}")',
            //'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
    (
        //'delete' => false,
        'edit' => false,

        'list_button' => array
        (
            'fast' => array('编辑', '"print&where_id={id}&col=name,phonenum&oper_save_jump=print&oper_table=print&oper_parent=print"'),

            //'delete' => array('删除', 'print', '{status} == 10'),
        )
    ),

    'request' => array
    (
        
    ),
);
