rabin 6 years ago
parent
commit
d2570263ea

+ 0 - 397
audit/database/article.php

@@ -1,397 +0,0 @@
-<?php
-
-$code = array
-(
-	1 => '用户ID',
-	2 => '随机数字',
-	3 => '随机数字+字母',
-);
-
-# 每页的数据量
-$page = 15;
-
-$cate = function()
-{
-	$array = array();
-	$info = Dever::db('content/cate')->state();
-	if($info)
-	{
-		$array += $info;
-	}
-	return $array;
-};
-
-$author = function()
-{
-	$array = array();
-	$info = Dever::db('content/author')->state();
-	if($info)
-	{
-		$array += $info;
-	}
-	return $array;
-};
-
-$share = function()
-{
-	$array = array();
-	$info = Dever::db('poster/template')->state();
-	if($info)
-	{
-		$array += $info;
-	}
-	return $array;
-};
-
-return array
-(
-	# 表名
-	'name' => 'article',
-	# 显示给用户看的名称
-	'lang' => '图文管理',
-	'order' => 100,
-	# 数据结构
-	'struct' => array
-	(
-		'id' 		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> 'ID',
-			'default' 	=> '',
-			'desc' 		=> '',
-			'match' 	=> 'is_numeric',
-		),
-		
-		'name'		=> array
-		(
-			'type' 		=> 'varchar-80',
-			'name' 		=> '标题',
-			'default' 	=> '',
-			'desc' 		=> '标题',
-			'match' 	=> 'is_string',
-			'update'	=> 'text',
-			'list'		=> true,
-		),
-		
-		'cate_id'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '所属栏目',
-			'default' 	=> '1',
-			'desc' 		=> '所属栏目',
-			'match' 	=> 'is_numeric',
-			'update'	=> 'select',
-			'option'	=> $cate,
-			'search'	=> 'select',
-		),
-
-		'author_id'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '作者',
-			'default' 	=> '1',
-			'desc' 		=> '作者',
-			'match' 	=> 'is_numeric',
-			'update'	=> 'select',
-			'option'	=> $author,
-			'search'	=> 'select',
-		),
-
-  		'pic_cover'		=> array
-		(
-			'type' 		=> 'varchar-150',
-			'name' 		=> '封面图-4:3比例的图片',
-			'default' 	=> '',
-			'desc' 		=> '封面图',
-			'match' 	=> 'option',
-			'update'	=> 'image',
-			'key' 		=> '1',
-			'place'		=> '150',
-		),
-
-		'num_add_view'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '手动增加浏览量pv数',
-			'default' 	=> '0',
-			'desc' 		=> '请填写手动增加浏览量pv',
-			'match' 	=> 'option',
-			'update'	=> 'text',
-		),
-
-		'num_view'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '浏览量pv',
-			'default' 	=> '0',
-			'desc' 		=> '请填写浏览量pv',
-			'match' 	=> 'option',
-			'search'	=> 'order',
-			//'list'		=> '{num_view}+{num_add_view}',
-		),
-		
-		'num_up'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '喜欢数',
-			'default' 	=> '0',
-			'desc' 		=> '请填写喜欢数',
-			'match' 	=> 'option',
-			//'search'	=> 'order',
-			'list'		=> '"喜欢数:{num_up}<br />浏览量:{num_view}+{num_add_view}<br />评论数:{num_comment}<br />"',
-			'list_name'	=> '统计数字',
-		),
-
-		'num_comment'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '评论数',
-			'default' 	=> '0',
-			'desc' 		=> '请填写评论数',
-			'search'	=> 'order',
-			'match' 	=> 'option',
-			//'list'		=> true,
-		),
-
-		'content'		=> array
-		(
-			'type' 		=> 'text-255',
-			'name' 		=> '内容',
-			'default' 	=> '',
-			'desc' 		=> '请输入内容',
-			'match' 	=> 'is_string',
-			'update'	=> 'editor',
-			'key' 		=> 1,
-			'media'		=> 5,
-		),
-
-		'state'		=> array
-		(
-			'type' 		=> 'tinyint-1',
-			'name' 		=> '状态',
-			'default' 	=> '1',
-			'desc' 		=> '请选择状态',
-			'match' 	=> 'is_numeric',
-		),
-
-		'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' 	=> 'is_numeric',
-			'desc' 		=> '',
-			'update'	=> 'date',
-			'callback'	=> 'maketime',
-			'list'		=> 'date("Y-m-d H:i:s", {pdate})',
-		),
-
-		'share'		=> array
-		(
-			'type' 		=> 'text-255',
-			'name' 		=> '分享海报-选择海报库中的海报',
-			'default' 	=> '',
-			'desc' 		=> '分享海报',
-			'match' 	=> 'option',
-			'update'	=> 'checkbox',
-			'option'	=> $share,
-		),
-
-		'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,
-		# 列表
-		/*
-		'list_button' => array
-		(
-			'list' => array('评论列表', '"comment&search_option_data_id={id}&oper_parent=article"'),
-		),
-		*/
-	),
-
-	# request 请求接口定义
-	'request' => array
-	(
-		'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', '-='),
-			),
-		),
-	),
-);

