123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <?php
- # 定义几个常用的选项
- $option = array
- (
- 1 => '正常',
- 2 => '删除',
- );
- $use = array
- (
- 1 => '未使用',
- 2 => '已使用',
- );
- $pid = Dever::input('search_option_pid');
- return array
- (
- # 表名
- 'name' => 'data',
- # 显示给用户看的名称
- 'lang' => '数据管理',
- # 后台菜单排序
- 'order' => 6,
- 'menu' => false,
- # 数据结构
- 'struct' => array
- (
-
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'list' => true,
- 'order' => 'desc',
- ),
- 'pid' => array
- (
- 'type' => 'int-11',
- 'name' => '项目',
- 'default' => '1',
- 'desc' => '请选择项目id',
- 'match' => 'is_numeric',
- //'list' => '{pid} > 0 ? Dever::load("spider/project-one#name", {pid}) : "无"',
- # 开启显示控制,可以控制下边的表单
- //'show' => 'cate_id',
- ),
- 'source' => array
- (
- 'type' => 'varchar-2000',
- 'name' => '来源',
- 'default' => '',
- 'desc' => '来源',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'value' => array
- (
- 'type' => 'text-1000',
- 'name' => '数据',
- 'default' => '',
- 'desc' => '数据',
- 'match' => 'is_string',
- //'update' => 'editor',
- 'search' => 'fulltext',
- 'list' => 'Dever::load("spider/data.value", {id})',
- //'modal' => '查看详情',
- ),
- 'log_id' => array
- (
- 'type' => 'int-11',
- 'name' => '日志id',
- 'default' => '1',
- 'desc' => '请输入日志id',
- 'match' => 'is_numeric',
- //'update' => 'text',
- 'search' => 'fulltext',
- //'list' => true,
- ),
- 'use' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '使用状态',
- 'default' => '1',
- 'desc' => '使用状态',
- 'match' => 'is_numeric',
- 'option' => $use,
- 'search' => 'select',
- 'update' => 'radio',
- 'list' => 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
- (
- # 开启批量管理
- //'mul' => true,
- 'insert' => false,
- 'edit' => false,
- //'delete' => false,
- # 自定义快捷新增和编辑
- 'button' => array
- (
- //'新增兑换码' => array('fast', 1, 'config&where_id=1'),
- //'导出EXCEL' => array('location', 'spider/data.excel?id=' . $pid),
- '导出SQL' => array('location', 'spider/data.sql?id=' . $pid . '&time=' . time()),
-
- '重置使用状态' => array('oper', 'spider/data.use?id=' . $pid),
- '清空数据' => array('oper', 'spider/data.drop?id=' . $pid),
- ),
- ),
-
- # request 请求接口定义
- 'request' => array
- (
- # 更新浏览量
- 'addView' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'id' => 'yes',
- ),
- 'set' => array
- (
- 'num_view' => array('1', '+='),
- ),
- ),
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'pid' => 'yes',
- 'use' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id', 'asc'),
- 'limit' => '0,12',
- ),
- 'getOne' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'pid' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'one',
- 'order' => array('id', 'desc'),
- ),
- ),
- );
|