123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '可用',
- 2 => '不可用',
- );
- return array
- (
- # 表名
- 'name' => 'user_product',
- # 显示给用户看的名称
- 'lang' => '用户产品列表',
- # 后台菜单排序
- 'order' => 10,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'order' => 'desc',
- //'list' => true,
- ),
- 'uid' => array
- (
- 'type' => 'int-11',
- 'name' => '用户',
- 'default' => '',
- 'desc' => '请选择用户',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'in' => true,
- 'list' => 'Dever::load("passport/user-one#username", {uid})',
- 'autocomplete' => array('passport/manage.user?json=1', 'uid', 'passport/user-info#username'),
- ),
-
- 'product_id' => array
- (
- 'type' => 'int-11',
- 'name' => '产品',
- 'default' => '',
- 'desc' => '请选择产品',
- 'match' => 'is_numeric',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'in' => true,
- 'list' => 'Dever::load("device/data.product_info#name", {product_id})',
- 'autocomplete' => array('device/manage.product?json=1', 'product_id', 'device/data.product_info#name'),
- ),
- 'key' => array
- (
- 'type' => 'varchar-60',
- 'name' => '设备标识',
- 'default' => '',
- 'desc' => '设备标识',
- 'match' => 'is_string',
- //'update' => 'text',
- 'list_name' => '传感器与控制器',
- 'list' => 'Dever::load("device/element.getAll", {product_id})',
- ),
- '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})',
- ),
- ),
-
- 'manage' => array
- (
- # 不允许编辑
- 'edit' => false,
- 'insert' => false,
- ),
-
- # request 请求接口定义
- 'request' => array
- (
-
- ),
- );
|