D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
epaji.com
/
public_html
/
hindiusa
/
components
/
Filename :
AppHelper.php
back
Copy
<?php namespace app\components; use Yii; use yii\helpers\Html; use yii\helpers\Url; use app\models\Schools; use app\models\ExtraPages; class AppHelper { // to get particular school data public static function getSchoolData($url){ $model = new Schools(); $model = Schools::find()->where(['url'=>$url])->one(); return $model; } // to get school list public static function getSchoolList(){ $model = new Schools(); $model = Schools::find() ->select(['url','name']) ->where(['status'=>1]) ->andWhere(['<>','url','/']) ->orderBy(['name'=>SORT_ASC]) ->all(); return $model; } // to get school id on the basis of current login user public static function getSchoolId($user_id){ $model = new Schools(); $model = Schools::find() ->select(['id']) ->where(['user_id'=>$user_id]) ->one(); return $model->id; } // to get particular school extra Pages public static function getExtraPages($id){ $model = new ExtraPages(); $model = ExtraPages::find()->where(['school_id'=>$id,'status'=>1])->all(); return $model; } }