lgy 2 tuần trước cách đây
mục cha
commit
d6e1077a89
1 tập tin đã thay đổi với 7 bổ sung5 xóa
  1. 7 5
      jcjyhr/app/admin/servies/bi/BaseDataBiServies.php

+ 7 - 5
jcjyhr/app/admin/servies/bi/BaseDataBiServies.php

@@ -31,6 +31,7 @@ abstract class BaseDataBiServies
         return $this->_getCommonWhere($params, $this->timeFieldName);
     }
     protected function _getCommonWhere($params, $timeName) {
+        var_dump($params);
         $where = false;
         $ORGNAME = $params['ORGNAME'] ?? false;
         $start = $params['start'] ?? false;
@@ -55,6 +56,7 @@ abstract class BaseDataBiServies
                 $where = [$_where];
             }
         }
+        var_dump($where);die;
         return $where;
     }    
 
@@ -235,13 +237,13 @@ abstract class BaseDataBiServies
      */
     public function _getMonthDayData($where = false) {
         $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)
         ->whereMonth($this->timeFieldName)
-        ->group(date_format($this->timeFieldName, "%Y%m%d"))
-        ->order(date_format($this->timeFieldName, "%Y%m%d"), 'asc')
-        ->buildSql();
-        var_dump($days);die;
+        ->group(date_format($this->timeFieldName, '%Y%m%d'))
+        ->order(date_format($this->timeFieldName, '%Y%m%d'), 'asc')
+        ->select()
+        ->toArray();
         return $days;
     }