dever 3 years ago
parent
commit
86d385b768
3 changed files with 32 additions and 27 deletions
  1. 17 13
      database/info.php
  2. 6 5
      database/project.php
  3. 9 9
      src/Api.php

+ 17 - 13
database/info.php

@@ -1,9 +1,9 @@
 <?php
 
-$column = function()
+$project = function()
 {
 	$array = array();
-	$info = Dever::load('category/column-state');
+	$info = Dever::load('category/project-state');
 	if($info)
 	{
 		$array += $info;
@@ -86,16 +86,16 @@ return array
 			//'list'		=> 'Dever::load("category/api.string", "{info}")',
 		),
 
-		'column_id'		=> array
+		'project_id'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '选择栏目',
-			'default' 	=> Dever::input('option_column_id', 1),
-			'desc' 		=> '选择栏目',
+			'name' 		=> '所属项目',
+			'default' 	=> Dever::input('option_project_id', 1),
+			'desc' 		=> '所属项目',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'select',
-			'option'	=> $column,
-			'list'		=> '{column_id} > 0 ? Dever::load("category/column-one#name", {column_id}) : "未选择"',
+			'option'	=> $project,
+			'list'		=> '{project_id} > 0 ? Dever::load("category/project-one#name", {project_id}) : "未选择"',
 			'edit'		=> true,
 		),
 
@@ -211,11 +211,15 @@ return array
 
 	'manage' => array
 	(
+		'button' => array
+        (
+        	'项目管理' => array('list', 'project&oper_parent=info&oper_project=category'),
+        ),
 		# 列表页的类型
 		'list_type' => 'tree',
 		'list_button' => array
 		(
-			'add' => array('新增子分类', '"{info}" == -1 ? "info&option_info={id}&option_column_id={column_id}" : "info&option_info={info},{id}&option_column_id={column_id}"'),
+			'add' => array('新增子分类', '"{info}" == -1 ? "info&option_info={id}&option_project_id={project_id}" : "info&option_info={info},{id}&option_project_id={project_id}"'),
 		),
 	),
 
@@ -227,7 +231,7 @@ return array
 			# 匹配的正则或函数 选填项
 			'option' => array
 			(
-				'column_id' => 'yes',
+				'project_id' => 'yes',
 				'info_id' => -1,
 				'state' => 1,
 			),
@@ -241,7 +245,7 @@ return array
 			# 匹配的正则或函数 选填项
 			'option' => array
 			(
-				'column_id' => 'yes',
+				'project_id' => 'yes',
 				'info_id' => 'yes',
 				'top_id' => 'yes',
 				'level' => 'yes',
@@ -260,7 +264,7 @@ return array
 			# 匹配的正则或函数 选填项
 			'option' => array
 			(
-				'column_id' => 'yes',
+				'project_id' => 'yes',
 				'info_id' => 'yes',
 				'top_id' => 'yes',
 				'level' => 'yes',
@@ -279,7 +283,7 @@ return array
 			# 匹配的正则或函数 选填项
 			'option' => array
 			(
-				'column_id' => 'yes',
+				'project_id' => 'yes',
 				'info_id' => 'yes',
 				'id' => array('yes', '!='),
 				'state' => 1,

+ 6 - 5
database/column.php → database/project.php

@@ -3,11 +3,12 @@
 return array
 (
 	# 表名
-	'name' => 'column',
+	'name' => 'project',
 	# 显示给用户看的名称
-	'lang' => '目管理',
+	'lang' => '目管理',
 	# 是否显示在后台菜单
 	'order' => 9,
+	'menu' => false,
 
 	# 数据结构
 	'struct' => array
@@ -26,9 +27,9 @@ return array
 		'name'		=> array
 		(
 			'type' 		=> 'varchar-150',
-			'name' 		=> '目名称',
+			'name' 		=> '目名称',
 			'default' 	=> '',
-			'desc' 		=> '目名称',
+			'desc' 		=> '目名称',
 			'match' 	=> 'is_string',
 			'update'	=> 'text',
 			'search'	=> 'fulltext',
@@ -84,7 +85,7 @@ return array
 		'col' => 'name,state,cdate',
 		'value' => array
 		(
-			'"默认目",1,' . time(),
+			'"默认目",1,' . time(),
 		),
 	),
 

+ 9 - 9
src/Api.php

@@ -25,9 +25,9 @@ class Api
      */
     public function get()
     {
-        $column = Dever::input('column');
-        if ($column > 0) {
-            $where['column_id'] = $column;
+        $project = Dever::input('project');
+        if ($project > 0) {
+            $where['project_id'] = $project;
         }
 
         # 联动总数
@@ -107,11 +107,11 @@ class Api
      *
      * @return mixed
      */
-    public function getTop($column = false)
+    public function getTop($project = false)
     {
         $where = array();
-        if ($column > 0) {
-            $where['column_id'] = $column;
+        if ($project > 0) {
+            $where['project_id'] = $project;
         }
         $result = Dever::db('category/info')->getTop($where);
         return $result;
@@ -122,11 +122,11 @@ class Api
      *
      * @return mixed
      */
-    public function getAll($column, $cate = false)
+    public function getAll($project, $cate = false)
     {
         $where = array();
-        if ($column > 0) {
-            $where['column_id'] = $column;
+        if ($project > 0) {
+            $where['project_id'] = $project;
         }
         if ($cate) {
             $where['info_id'] = $cate;