+ 0 - 77
audit/database/author.php

@@ -1,77 +0,0 @@
-<?php
-
-return array
-(
-	# 表名
-	'name' => 'author',
-	# 显示给用户看的名称
-	'lang' => '作者管理',
-	# 后台菜单排序
-	'order' => 8,
-	# 数据结构
-	'struct' => array
-	(
-		'id' 		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> 'ID',
-			'default' 	=> '',
-			'desc' 		=> '',
-			'match' 	=> 'is_numeric',
-			'search'	=> 'order',
-			//'list'		=> true,
-			'order'		=> 'desc',
-		),
-		
-		'name'		=> array
-		(
-			'type' 		=> 'varchar-32',
-			'name' 		=> '作者名称',
-			'default' 	=> '',
-			'desc' 		=> '请输入名称',
-			'match' 	=> 'is_string',
-			'update'	=> 'text',
-			'search'	=> 'fulltext',
-			'list'		=> true,
-		),
-		
-		'reorder'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '排序(数值越大越靠前)',
-			'default' 	=> '1',
-			'desc' 		=> '请输入排序',
-			'match' 	=> 'option',
-			'update'	=> 'text',
-			'search'	=> 'order',
-			'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' => array
-	(
-		
-	),
-);

+ 0 - 77
audit/database/cate.php

