123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '可用',
- 2 => '不可用',
- );
- $type = array
- (
- 1 => '未激活',
- 2 => '已激活',
- 3 => '不可用',
- );
- return array
- (
- # 表名
- 'name' => 'product',
- # 显示给用户看的名称
- 'lang' => '成品设备管理',
- # 后台菜单排序
- 'order' => 30,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => '设备ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'order' => 'desc',
- //'list' => true,
- ),
- 'info_id' => array
- (
- 'type' => 'int-11',
- 'name' => '基础设备',
- 'default' => '1',
- 'desc' => '请选择基础设备',
- 'match' => 'is_numeric',
- 'option' => $info,
- 'update' => 'select',
- 'search' => 'select',
- 'list_name' => '设备名称',
- 'list' => '"{id}号" . Dever::load("device/info-one#name", {info_id})',
- ),
- 'key' => array
- (
- 'type' => 'varchar-60',
- 'name' => '设备标识',
- 'default' => '',
- 'desc' => '设备标识',
- 'match' => 'is_string',
- //'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'api' => array
- (
- 'type' => 'varchar-200',
- 'name' => '设备网关',
- 'default' => '',
- 'desc' => '设备网关',
- 'match' => 'is_string',
- 'update' => 'textarea',
- 'search' => 'fulltext',
- //'list' => true,
- ),
- 'ip' => array
- (
- 'type' => 'varchar-200',
- 'name' => '设备IP或域名',
- 'default' => '',
- 'desc' => '设备IP或域名',
- 'match' => 'is_string',
- 'update' => 'textarea',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否激活',
- 'default' => '1',
- 'desc' => '请选择是否激活',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'update' => 'select',
- 'search' => 'select',
- 'list' => true,
- ),
-
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序-数值越大越靠前',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'order',
- 'list' => true,
- 'order' => 'desc',
- 'edit' => true,
- ),
-
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- 'option' => $option,
- 'update' => 'radio',
- 'list' => true,
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
-
- # request 请求接口定义
- 'request' => array
- (
- ),
- );
|