'显示',
2 => '不显示',
);
$type = array(0 => '默认类型');
$info = Dever::input('search_option_info_id');
if ($info) {
$info = Dever::load('module/info-one', $info);
if (!$info) {
echo 'error';die;
}
$info['name'] .= '下的数据推送';
$info['col'] = explode(',', $info['col']);
$preview = $info['preview'];
$preview_height = $info['preview_height'] ? $info['preview_height'] : 500;
$name_state = in_array(1, $info['col']);
$link_state = in_array(2, $info['col']);
$pic_state = in_array(3, $info['col']);
$content_state = in_array(4, $info['col']);
if ($info['data_type']) {
$type = explode("\r\n", $info['data_type']);
}
} else {
$info = array();
$info['name'] = '模块数据管理';
$info['col_pic'] = '100X100';
$info['col_content'] = '30';
$info['type'] = 1;
$name_state = false;
$link_state = false;
$pic_state = false;
$content_state = false;
$preview = '';
$preview_height = 0;
}
return array
(
# 表名
'name' => 'data',
# 显示给用户看的名称
'lang' => $info['name'],
'order' => 7,
'menu' => false,
//'desc' => '预览地址:
',
# 数据结构
'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' => Dever::input('search_option_info_id', '1'),
'desc' => '模块',
'match' => 'is_numeric',
'update' => 'hidden',
),
'type' => array
(
'type' => 'tinyint-1',
'name' => '数据类型',
'default' => '0',
'desc' => '请选择数据类型',
'match' => 'is_numeric',
//'option' => $type,
//'update' => 'radio',
//'search' => 'select',
//'list' => true,
//'edit' => true,
),
'source_id' => array
(
'type' => 'int-11',
'name' => '数据id',
'default' => '',
'desc' => '数据id',
'match' => $info['type'] == 3 ? 'is_numeric' : 'option',
'update' => $info['type'] == 3 ? 'text' : 'hidden',
'list' => $info['type'] == 3 ? true : false,
),
'name' => array
(
'type' => 'varchar-60',
'name' => '标题-手动干扰项',
'default' => '',
'desc' => '请输入标题',
'match' => $name_state ? 'option' : 'option',
'update' => $name_state ? 'text' : 'hidden',
'search' => $name_state ? 'fulltext' : '',
'list' => $name_state ? '{source_id} > 0 ? ("{name}" ? "{name}" : Dever::load("sad/supply-one#name", {source_id})) : "{name}"' : false,
'edit' => $name_state ? true : false,
),
'link' => array
(
'type' => 'varchar-200',
'name' => '链接-手动干扰项',
'default' => '',
'desc' => '请输入链接',
'match' => $link_state ? 'option' : 'option',
'update' => $link_state ? 'text' : 'hidden',
'search' => $link_state ? 'fulltext' : '',
//'list' => $link_state ? true : false,
'edit' => $link_state ? true : false,
),
'pic' => array
(
'type' => 'varchar-200',
'name' => '图片-手动干扰项,请上传,' . $info['col_pic'] . '大小的图片',
'default' => '',
'desc' => '请选择图片',
'match' => $pic_state ? 'option' : 'option',
'update' => $pic_state ? 'image' : 'hidden',
'search' => $pic_state ? 'fulltext' : '',
//'list' => $pic_state ? true : false,
'key' => 1
),
'content' => array
(
'type' => 'text-255',
'name' => '内容-手动干扰项,字数请不要超过' . $info['col_content'] . '个汉字,前台展示时会自动过滤',
'default' => '',
'desc' => '请输入内容',
'match' => $content_state ? 'option' : 'option',
'update' => $content_state ? 'editor' : 'hidden',
),
'reorder' => array
(
'type' => 'int-11',
'name' => '排序(数值越大越靠前)',
'default' => '1',
'desc' => '请输入排序',
'match' => 'option',
'update' => 'text',
'search' => 'order',
'list_name' => '排序',
'list' => true,
'order' => 'desc',
'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})',
),
),
# request 请求接口定义
'request' => array
(
# 获取列表页
'getAllByType' => array
(
# 匹配的正则或函数 选填项
'option' => array
(
'type' => 'yes',
'info_id' => 'yes',
'state' => 1,
),
'type' => 'all',
'order' => array('reorder' => 'desc'),
//'col' => '*|type|',
'col' => '*',
),
),
);