@@ -1,77 +0,0 @@
-<?php
-
-return array
-(
-	# 表名
-	'name' => 'cate',
-	# 显示给用户看的名称
-	'lang' => '栏目设置',
-	# 后台菜单排序
-	'order' => 9,
-	# 数据结构
-	'struct' => array
-	(
-		'id' 		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> 'ID',
-			'default' 	=> '',
-			'desc' 		=> '',
-			'match' 	=> 'is_numeric',
-			'search'	=> 'order',
-			//'list'		=> true,
-			'order'		=> 'desc',
-		),
-		
-		'name'		=> array
-		(
-			'type' 		=> 'varchar-32',
-			'name' 		=> '栏目名称',
-			'default' 	=> '',
-			'desc' 		=> '请输入名称',
-			'match' 	=> 'is_string',
-			'update'	=> 'text',
-			'search'	=> 'fulltext',
-			'list'		=> true,
-		),
-		
-		'reorder'		=> array
-		(
-			'type' 		=> 'int-11',
-			'name' 		=> '排序(数值越大越靠前)',
-			'default' 	=> '1',
-			'desc' 		=> '请输入排序',
-			'match' 	=> 'option',
-			'update'	=> 'text',
-			'search'	=> 'order',
-			'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' => array
-	(
-		
-	),
-);

+ 147 - 0
audit/database/data.php

@@ -0,0 +1,147 @@
+<?php
+
+$type = Dever::config('base')->type;
+
+$audit = Dever::config('base')->audit;
+
+return array
+(
+	# 表名
+	'name' => 'data',
+	# 显示给用户看的名称
+	'lang' => '审核管理',
+	# 后台菜单排序
+	'order' => 7,
+	'menu'	=> 'content',
+	'end' => array
+	(
+		'update_audit' => 'audit/lib/core.audit',
+	),
+	# 数据结构
+	'struct' => array
+	(
+		'id' 		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> 'ID',
+			'default' 	=> '',
+			'desc' 		=> '',
+			'match' 	=> 'is_numeric',
+			'search'	=> 'order',
+			//'list'		=> true,
+			'order'		=> 'desc',
+		),
+
+		'type'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '类型',
+			'default' 	=> '1',
+			'desc' 		=> '类型',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'radio',
+			'option'	=> $type,
+			'search'	=> 'select',
+			'list'		=> true,
+			//'edit'		=> true,
+		),
+
+		'data_id'		=> array
+		(
+			'type' 		=> 'varchar-80',
+			'name' 		=> '数据ID',
+			'default' 	=> '',
+			'desc' 		=> '数据id',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			//'search'	=> 'fulltext',
+			//'list'		=> true,
+		),
+		
+		'name'		=> array
+		(
+			'type' 		=> 'varchar-80',
+			'name' 		=> '标题',
+			'default' 	=> '',
+			'desc' 		=> '标题',
+			'match' 	=> 'is_string',
+			'update'	=> 'text',
+			'search'	=> 'fulltext',
+			'list'		=> true,
+		),
+
+		'audit'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '审核状态',
+			'default' 	=> '1',
+			'desc' 		=> '审核',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'select',
+			'option'	=> $audit,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+		
+		'pdate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '发布时间',
+			'match' 	=> 'is_numeric',
+			'default'	=> '',
+			'desc' 		=> '',
+			'update'	=> 'date',
+			'callback'	=> 'maketime',
+			'list'		=> 'date("Y-m-d H:i:s", {pdate})',
+		),
+
+		'reorder'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '排序(数值越大越靠前)',
+			'default' 	=> '1',
+			'desc' 		=> '请输入排序',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+			'search'	=> 'order',
+			'list'		=> true,
+			'order'		=> 'desc',
+			//'edit'		=> true,
+		),
+
+		'state'		=> array
+		(
+			'type' 		=> 'tinyint-1',
+			'name' 		=> '状态',
+			'default' 	=> '1',
+			'desc' 		=> '请选择状态',
+			'match' 	=> 'is_numeric',
+			'edit'		=> false,
+		),
+		
+		'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
+	(
+		'delete' => false,
+		'edit' => false,
+		'insert' => false,
+		'mul' => true,
+	),
+
+	'request' => array
+	(
+		
+	),
+);

+ 22 - 0
audit/lib/Core.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace Audit\Lib;
+
+use Dever;
+
+class Core
+{
+    public function audit($id, $name, $data)
+    {
+        $audit = Dever::param('audit', $data);
+        $info = Dever::db('audit/data')->one($id);
+        $table = Dever::config('base')->type_table[$info['type']];
+
+        $source = Dever::db($table)->one($info['data_id']);
+
+        if ($source && $source['audit'] != $audit) {
+            Dever::config('base')->after = false;
+            Dever::db($table)->update(array('where_id' => $info['data_id'], 'audit' => $audit));
+        }
+    }
+}

+ 25 - 0
config/base.php

@@ -4,6 +4,31 @@ $config['base'] = array
 	'name' => '美小刊',
 	'version' => '1.0.0 Beta',
 
+	# 功能类型
+	'type' => array
+	(
+		1 => '图文',
+		2 => '视频',
+		3 => '直播',
+		4 => '小刊',
+	),
+
+	# 功能类型
+	'type_table' => array
+	(
+		1 => 'content/article',
+		2 => 'video/vod',
+		3 => 'video/live',
+		4 => 'journal/info',
+	),
+
+	'audit' => array
+	(
+		1 => '未审核',
+		2 => '已审核',
+		3 => '审核未通过',
+	),
+
 	# 产品表设置 主要给survey使用
 	'product' => 'service/product',
 

+ 44 - 7
content/database/article.php

@@ -1,11 +1,6 @@
 <?php
 
-$code = array
-(
-	1 => '用户ID',
-	2 => '随机数字',
-	3 => '随机数字+字母',
-);
+$audit = Dever::config('base')->audit;
 
 # 每页的数据量
 $page = 15;
@@ -50,6 +45,19 @@ return array
 	# 显示给用户看的名称
 	'lang' => '图文管理',
 	'order' => 100,
