audit;
$status = Dever::config('base')->status;
$share = function()
{
$array = array();
$info = Dever::db('poster/template')->state();
if($info)
{
$array += $info;
}
return $array;
};
$share = array
(
1 => '显示',
2 => '不显示',
);
$buy = array
(
1 => '收费',
2 => '免费',
);
$page = 15;
return array
(
# 表名
'name' => 'info',
# 显示给用户看的名称
'lang' => '小刊管理',
'order' => 100,
# 同步更新另外一个或多个表的数据 小刊不需要同步到审核页面
/*
'syncone' => array
(
'audit/data' => array
(
# 更新另外一个表的字段 => 本表的字段
'where' => array('data_id' => 'id', 'type' => 4),
# 要更新的数据
'update' => array('data_id' => 'id', 'type' => 4, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit'),
)
),
*/
# 数据结构
'struct' => array
(
'id' => array
(
'type' => 'int-11',
'name' => 'ID',
'default' => '',
'desc' => '',
'match' => 'is_numeric',
//'list' => true,
),
'name' => array
(
'type' => 'varchar-180',
'name' => '杂志标题',
'default' => '',
'desc' => '标题',
'match' => 'is_string',
'update' => 'text',
'search' => 'fulltext',
'list' => true,
),
'subname' => array
(
'type' => 'varchar-80',
'name' => '子标题-一般为杂志的期数,如第1期',
'default' => '',
'desc' => '子标题',
'match' => 'is_string',
'update' => 'text',
//'list' => true,
),
'pic_cover' => array
(
'type' => 'varchar-150',
'name' => '列表页封面图-4:3比例的图片',
'default' => '',
'desc' => '列表封面图',
'match' => 'option',
//'update' => 'image',
'key' => '1',
'place' => '150',
),
'pic_view_cover' => array
(
'type' => 'varchar-150',
'name' => '封面图-1:1比例的图片',
'default' => '',
'desc' => '封面图',
'match' => 'option',
'update' => 'image',
'key' => '1',
'place' => '150',
),
'pic_view_bg' => array
(
'type' => 'text-255',
'name' => '全屏背景图-进入小刊阅读页之前的全屏背景图,可以多张切换,尽量保持在5张之内',
'default' => '',
'desc' => '全屏背景图',
'match' => 'option',
'update' => 'images',
'key' => '1',
'place' => '150',
),
'num_add_ding' => array
(
'type' => 'int-11',
'name' => '订阅数基数',
'default' => '0',
'desc' => '手动增加阅读数',
'match' => 'option',
'update' => 'text',
),
'num_ding' => array
(
'type' => 'int-11',
'name' => '订阅数',
'default' => '0',
'desc' => '请填写订阅数',
'match' => 'option',
'search' => 'order',
//'list' => '{num_view}+{num_add_view}',
),
'num_add_view' => array
(
'type' => 'int-11',
'name' => '阅读数基数',
'default' => '0',
'desc' => '手动增加阅读数',
'match' => 'option',
'update' => 'text',
),
'num_view' => array
(
'type' => 'int-11',
'name' => '阅读数',
'default' => '0',
'desc' => '请填写阅读数',
'match' => 'option',
'search' => 'order',
//'list' => '{num_view}+{num_add_view}',
),
'num_add_up' => array
(
'type' => 'int-11',
'name' => '喜欢基数',
'default' => '0',
'desc' => '喜欢基数',
'match' => 'option',
'update' => 'text',
),
'num_up' => array
(
'type' => 'int-11',
'name' => '喜欢数',
'default' => '0',
'desc' => '请填写喜欢数',
'match' => 'option',
//'search' => 'order',
'list' => '"订阅数:{num_ding}+{num_add_ding}
喜欢数:{num_up}+{num_add_up}
阅读数:{num_view}+{num_add_view}
评论数:{num_comment}
"',
'list_name' => '统计数字',
),
'num_comment' => array
(
'type' => 'int-11',
'name' => '评论数',
'default' => '0',
'desc' => '请填写评论数',
'search' => 'order',
'match' => 'option',
//'list' => true,
),
'state' => array
(
'type' => 'tinyint-1',
'name' => '状态',
'default' => '1',
'desc' => '请选择状态',
'match' => 'is_numeric',
),
'audit' => array
(
'type' => 'int-11',
'name' => '审核',
'default' => '1',
'desc' => '审核',
'match' => 'is_numeric',
//'update' => 'select',
'option' => $audit,
//'search' => 'select',
//'list' => true,
//'edit' => true,
),
'status' => array
(
'type' => 'int-11',
'name' => '上线状态',
'default' => '1',
'desc' => '上线状态',
'match' => 'is_numeric',
//'update' => 'select',
'option' => $status,
'search' => 'select',
'list' => true,
'edit' => true,
),
'admin_founder' => array
(
'type' => 'int-11',
'name' => '创建人',
'default' => '1',
'desc' => '创建人',
'match' => 'is_numeric',
),
'admin_editor' => array
(
'type' => 'int-11',
'name' => '操作人',
'default' => '1',
'desc' => '操作人',
'match' => 'is_numeric',
),
'pdate' => array
(
'type' => 'int-11',
'name' => '发布时间',
'match' => array('is_numeric', time()),
'default' => '',
'desc' => '',
'update' => 'date',
'callback' => 'maketime',
'insert' => true,
'list' => 'date("Y-m-d H:i:s", {pdate})',
'auth' => '"{pdate}" > 0',
),
'share' => array
(
'type' => 'text-255',
'name' => '分享海报-选择海报库中的海报',
'default' => '',
'desc' => '分享海报',
'match' => 'option',
//'update' => 'checkbox',
'option' => $share,
),
'buy' => array
(
'type' => 'int-11',
'name' => '小刊是否收费',
'default' => '1',
'desc' => '小刊是否收费',
'match' => 'option',
'update' => 'radio',
'option' => $buy,
),
'reorder' => array
(
'type' => 'int-11',
'name' => '排序(数值越大越靠前)',
'default' => '1',
'desc' => '请输入排序',
'match' => 'option',
'update' => 'text',
'search' => 'order',
'list' => true,
'order' => 'desc',
'edit' => true,
),
'udate' => array
(
'type' => 'int-11',
'name' => '更新时间',
'match' => array('is_numeric', time()),
'desc' => '',
),
'cdate' => array
(
'type' => 'int-11',
'name' => '录入时间',
'match' => array('is_numeric', time()),
'desc' => '',
# 只有insert时才生效
'insert' => true,
),
),
# 索引
'index' => array
(
'version' => 1,
1 => array
(
'i1' => 'uid,cate_id',
)
),
# 管理功能
'manage' => array
(
//'insert' => false,
'delete' => false,
# 列表
'list_button' => array
(
'edit' => array('预览', Dever::url('main/preview.get?type=4')),
'br1' => array('
'),
'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info&page_type=1"' , '{audit} == 1'),
'br2' => array('
'),
'add' => array('购买设置', '"buy&project=journal&search_option_info_id={id}&oper_parent=info&oper_project=journal&oper_save_jump=info&where_id={id}"', '{audit} == 1'),
'add1' => array('活动设置', '"active&project=journal&search_option_info_id={id}&oper_parent=info&oper_project=journal&oper_save_jump=info&where_id={id}"', '{audit} == 1'),
'br3' => array('
'),
'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1'),
),
),
# request 请求接口定义
'request' => array
(
'search' => array
(
# 匹配的正则或函数 选填项
'option' => array
(
'ids' => array('yes-id', 'in'),
//'cate_id' => 'yes',
'name' => array('yes', 'like'),
'id' => 'yes',
),
'type' => 'all',
'order' => array('reorder' => 'desc', 'id' => 'desc'),
'limit' => '0,1000',
'col' => 'name as name, id, id as value, "" as selected, "" as disabled',
),
'getAll' => array
(
# 匹配的正则或函数 选填项
'option' => array
(
'cate_id' => 'yes',
'cate_ids' => array('yes-cate_id', 'in'),
'id' => 'yes',
),
'type' => 'all',
'order' => array('id' => 'desc'),
'page' => array($page, 'list'),
'col' => '*',
),
# 获取默认主题,按照置顶和时间排序的
'default' => array
(
# 匹配的正则或函数 选填项
'option' => array
(
'cate_id' => 'yes',
'uid' => 'yes',
),
'type' => 'all',
'order' => array('id' => 'desc'),
'page' => array($page, 'list'),
'col' => '*',
),
# 获取最新主题
'new' => array
(
# 匹配的正则或函数 选填项
'option' => array
(
'name' => array('yes', 'like'),
'cate_id' => 'yes',
'uid' => 'yes',
),
'type' => 'all',
'order' => array('id', 'desc'),
'page' => array($page, 'list'),
'col' => '*',
),
# 获取热门主题
'hot' => array
(
# 匹配的正则或函数 选填项
'option' => array
(
'cate_id' => 'yes',
'uid' => 'yes',
),
'type' => 'all',
'order' => array('num_view`+`num_add_view' => 'desc', 'id' => 'desc'),
'page' => array($page, 'list'),
'col' => '*',
),
# 获取冷门主题
'cold' => array
(
# 匹配的正则或函数 选填项
'option' => array
(
'cate_id' => 'yes',
'uid' => 'yes',
),
'type' => 'all',
'order' => array('num_view`+`num_add_view' => 'asc', 'id' => 'desc'),
'page' => array($page, 'list'),
'col' => '*',
),
# 更新浏览量
'addView' => array
(
'type' => 'update',
'where' => array
(
'id' => 'yes',
),
'set' => array
(
'num_view' => array('1', '+='),
),
),
# 更新回复数
'addComment' => array
(
'type' => 'update',
'where' => array
(
'id' => 'yes',
),
'set' => array
(
'num_comment' => array('1', '+='),
),
),
# 更新点赞数
'addUp' => array
(
'type' => 'update',
'where' => array
(
'id' => 'yes',
),
'set' => array
(
'num_up' => array('1', '+='),
),
),
# 更新点赞数
'desUp' => array
(
'type' => 'update',
'where' => array
(
'id' => 'yes',
),
'set' => array
(
'num_up' => array('1', '-='),
),
),
),
);