public function obtenTimeAgenda($groupid, $professor)
 {
     $retorno = array();
     $retorno['agenda'] = Acdschedule::find()->joinWith(['acdscheduleprofessors'])->andwhere(['groupid' => $groupid])->andwhere(['acdscheduleprofessor.professorid' => $professor])->orderBy('groupid')->all();
     $times = array();
     foreach ($retorno['agenda'] as $str) {
         $str->timeids = str_replace('{', '', $str->timeids);
         $str->timeids = str_replace('}', '', $str->timeids);
         $timeAux = split(',', $str->timeids);
         $times = array_merge($times, $timeAux);
     }
     $retorno['timeData'] = Acdtime::find()->where(['in', 'timeid', $times])->all();
     return $retorno;
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAcdschedules()
 {
     return $this->hasMany(Acdschedule::className(), ['groupid' => 'groupid']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSchedule()
 {
     return $this->hasOne(Acdschedule::className(), ['scheduleid' => 'scheduleid']);
 }