+
+	# 同步更新另外一个或多个表的数据
+	'syncone' => array
+	(
+		'audit/data' => array
+		(
+			# 更新另外一个表的字段 => 本表的字段
+			'where' => array('data_id' => 'id', 'type' => 1),
+			# 要更新的数据
+			'update' => array('data_id' => 'id', 'type' => 1, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit'),
+		)
+	),
+
 	'end' => array
 	(
 		'insert' => 'tag/lib/core.data?source_table=content/article',
@@ -203,11 +211,12 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '发布时间',
-			'match' 	=> 'is_numeric',
+			'match' 	=> 'option',
 			'desc' 		=> '',
 			'update'	=> 'date',
 			'callback'	=> 'maketime',
 			'list'		=> 'date("Y-m-d H:i:s", {pdate})',
+			'auth'		=> '"{pdate}" > 0',
 		),
 
 		'share'		=> array
@@ -221,6 +230,20 @@ return array
 			'option'	=> $share,
 		),
 
+		'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',
@@ -272,6 +295,20 @@ return array
 			),
 		),
 
+		'audit'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '审核状态',
+			'default' 	=> '1',
+			'desc' 		=> '审核',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $audit,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

+ 10 - 0
content/database/author.php

@@ -70,6 +70,16 @@ return array
 		),
 	),
 
+	# 默认值
+	'default' => array
+	(
+		'col' => 'name,state,cdate',
+		'value' => array
+		(
+			'"默认作者",1,' . time(),
+		),
+	),
+
 	'manage' => array
 	(
 		'insert' => false,

+ 10 - 0
content/database/cate.php

@@ -70,6 +70,16 @@ return array
 		),
 	),
 
+	# 默认值
+	'default' => array
+	(
+		'col' => 'name,state,cdate',
+		'value' => array
+		(
+			'"默认作者",1,' . time(),
+		),
+	),
+
 	'manage' => array
 	(
 		'insert' => false,

+ 25 - 0
content/lib/Article.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace Content\Lib;
+
+use Dever;
+
+class Article
+{
+    # 根据文章id 获取文章信息
+    public function get($data)
+    {
+        if (!is_array($data)) {
+            $data = Dever::db('content/article')->one($data);
+        }
+        
+        if (!$data) {
+            Dever::alert('错误的文章信息');
+        }
+    
+        //embed
+
+        
+        return $data;
+    }
+}

+ 7 - 0
data/compile/wonderful/main/preview/article.cmp.php

@@ -0,0 +1,7 @@
+<div id="test">tt</div>
+
+<div class="layui-container">
+  <div class="layui-row">
+    ……
+  </div>
+</div>

+ 1 - 0
data/compile/wonderful/main/preview/content.cmp.php

@@ -0,0 +1 @@
+content.html

+ 1 - 0
data/compile/wonderful/main/preview/journal.cmp.php

@@ -0,0 +1 @@
+journal.html

+ 3 - 3
data/compile/wonderful/manage/layadmin/inc/script.cmp.php

@@ -26,9 +26,6 @@
 <script type="text/javascript" src="<?php echo Dever::config("host")->script ?>lib/highlight/highlight.min.js"></script>
 
 
-<script type="text/javascript" src="<?php echo Dever::config("host")->script ?>lib/manage/main.js?v7"></script>
-
-
 <script type="text/javascript" src="<?php echo Dever::config("host")->script ?>lib/valid/jquery.validationEngine.min.js?v3"></script>
 
 
@@ -40,3 +37,6 @@
 
 <script type="text/javascript" src="<?php echo Dever::config("host")->script ?>lib/layui/upload.js?v1"></script>
 <script type="text/javascript" src="<?php echo Dever::config("host")->script ?>lib/layui/layui.js"></script>
+
+
+<script type="text/javascript" src="<?php echo Dever::config("host")->script ?>lib/manage/main.js?v7"></script>

+ 5 - 4
journal/database/info.php

@@ -41,10 +41,10 @@ return array
 			'list'		=> true,
 		),
 
-  		'pic_list_cover'		=> array
+  		'pic_cover'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '列表封面图-4:3比例的图片',
+			'name' 		=> '列表封面图-4:3比例的图片',
 			'default' 	=> '',
 			'desc' 		=> '列表封面图',
 			'match' 	=> 'option',
