@@ -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',
'status' => 'yes',
'state' => 1,
),
@@ -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);
}
/**