* Refactor getDataOfOpenedBugsPerDayTest.
This commit is contained in:
@@ -1907,7 +1907,7 @@ class bugModel extends model
|
||||
*/
|
||||
public function getDataOfOpenedBugsPerDay(): array
|
||||
{
|
||||
return $this->dao->select('DATE_FORMAT(openedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('name')->orderBy('openedDate')->fetchAll();
|
||||
return $this->dao->select('DATE_FORMAT(openedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('name')->orderBy('name')->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1631,23 +1631,19 @@ class bugTest
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计每天新增 bug 数。
|
||||
* Test get report data of opened bugs per day.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfOpenedBugsPerDayTest()
|
||||
public function getDataOfOpenedBugsPerDayTest(): array
|
||||
{
|
||||
$array = $this->objectModel->getDataOfOpenedBugsPerDay();
|
||||
$datas = $this->objectModel->getDataOfOpenedBugsPerDay();
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $array;
|
||||
}
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . "/test/lib/init.php"; su('admin');
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/bug.class.php';
|
||||
su('admin');
|
||||
|
||||
zdTable('bug')->gen(10);
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->getDataOfOpenedBugsPerDay();
|
||||
timeout=0
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取创建的数据 >> 23
|
||||
- 获取创建的数据第0条的value属性 @1
|
||||
|
||||
*/
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getDataOfOpenedBugsPerDayTest()) && p('0:value') && e('23'); // 获取创建的数据
|
||||
$bug = new bugTest();
|
||||
r($bug->getDataOfOpenedBugsPerDayTest()) && p('0:value') && e('1'); //获取创建的数据
|
||||
Reference in New Issue
Block a user