@@ -53,7 +53,7 @@ return array
 			'place'		=> '150',
 		),
 
-		'pic_cover'		=> array
+		'pic_view_cover'		=> array
 		(
 			'type' 		=> 'varchar-150',
 			'name' 		=> '封面图-1:1比例的图片',
@@ -161,11 +161,12 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '发布时间',
-			'match' 	=> 'is_numeric',
+			'match' 	=> 'option',
 			'desc' 		=> '',
 			'update'	=> 'date',
 			'callback'	=> 'maketime',
 			'list'		=> 'date("Y-m-d H:i:s", {pdate})',
+			'auth'		=> '"{pdate}" > 0',
 		),
 
 		'udate'		=> array

+ 7 - 0
main/assets/html/preview/article.html

@@ -0,0 +1,7 @@
+<div id="test"></div>
+
+<div class="layui-container">
+  <div class="layui-row">
+    ……
+  </div>
+</div>

+ 1 - 0
main/assets/html/preview/journal.html

@@ -0,0 +1 @@
+journal.html

+ 1 - 0
main/assets/html/preview/live.html

@@ -0,0 +1 @@
+live.html

+ 1 - 0
main/assets/html/preview/vod.html

@@ -0,0 +1 @@
+video.html

+ 9 - 5
main/database/config.php

@@ -54,12 +54,16 @@ return array
 			'update'	=> 'textarea',
 		),
 
-  		'hr2'		=> array
+		'logo'		=> array
 		(
-			'name' 		=> '精选页设置',
-			'class'		=> '',//本项必须填写
-			'attr'		=> '',
-			//'right'		=> true,
+			'type' 		=> 'varchar-150',
+			'name' 		=> 'logo图片',
+			'default' 	=> '',
+			'desc' 		=> 'logo图片',
+			'match' 	=> 'option',
+			'update'	=> 'image',
+			'key' 		=> '1',
+			'place'		=> '150',
 		),
 
 		'cdate'		=> array

+ 26 - 0
main/lib/Core.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace Main\Lib;
+
+use Dever;
+
+class Core
+{
+    protected $data;
+    public function __construct()
+    {
+        # 获取用户信息
+        //$this->data['uid'] = Dever::load('passport/applet')->check();
+        $this->data['uid'] = 1;
+
+        # 获取基本配置
+        $this->data['config'] = Dever::db('main/config')->one();
+    }
+
+    protected function log()
+    {
+        $input = Dever::json_encode(Dever::input());
+        $url = Dever::url();
+        Dever::log($url . '||' . $input, 'request');
+    }
+}

+ 47 - 0
main/lib/Preview.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace Main\Lib;
+
+use Dever;
+
+class Preview
+{
+    public function article_api()
+    {
+        $id = Dever::input('id');
+
+        $data = Dever::load('content/lib/article')->get($id);
+    
+        return $data;
+
+    }
+
+    public function vod_api()
+    {
+        $id = Dever::input('id');
+
+        $data = Dever::load('content/lib/article')->get($id);
+    
+        return $data;
+
+    }
+
+    public function live_api()
+    {
+        $id = Dever::input('id');
+
+        $data = Dever::load('content/lib/article')->get($id);
+    
+        return $data;
+
+    }
+
+    public function journal_api()
+    {
+        $id = Dever::input('id');
+
+        $data = Dever::load('content/lib/article')->get($id);
+    
+        return $data;
+    }
+}

+ 17 - 0
main/src/Content.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace Main\Src;
+
+use Dever;
+use Main\Lib\Core;
+
+class Content extends Core
+{
+    # 首页精选
+    public function home()
+    {
+        
+    }
+
+    # 查看详情
+}

+ 14 - 0
main/template/preview/article.php

@@ -0,0 +1,14 @@
+<?php
+/*
+|--------------------------------------------------------------------------
+| 更新页
+|--------------------------------------------------------------------------
+*/
+
+$view
+
+# 配置按钮
+->fetch('#test','tt')   
+
+# display
+->display();

+ 2 - 0
tag/lib/Core.php

