123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '显示',
- 2 => '不显示',
- );
- return array
- (
- # 表名
- 'name' => 'device_sensor',
- # 显示给用户看的名称
- 'lang' => '设备状态',
- 'menu' => false,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'order' => 'desc',
- //'list' => true,
- ),
- 'device_id' => array
- (
- 'type' => 'int-11',
- 'name' => '基础设备',
- 'default' => '',
- 'desc' => '请输入基础设备',
- 'match' => 'is_numeric',
- 'update' => 'text',
- ),
-
- 'sensor_id' => array
- (
- 'type' => 'int-11',
- 'name' => '传感器',
- 'default' => '',
- 'desc' => '传感器',
- 'match' => 'is_numeric',
- 'update' => 'text',
- //'list' => 'Dever::load("device/sensor-one#name", {sensor_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})',
- ),
- ),
-
- //'auth' => 'company',
-
- 'manage' => array
- (
- 'list_button' => array
- (
- //11 => array('控制设备', '"farm_device_set&option_farm_device_id={id}"'),
- //12 => array('数据记录', '"farm_device_data&option_farm_device_id={id}"'),
- //6 => '删除'
- ),
- ),
-
- # request 请求接口定义
- 'request' => array
- (
-
- ),
- );
|