예제 #1
0
 public function getFreeRandomObjreservation()
 {
     $today = new DateTime();
     //        echo Yii::info($today->format('Y-m-d H:i:s'));
     //        ['reservationinfo.date_begin' => $today->format('Y-m-d H:i:s')]
     return $query = Objreservation::find()->select('objreservation.*')->leftJoin('reservationinfo', 'objreservation.id = reservationinfo.objreservation_id')->where(['<=', 'reservationinfo.date_begin', $today->format('Y-m-d H:i:s')])->limit(3)->all();
 }