@@ -82,6 +82,8 @@ class Core
             $data = $insert + $yes + $data;
 
             $data = array_merge($data, array());
+        } else {
+            $data = $insert;
         }
 
         return $data;

+ 13 - 13
video/database/live.php

@@ -129,18 +129,6 @@ return array
 			//'list'		=> true,
 		),
 
-		'content'		=> array
-		(
-			'type' 		=> 'text-255',
-			'name' 		=> '内容介绍',
-			'default' 	=> '',
-			'desc' 		=> '请输入内容',
-			'match' 	=> 'is_string',
-			'update'	=> 'editor',
-			'key' 		=> 1,
-			'media'		=> 5,
-		),
-
 		'state'		=> array
 		(
 			'type' 		=> 'tinyint-1',
@@ -183,11 +171,12 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '发布时间',
-			'match' 	=> 'is_numeric',
+			'match' 	=> 'option',
 			'desc' 		=> '',
 			'update'	=> 'date',
 			'callback'	=> 'maketime',
 			'list'		=> 'date("Y-m-d H:i:s", {pdate})',
+			'auth'		=> '"{pdate}" > 0',
 		),
 
 		'share'		=> array
@@ -209,6 +198,17 @@ return array
 			'desc' 		=> '',
 		),
 
+		'content'		=> array
+		(
+			'type' 		=> 'text-255',
+			'name' 		=> '内容',
+			'default' 	=> '',
+			'desc' 		=> '请输入内容',
+			'match' 	=> 'is_string',
+			'update'	=> 'editor',
+			'key' 		=> 1,
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

+ 15 - 15
video/database/vod.php

@@ -70,8 +70,8 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '点播地址',
 			'match' 	=> 'option',
-			'update'	=> 'text',
-			'list'		=> true,
+			//'update'	=> 'text',
+			//'list'		=> true,
 		),
 
 		'video'		=> array
@@ -166,18 +166,6 @@ return array
 			//'list'		=> true,
 		),
 
-		'content'		=> array
-		(
-			'type' 		=> 'text-255',
-			'name' 		=> '内容',
-			'default' 	=> '',
-			'desc' 		=> '请输入内容',
-			'match' 	=> 'is_string',
-			'update'	=> 'editor',
-			'key' 		=> 1,
-			'media'		=> 5,
-		),
-
 		'state'		=> array
 		(
 			'type' 		=> 'tinyint-1',
@@ -209,11 +197,12 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '发布时间',
-			'match' 	=> 'is_numeric',
+			'match' 	=> 'option',
 			'desc' 		=> '',
 			'update'	=> 'date',
 			'callback'	=> 'maketime',
 			'list'		=> 'date("Y-m-d H:i:s", {pdate})',
+			'auth'		=> '"{pdate}" > 0',
 		),
 
 		'share'		=> array
@@ -235,6 +224,17 @@ return array
 			'desc' 		=> '',
 		),
 
+		'content'		=> array
+		(
+			'type' 		=> 'text-255',
+			'name' 		=> '内容',
+			'default' 	=> '',
+			'desc' 		=> '请输入内容',
+			'match' 	=> 'is_string',
+			'update'	=> 'editor',
+			'key' 		=> 1,
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

+ 9 - 4
video/lib/Core.php

@@ -11,9 +11,12 @@ class Core
         $data['file'] = Dever::db('video/vod')->list();
         $data['cate'] = Dever::db('content/cate')->state();
 
+
         if ($data['file']) {
         	foreach ($data['file'] as $k => $v) {
-
+                $data['file'][$k]['source_name'] = $v['name'];
+                $data['file'][$k]['file'] = $v['pic_cover'];
+                $data['file'][$k]['pic'] = $v['pic_cover'];
         	}
         }
 
@@ -27,9 +30,11 @@ class Core
         $data['cate'] = Dever::db('content/cate')->state();
 
         if ($data['file']) {
-        	foreach ($data['file'] as $k => $v) {
-				
-        	}
+            foreach ($data['file'] as $k => $v) {
+                $data['file'][$k]['source_name'] = $v['name'];
+                $data['file'][$k]['file'] = $v['pic_cover'];
+                $data['file'][$k]['pic'] = $v['pic_cover'];
+            }
         }
 
         return $data;