예제 #1
0
파일: Staff.php 프로젝트: simplator/staff
 public function validateStructID($attribute, $params)
 {
     $tree = Yii::$app->settings->get('staff.tree');
     $struct = Structure::find()->where(['id' => $this->{$attribute}, 'tree' => $tree])->one();
     if ($struct) {
         $this->orgid = $struct->tree;
     } else {
         $this->addError('structid', Module::t('staff', 'Structure not found'));
     }
 }
예제 #2
0
 /**
  * Lists all Structure models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Structure::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }
예제 #3
0
 /**
  * Lists all Structure models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Structure::find()->where(['tree' => Yii::$app->settings->get('staff.tree')])]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }