dever 6 年 前
コミット
0ea29462ee

+ 17 - 0
audit/database/data.php

@@ -4,6 +4,8 @@ $type = Dever::config('base')->type;
 
 $audit = Dever::config('base')->audit;
 
+$status = Dever::config('base')->status;
+
 return array
 (
 	# 表名
@@ -16,6 +18,7 @@ return array
 	'end' => array
 	(
 		'update_audit' => 'audit/lib/core.audit',
+		'update_status' => 'audit/lib/core.status',
 	),
 	# 数据结构
 	'struct' => array
@@ -83,6 +86,20 @@ return array
 			'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,
+		),
 		
 		'pdate'		=> array
 		(

+ 14 - 0
audit/lib/Core.php

@@ -19,4 +19,18 @@ class Core
             Dever::db($table)->update(array('where_id' => $info['data_id'], 'audit' => $audit));
         }
     }
+
+    public function status($id, $name, $data)
+    {
+        $status = Dever::param('status', $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['status'] != $status) {
+            Dever::config('base')->after = false;
+            Dever::db($table)->update(array('where_id' => $info['data_id'], 'status' => $status));
+        }
+    }
 }

+ 7 - 0
config/base.php

@@ -39,6 +39,13 @@ $config['base'] = array
 		3 => '审核未通过',
 	),
 
+	# 上线状态
+	'status' => array
+	(
+		1 => '未上线',
+		2 => '上线发布',
+	),
+
 	# 产品表设置 主要给survey使用
 	'product' => 'service/product',
 

+ 18 - 2
content/database/article.php

@@ -2,6 +2,8 @@
 
 $audit = Dever::config('base')->audit;
 
+$status = Dever::config('base')->status;
+
 $function = Dever::config('base')->function;
 
 # 每页的数据量
@@ -62,7 +64,7 @@ return array
 			# 更新另外一个表的字段 => 本表的字段
 			'where' => array('data_id' => 'id', 'type' => 1),
 			# 要更新的数据
-			'update' => array('data_id' => 'id', 'type' => 1, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit'),
+			'update' => array('data_id' => 'id', 'type' => 1, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit', 'status' => 'status'),
 		)
 	),
 
@@ -81,7 +83,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 		
 		'name'		=> array
@@ -388,6 +390,20 @@ return array
 			'edit'		=> true,
 		),
 
+		'status'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '上线状态',
+			'default' 	=> '1',
+			'desc' 		=> '上线状态',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $status,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

+ 17 - 7
journal/database/info.php

@@ -2,11 +2,7 @@
 
 $audit = Dever::config('base')->audit;
 
-$audit = array
-(
-	1 => '未上线',
-	2 => '上线发布',
-);
+$status = Dever::config('base')->status;
 
 $share = function()
 {
@@ -57,7 +53,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 
 		'name'		=> array
@@ -206,12 +202,26 @@ return array
 		'audit'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '上线状态',
+			'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,

+ 17 - 2
video/database/live.php

@@ -2,6 +2,7 @@
 
 $page = 15;
 $audit = Dever::config('base')->audit;
+$status = Dever::config('base')->status;
 $function = Dever::config('base')->function;
 $share = function()
 {
@@ -62,7 +63,7 @@ return array
 			# 更新另外一个表的字段 => 本表的字段
 			'where' => array('data_id' => 'id', 'type' => 3),
 			# 要更新的数据
-			'update' => array('data_id' => 'id', 'type' => 3, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit'),
+			'update' => array('data_id' => 'id', 'type' => 3, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit', 'status' => 'status'),
 		)
 	),
 	# 数据结构
@@ -75,7 +76,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 		
 		'name'		=> array
@@ -380,6 +381,20 @@ return array
 			'edit'		=> true,
 		),
 
+		'status'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '上线状态',
+			'default' 	=> '1',
+			'desc' 		=> '上线状态',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $status,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',

+ 17 - 2
video/database/vod.php

@@ -1,6 +1,7 @@
 <?php
 $page = 15;
 $audit = Dever::config('base')->audit;
+$status = Dever::config('base')->status;
 $function = Dever::config('base')->function;
 $cate = function()
 {
@@ -61,7 +62,7 @@ return array
 			# 更新另外一个表的字段 => 本表的字段
 			'where' => array('data_id' => 'id', 'type' => 2),
 			# 要更新的数据
-			'update' => array('data_id' => 'id', 'type' => 2, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit'),
+			'update' => array('data_id' => 'id', 'type' => 2, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit', 'status' => 'status'),
 		)
 	),
 	# 数据结构
@@ -74,7 +75,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 		
 		'name'		=> array
@@ -370,6 +371,20 @@ return array
 			'edit'		=> true,
 		),
 
+		'status'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '上线状态',
+			'default' 	=> '1',
+			'desc' 		=> '上线状态',
+			'match' 	=> 'is_numeric',
+			//'update'	=> 'select',
+			'option'	=> $status,
+			'search'	=> 'select',
+			'list'		=> true,
+			'edit'		=> true,
+		),
+
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',