dever 5 vuotta sitten
vanhempi
commit
708a5e7298

+ 1 - 1
app/collection/database/content.php

@@ -73,7 +73,7 @@ return array
             'default'   => '',
             'desc'      => '章节',
             'match'     => 'is_numeric',
-            'update'    => 'text',
+            'update'    => 'hidden',
             'value'     => Dever::input('send_page_id')
         ),
 

+ 8 - 7
app/collection/database/page.php

@@ -56,14 +56,14 @@ return array
 			'desc' 		=> '请选择上级章节',
 			'match' 	=> 'is_numeric',
 			'update'	=> 'hidden',
-			'value'		=> Dever::input('search_option_page_id', -1),
+			'value'		=> Dever::input('option_page_id', -1),
 			'list'		=> '{page_id} > 0 ? Dever::load("collection/page-one#name", {page_id}) : "主章节"',
 		),
 
 		'reorder'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '排序(数值越越靠前)',
+			'name' 		=> '排序(数值越越靠前)',
 			'default' 	=> '1',
 			'desc' 		=> '请输入排序',
 			'match' 	=> 'option',
@@ -71,7 +71,7 @@ return array
 			'search'	=> 'order',
 			'list_name' => '排序',
 			'list'		=> true,
-			'order'		=> 'desc',
+			'order'		=> 'asc',
 			'edit'		=> true,
 		),
 		
@@ -92,6 +92,7 @@ return array
 			'desc' 		=> '',
 			# 只有insert时才生效
 			'insert'	=> true,
+			'order'		=> 'asc',
 			'search'	=> 'date',
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),
@@ -104,7 +105,7 @@ return array
 		'list_button' => array
 		(
 			'update' => '编辑',
-			'add' => array('新增子章节', '"{page_id}" == -1 ? "page&search_option_page_id={id}" : "page&search_option_page_id={page_id},{id}"', '{page_id} == -1'),
+			'add' => array('新增子章节', '"{page_id}" == -1 ? "page&option_page_id={id}" : "page&option_page_id={page_id},{id}"', '{page_id} == -1'),
 
 			'list' => array('内容管理', '"content&search_option_info_id={info_id}&send_page_id={id}&oper_table=page&top_table=info&top_project=collection&page_type=1"' , '{page_id} > 0'),
 			'delete' => '删除',
@@ -122,8 +123,8 @@ return array
 				'info_id' => 'yes',
 			),
 			'type' => 'all',
-			'order' => array('reorder' => 'desc', 'id' => 'desc'),
-			'col' => '*|page_id|',
+			'order' => array('reorder' => 'asc', 'id' => 'asc'),
+			'col' => '*',
 		),
 		
 		'main' => array
@@ -135,7 +136,7 @@ return array
 				'info_id' => 'yes',
 			),
 			'type' => 'all',
-			'order' => array('reorder' => 'desc', 'id' => 'desc'),
+			'order' => array('reorder' => 'asc', 'id' => 'asc'),
 			'col' => '*',
 		),
 	)

+ 1 - 0
app/collection/lib/Manage.php

@@ -150,6 +150,7 @@ class Manage
     public function content()
     {
         $where['info_id'] = Dever::input('search_option_info_id');
+        $where['page_id'] = Dever::input('send_page_id');
         $where['state'] = Dever::input('search_option_state');
         $data = Dever::db('collection/content')->all($where);
 

+ 9 - 9
app/collection/src/Api.php

@@ -38,16 +38,16 @@ class Api
         $where['info_id'] = Dever::input('id');
         $data['cate'] = Dever::db('collection/page')->main($where);
         if ($data['cate']) {
-            $child = Dever::db('collection/page')->child($where);
+            $data['child'] = Dever::db('collection/page')->child($where);
             $content = Dever::db('collection/content')->child($where);
-            foreach ($data['cate'] as $k => $v) {
-                if (isset($child[$v['id']])) {
-                    $data['cate'][$k]['child'] = $child[$v['id']];
-                    foreach ($data['cate'][$k]['child'] as $k1 => $v1) {
-                        if (isset($content[$v1['id']])) {
-                            $data['cate'][$k]['child'][$k1]['content'] = $content[$v1['id']];
-                        }
-                    }
+            foreach ($data['child'] as $k => $v) {
+                if ($k == 0) {
+                    $data['child'][$k]['show'] = 1;
+                } else {
+                    $data['child'][$k]['show'] = 2;
+                }
+                if (isset($content[$v['id']])) {
+                    $data['child'][$k]['content'] = $content[$v['id']];
                 }
             }
         }