Example #1
0
<?php

/* @var $this yii\web\View */
use backend\models\TraceLogSearch;
use yii\grid\GridView;
use yii\widgets\Pjax;
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
$this->title = '日志列表';
#获得日志统计记录
$params = \Yii::$app->request->queryParams;
$searchModel = new TraceLogSearch();
$dataProvider = $searchModel->search($params);
?>
<div class="site-index">
    <?php 
echo Breadcrumbs::widget(['itemTemplate' => "<li><i>{link}</i></li>\n", 'links' => [['label' => '首页']]]);
?>

    <div class="body-content">
        <div class="panel panel-default">
            <?php 
echo $this->render('common_top.php');
?>
            <div class="panel-body">
                <?php 
Pjax::begin(['id' => 'countries']);
?>
                <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['style' => 'width:80px;']], ['attribute' => 'ApplicationName', 'label' => '类型', 'value' => function ($model) {
    return Html::encode($model->ApplicationId);
Example #2
0
    }
    ?>
                        });
                    </script>
                    <?php 
    echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'ApplicationName', 'label' => '类型', 'value' => function ($model) {
        return Html::encode($model->ApplicationName);
    }], ['attribute' => 'Method', 'label' => '函数', 'value' => function ($model) {
        return Html::encode($model->Method);
    }], ['attribute' => 'Parameter', 'label' => '参数', 'value' => function ($model) {
        return Html::encode($model->Parameter);
    }], ['attribute' => 'Content', 'label' => '详情', 'headerOptions' => ['class' => 'maxwidth'], 'value' => function ($model) {
        return Html::encode($model->Content);
    }], ['attribute' => 'start_date', 'label' => '开始时间', 'value' => 'AddDate', 'filter' => \yii\jui\DatePicker::widget(['model' => $searchModel, 'attribute' => 'start_date', 'language' => 'zh-CN', 'dateFormat' => 'yyyy-MM-dd']), 'format' => 'html'], ['attribute' => 'end_date', 'label' => '结束时间', 'value' => 'AddDate', 'filter' => \yii\jui\DatePicker::widget(['model' => $searchModel, 'attribute' => 'end_date', 'language' => 'zh-CN', 'dateFormat' => 'yyyy-MM-dd', 'value' => date('Y-m-d')]), 'format' => 'html']]]);
} else {
    $searchModel = new TraceLogSearch();
    $dataProvider = $searchModel->search($params);
    ?>
                    <script type="text/javascript">
                        $(document).ready(function() {
    <?php 
    if (isset($params['TraceLogSearch']['start_date']) && !empty($params['TraceLogSearch']['start_date'])) {
        ?>
                                $("#tracelogsearch-start_date").val("<?php 
        echo $params['TraceLogSearch']['start_date'];
        ?>
");
        <?php 
    }
    if (isset($params['TraceLogSearch']['end_date']) && !empty($params['TraceLogSearch']['end_date'])) {
        ?>
Example #3
0
use yii\grid\GridView;
use yii\widgets\Pjax;
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use dosamigos\datetimepicker\DateTimePicker;
$this->title = '日志列表';
#获得日志统计记录
$params = \Yii::$app->request->queryParams;
//月首
$month_info['str_time'] = date('Y-m-d 00:00:00');
//月尾
$month_info['end_time'] = date('Y-m-d', strtotime($month_info['str_time'] . " +1 day"));
$searchModel = new TraceLogSearch();
$applicationName = new \common\models\ApplicateName();
$category = $applicationName->find()->select('appname')->where(['logtype' => 1])->asArray()->all();
$category = ArrayHelper::map($category, 'appname', 'appname');
$dataProvider = $searchModel->search($params);
$searchModel->start_date = empty($searchModel->start_date) ? $month_info['str_time'] : $searchModel->start_date;
$searchModel->end_date = empty($searchModel->end_date) ? $month_info['end_time'] : $searchModel->end_date;
?>
<div class="site-index">
    <?php 
echo Breadcrumbs::widget(['itemTemplate' => "<li><i>{link}</i></li>\n", 'links' => [['label' => '跟踪日志列表']]]);
?>

    <div class="body-content">
        <div class="panel panel-default">
            <?php