public function getStationCountKids() { $stations = Stations::find()->where(['id_city' => $this->id_city])->all(); $result = 0; foreach ($stations as $stat) { $result += $stat->countKidsNow; } return $result; }
public function actionIndex() { $lst = Lines::find()->where([RECORD_STATUS => STATUS_NORMAL])->orderBy(NAME)->all(); $lstStation = []; if (count($lst) > 0) { foreach ($lst as $item) { $stations = Stations::find()->where([LINE_ID => $item->id, RECORD_STATUS => STATUS_NORMAL])->all(); if (count($stations) > 0) { array_push($lstStation, ['line' => $item, 'stations' => $stations]); } } } return $this->render('index', ['listLine' => $lst, 'listStation' => $lstStation]); }
function actionGetStations() { $id_city = $this->get["id_city"]; $city = City::findOne(['id' => $id_city]); if (count($city) == 0) { $r = $this->setError(150); } else { $stations = Stations::find()->where("id_city='" . $id_city . "' ")->asArray()->all(); $r["status"] = "ok"; $r["stations"] = $stations; } return json_encode($r); }
public function actionIndex() { $lst = Stations::find()->where([RECORD_STATUS => STATUS_NORMAL])->orderBy(NAME)->all(); return $this->render('index', ['listLine' => $lst]); }
public function getStationList() { $allStations = Stations::find()->asArray()->orderBy("p_nom DESC")->all(); return $allStations; // arrayHelper::map($allStations, 'p_nom', 'kod_stan','name_stan','vr_ch','vr_n','rast_ch','ot','kput','podhod','kod_uchast','k_dor','kod_otd','pr_kn_uch','pr_dop_puti'); }