Esempio n. 1
0
 public static function getRecords($date, $specialist_id)
 {
     $month = date('m', $date);
     $year = date('Y', $date);
     $day = date('j', $date);
     $start = $year . '-' . $month . '-' . $day;
     $sql = 'SELECT * FROM `records` WHERE DATE(`start_time`) = "' . $start . '" AND `specialist_id` = "' . $specialist_id . '" ';
     $sql .= 'AND `reserved` = false ORDER BY `start_time`';
     $result = Records::findBySql($sql)->all();
     return $result;
 }
Esempio n. 2
0
 public function actionGetD($id)
 {
     $sql = 'SELECT `dc`.`start_time`, `dc`.`end_time` FROM `specialists` as `sp`, `doctors` as `dc` WHERE `sp`.`id` = "' . $id . '" AND `sp`.`doctor_id` =  `dc`.`id`';
     $result = Records::findBySql($sql)->one();
     echo Json::encode($result);
 }