dever 2 years ago
parent
commit
84f104e819
2 changed files with 20 additions and 3 deletions
  1. 18 1
      database/inbox.php
  2. 2 2
      lib/Data.php

+ 18 - 1
database/inbox.php

@@ -205,6 +205,23 @@ return array
 	# request 请求接口定义
 	'request' => array
 	(
+		# 获取总数
+		'total' => array
+		(
+			# 匹配的正则或函数 选填项
+			'option' => array
+			(
+				//'name' => array('yes', 'like'),
+				'uid' => 'yes',
+				'project_id' => 'yes',
+				'type' => array('yes', 'in'),
+				'status' => 'yes',
+				'state' => 1,
+			),
+			'type' => 'count',
+			'col' => 'count(1) as total',
+		),
+
 		# 获取列表页
 		'getAll' => array
 		(
@@ -214,7 +231,7 @@ return array
 				//'name' => array('yes', 'like'),
 				'uid' => 'yes',
 				'project_id' => 'yes',
-				'type' => 'yes',
+				'type' => array('yes', 'in'),
 				'status' => 'yes',
 				'state' => 1,
 			),

+ 2 - 2
lib/Data.php

@@ -84,9 +84,9 @@ class Data
      * 
      * @return mixed
      */
-    public function num($uid, $project = 1)
+    public function num($uid, $project = 1, $type = false)
     {
-        return $this->read($uid, false, false, 1, $project);
+        return $this->read($uid, $type, false, 1, $project);
     }
 
     /**