Exemplo n.º 1
0
 /**
  * Lists all ServiceBaseInfo models.
  * @return mixed
  */
 public function actionIndex()
 {
     $num = 10;
     $this->layout = 'index';
     $searchModel = new ServiceBaseInfoSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $num);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
 /**
  * 服务配置
  */
 public function actionServiceSetting()
 {
     $this->layout = 'index';
     $get = Yii::$app->request->get();
     if (empty($get['id'])) {
         return $this->redirect(['index']);
     }
     $id = $get['id'];
     if (empty($get['serviceId'])) {
         return $this->redirect(['binding-service-view', 'id' => $id]);
     }
     $serviceId = $get['serviceId'];
     $appModel = $this->findModel($id);
     $services = ServiceBaseInfoSearch::getServicesNameId();
     if ($services) {
         foreach ($services as $service) {
             $sers[$service['service_id']] = $service['service_name'];
         }
     }
     if (!$appModel) {
         return $this->redirect(['binding-service-view', 'id' => $id]);
     }
     $sso = SsoSettingInfo::findByAppId($appModel->app_id);
     // echo '<pre>';
     // var_dump($sso);die;
     if ($sso) {
         if (!empty($get['error'])) {
             return $this->render('setting', ['serviceId' => $serviceId, 'appModel' => $appModel, 'sers' => $sers, 'sso' => $sso, 'error' => $get['error']]);
         }
         return $this->render('setting', ['serviceId' => $serviceId, 'appModel' => $appModel, 'sers' => $sers, 'sso' => $sso]);
     } else {
         if (!empty($get['error'])) {
             return $this->render('setting', ['serviceId' => $serviceId, 'appModel' => $appModel, 'sers' => $sers, 'error' => $get['error']]);
         }
         return $this->render('setting', ['serviceId' => $serviceId, 'appModel' => $appModel, 'sers' => $sers]);
     }
 }