示例#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]);
 }