Beispiel #1
0
 public function searchDayBar($month, $year)
 {
     $arr = array();
     $data = array();
     for ($i = 1; $i <= 31; $i++) {
         $cnt = Sitecounter::find()->where(['module' => 'site'])->andWhere(['DAY(datetime)' => $i])->andWhere(['MONTH(datetime)' => $month])->andWhere(['YEAR(datetime)' => $year])->count();
         $data[] = (int) $cnt;
     }
     $arr[] = array('name' => 'จำนวน', 'data' => $data);
     return $arr;
 }
Beispiel #2
0
 public function getTotalCounter()
 {
     $query = Sitecounter::find()->where(['module' => 'site']);
     $cnt = $query->count();
     return $cnt;
 }