lgy 1 month ago
parent
commit
d0e4de2318
1 changed files with 9 additions and 9 deletions
  1. 9 9
      jcjyhr/app/admin/servies/bi/BaseDataBiServies.php

+ 9 - 9
jcjyhr/app/admin/servies/bi/BaseDataBiServies.php

@@ -4,6 +4,8 @@ declare (strict_types=1);
 namespace app\admin\servies\bi;
 namespace app\admin\servies\bi;
 
 
 
 
+use app\zskk\model\ExamReport;
+
 abstract class BaseDataBiServies
 abstract class BaseDataBiServies
 {
 {
     /**
     /**
@@ -234,14 +236,12 @@ abstract class BaseDataBiServies
      * 单日新增	本月每日上传报告的患者数量,日历图
      * 单日新增	本月每日上传报告的患者数量,日历图
      */
      */
     public function _getMonthDayData($where = false) {
     public function _getMonthDayData($where = false) {
-        var_dump($where);
-        var_dump($this->timeFieldName);
-        $days = $this->baseModel
-        ->field("count($this->countField) AS count, date_format($this->timeFieldName, '%Y%m%d') AS day")
+        $days = ExamReport::
+        field("count($this->countField) AS count, TO_CHAR($this->timeFieldName, 'YYYYMMDD') AS day")
         ->where($where)
         ->where($where)
         ->whereMonth($this->timeFieldName)
         ->whereMonth($this->timeFieldName)
-        ->group(date_format($this->timeFieldName, '%Y%m%d'))
-        ->order(date_format($this->timeFieldName, '%Y%m%d'), 'asc')
+        ->group(TO_CHAR($this->timeFieldName, 'YYYYMMDD'))
+        ->order(TO_CHAR($this->timeFieldName, 'YYYYMMDD'), 'asc')
         ->buildSql();
         ->buildSql();
         var_dump($days);die;
         var_dump($days);die;
         return $days;
         return $days;
@@ -277,11 +277,11 @@ abstract class BaseDataBiServies
     */
     */
     public function _getWeekDayData($where = false) {
     public function _getWeekDayData($where = false) {
         $days = $this->baseModel
         $days = $this->baseModel
-        ->field('count('.$this->countField.') AS count, date_format('.$this->timeFieldName.', "%Y%m%d") AS day')
+        ->field("count($this->countField) AS count, date_format($this->timeFieldName, '%Y%m%d') AS day")
         ->where($where)
         ->where($where)
         ->whereWeek($this->timeFieldName)
         ->whereWeek($this->timeFieldName)
-        ->group(date_format($this->timeFieldName, "%Y%m%d"))
-        ->order(date_format($this->timeFieldName, "%Y%m%d"), 'asc')
+        ->group(date_format($this->timeFieldName, '%Y%m%d'))
+        ->order(date_format($this->timeFieldName, '%Y%m%d'), 'asc')
         ->select()
         ->select()
         ->toArray();
         ->toArray();
         return $days;
         return $days;