Пример #1
0
 public function actionBugFanKui()
 {
     $model = new KefuSelfservice();
     $cat = KefuSelfserviceCat::findOne(['slug' => 'bug-fan-kui']);
     $model->setAdditional();
     if ($model->load(\Yii::$app->request->post()) && $model->save()) {
         \Yii::$app->session->setFlash('success', '您的建议已成功提交,谢谢您在百忙之中抽出时间给我们建议,我们会尽快处理!');
         return $this->redirect(['selfservice-result']);
     } else {
         return $this->render('bug-fan-kui', ['model' => $model, 'cat' => $cat]);
     }
 }
 /**
  * Finds the KefuSelfserviceCat model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return KefuSelfserviceCat the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = KefuSelfserviceCat::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #3
0
		</div>
	</div>

	<div class="row">
		<div class="col-md-12">
			<div class="tag-box tag-box-v3">
				<div class="headline"><h3><?php 
echo $this->title;
?>
</h3></div>
				<?php 
$attachmentsImags = '';
foreach ($model->attachments as $ss) {
    $attachmentsImags .= Html::img(Yii::$app->glide->createSignedUrl(['glide/index', 'path' => $ss['path'], 'w' => 200], true), ['class' => 'img-responsive']);
}
?>
				<?php 
echo DetailView::widget(['model' => $model, 'attributes' => [['attribute' => 'category_id', 'value' => \common\models\KefuSelfserviceCat::findOne($model->category_id)['title']], 'sn', 'game_role', ['attribute' => 'game_server', 'value' => \common\models\GameServer::findOne($model->game_server)['server_name']], ['attribute' => 'attachments', 'format' => 'html', 'value' => $attachmentsImags], 'content:html', 'created_at:datetime', ['attribute' => 'status', 'value' => ArrayHelper::getValue(KefuSelfservice::getStatus(), $model->status)], ['attribute' => 'result', 'format' => 'html', 'headerOptions' => ['width' => '500px']]]]);
?>
			</div>
		</div>
	</div>
</div>


<?php 
$js = <<<JS
\$('.jie-guo').addClass('active');

JS;
$this->registerJs($js);
Пример #4
0
	<div class="row">
		<div class="col-md-12">
			<div class="tag-box tag-box-v3">
				<div class="headline"><h3><?php 
echo $this->title;
?>
</h3></div>
				<?php 
if (!Yii::$app->user->isGuest) {
    ?>
					<?php 
    echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'template' => '{view}', 'buttons' => ['view' => function ($url, $model, $key) {
        return Html::a('查看', $url);
    }]], 'sn', ['attribute' => 'category_id', 'value' => function ($dataProvider) {
        $cat = $dataProvider->category_id;
        return \common\models\KefuSelfserviceCat::findOne(['id' => $cat])['title'];
    }], 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => KefuSelfservice::getStatus()]], 'tableOptions' => ['class' => 'table table-bordered table-condensed table-hover table-striped', 'id' => 'index scroll'], 'layout' => "{items}\n{summary}\n{pager}"]);
    ?>
				<?php 
} else {
    ?>
					<?php 
    echo Html::tag('h5', '没有记录!');
    ?>
				<?php 
}
?>
			</div>
		</div>
	</div>
</div>