コード例 #1
0
 public function getModel()
 {
     if (($model = KefuSelfservice::findOne($this->_id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException(Yii::t('common', 'The requested page does not exist.'));
     }
 }
コード例 #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = KefuSelfservice::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'category_id' => $this->category_id, 'game_server' => $this->game_server, 'user_id' => $this->user_id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'sn', $this->sn])->andFilterWhere(['like', 'game_role', $this->game_role])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'phone', $this->phone])->andFilterWhere(['like', 'result', $this->result])->andFilterWhere(['like', 'content', $this->content]);
     return $dataProvider;
 }
コード例 #3
0
ファイル: index.php プロジェクト: buuug7/game4039
	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<?php 
if (Yii::$app->user->can('administrator')) {
    ?>
		<p>
			<?php 
    echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Kefu Selfservice')]), ['create'], ['class' => 'btn btn-success']);
    ?>
		</p>
	<?php 
}
?>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'sn', ['attribute' => 'game_server', 'value' => function ($model) {
    return \common\models\GameServer::findOne($model->game_server)['server_name'];
}, 'filter' => ArrayHelper::map(\common\models\GameServer::find()->all(), 'id', 'server_name')], 'game_role', ['attribute' => 'category_id', 'value' => function ($model) {
    return $model->category ? $model->category->title : null;
}, 'filter' => ArrayHelper::map(\common\models\KefuSelfserviceCat::find()->all(), 'id', 'title')], 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => KefuSelfservice::getStatus()], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update} {result} {delete}', 'buttons' => ['result' => function ($url, $model, $key) {
    if ($model->status == KefuSelfservice::STATUS_YICHULI) {
        return "";
    }
    return Html::a('<span class="glyphicon glyphicon-check"></span>', ['/kefu-selfservice/result', 'id' => $model->id], ['title' => Yii::t('common', 'check'), 'id' => 'check' . $model->id]);
}]]]]);
?>

</div>
コード例 #4
0
ファイル: KefuController.php プロジェクト: buuug7/game4039
 public function actionView($id)
 {
     return $this->render('selfservice-view', ['model' => KefuSelfservice::findOne(['id' => $id])]);
 }
コード例 #5
0
ファイル: view.php プロジェクト: buuug7/game4039
use yii\helpers\ArrayHelper;
use common\models\KefuSelfservice;
/* @var $this yii\web\View */
/* @var $model common\models\KefuSelfservice */
$this->title = $model->sn;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'Kefu Selfservice'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="kefu-selfservice-view">

	<p>
		<?php 
echo Html::a(Yii::t('common', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
		<?php 
echo Html::a(Yii::t('common', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('common', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
	</p>

	<?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' => ['sn', ['attribute' => 'category_id', 'value' => $model->category ? $model->category->title : null], 'game_role', ['attribute' => 'game_server', 'value' => $model->gameServer ? $model->gameServer->server_name : null], 'email:email', 'phone', ['attribute' => 'attachments', 'format' => 'html', 'value' => $attachmentsImags], 'content:ntext', ['attribute' => 'user_id', 'value' => $model->user ? $model->user->username : null], 'created_at:datetime', 'updated_at:datetime', ['attribute' => 'status', 'value' => ArrayHelper::getValue(KefuSelfservice::getStatus(), $model->status)], ['attribute' => 'result', 'format' => 'html', 'value' => "<div style='color:red;font-size:1.25em;'>" . $model->result . "</div>"]]]);
?>

</div>
コード例 #6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSelfservice()
 {
     return $this->hasOne(KefuSelfservice::className(), ['id' => 'selfservice_id']);
 }
コード例 #7
0
 /**
  * Finds the KefuSelfservice model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return KefuSelfservice the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = KefuSelfservice::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getKefuSelfservices()
 {
     return $this->hasMany(KefuSelfservice::className(), ['category_id' => 'id']);
 }
コード例 #9
0
ファイル: selfservice-view.php プロジェクト: buuug7/game4039
		</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);
コード例 #10
0
ファイル: check.php プロジェクト: buuug7/game4039
<!--处理结果-->
<div class="box box-info">
	<div class="box-header with-border">
		<h3 class="box-title">审核前台提交的自助服务</h3>
	</div>
	<!-- /.box-header -->
	<!-- form start -->
	<?php 
$form = \kartik\widgets\ActiveForm::begin([]);
?>
	<div class="box-body">
		<?php 
echo $form->field($modelCheckForm, 'result')->textarea(['rows' => 6]);
?>
		<?php 
echo $form->field($modelCheckForm, 'status')->dropDownList(KefuSelfservice::getStatus());
?>
	</div>
	<div class="box-footer">
		<?php 
echo Html::submitButton(Yii::t('common', 'Submit'), ['class' => 'btn btn-info']);
?>
	</div>
	<?php 
\kartik\widgets\ActiveForm::end();
?>
</div>


<!--详情-->
<div class="box box-info" style="margin-top: 150px;">
コード例 #11
0
		<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>