rabin 6 years ago
parent
commit
0cf4dcd58e
2 changed files with 20 additions and 2 deletions
  1. 15 0
      database/info.php
  2. 5 2
      src/Api.php

+ 15 - 0
database/info.php

@@ -131,6 +131,21 @@ return array
 
 	'request' => array
 	(
+		'getList' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				'column_id' => 'yes',
+				'info_id' => 'yes',
+				'id' => array('yes', '!='),
+				'state' => 1,
+			),
+			'type' => 'all',
+			'order' => array('reorder' => 'desc', 'id' => 'asc'),
+			'col' => '*',
+		),
+
 		'getAll' => array
 		(
 			# 匹配的正则或函数 选填项

+ 5 - 2
src/Api.php

@@ -107,13 +107,16 @@ class Api
      *
      * @return mixed
      */
-    public function getAll($column)
+    public function getAll($column, $cate = false)
     {
         $where = array();
         if ($column > 0) {
             $where['column_id'] = $column;
         }
-        $result = Dever::db('category/info')->state($where);
+        if ($cate) {
+            $where['info_id'] = $cate;
+        }
+        $result = Dever::db('category/info')->getList($where);
         return $result;
     }