rule.php 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. use common\helpers\Html;
  3. use common\helpers\Url;
  4. use yii\widgets\ActiveForm;
  5. use yii\widgets\LinkPager;
  6. use kartik\daterange\DateRangePicker;
  7. $addon = <<< HTML
  8. <div class="input-group-append">
  9. <span class="input-group-text">
  10. <i class="fas fa-calendar-alt"></i>
  11. </span>
  12. </div>
  13. HTML;
  14. $this->title = '回复规则使用量';
  15. $this->params['breadcrumbs'][] = ['label' => $this->title];
  16. ?>
  17. <div class="row">
  18. <div class="col-12">
  19. <div class="box">
  20. <div class="box-header">
  21. <h3 class="box-title"><?= $this->title; ?></h3>
  22. </div>
  23. <div class="box-body table-responsive">
  24. <div class="col-sm-12 normalPaddingJustV">
  25. <?php $form = ActiveForm::begin([
  26. 'action' => Url::to(['rule']),
  27. 'method' => 'get'
  28. ]); ?>
  29. <div class="row">
  30. <div class="col-sm-4 p-r-no-away">
  31. <div class="input-group drp-container">
  32. <?= DateRangePicker::widget([
  33. 'name' => 'queryDate',
  34. 'value' => $from_date . '-' . $to_date,
  35. 'readonly' => 'readonly',
  36. 'useWithAddon' => true,
  37. 'convertFormat' => true,
  38. 'startAttribute' => 'from_date',
  39. 'endAttribute' => 'to_date',
  40. 'startInputOptions' => ['value' => $from_date],
  41. 'endInputOptions' => ['value' => $to_date],
  42. 'pluginOptions' => [
  43. 'locale' => ['format' => 'Y-m-d'],
  44. ]
  45. ]) . $addon;?>
  46. </div>
  47. </div>
  48. <div class="col-sm-3 p-l-no-away">
  49. <div class="input-group m-b">
  50. <?= Html::tag('span', '<button class="btn btn-white"><i class="fa fa-search"></i> 搜索</button>', ['class' => 'input-group-btn'])?>
  51. </div>
  52. </div>
  53. </div>
  54. <?php ActiveForm::end(); ?>
  55. </div>
  56. <table class="table table-hover">
  57. <thead>
  58. <tr>
  59. <th>规则</th>
  60. <th>模块</th>
  61. <th>命中次数</th>
  62. <th>最后触发时间</th>
  63. <th>操作</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <?php foreach($models as $model){ ?>
  68. <tr>
  69. <td><?= isset($model->rule->name) ? $model->rule->name : ''; ?></td>
  70. <td><?= isset($model->rule->module) ? $model->rule->module : ''; ?></td>
  71. <td><?= $model->hit ?></td>
  72. <td><?= Yii::$app->formatter->asDatetime($model->updated_at) ?></td>
  73. <td>无</td>
  74. </tr>
  75. <?php } ?>
  76. </tbody>
  77. </table>
  78. </div>
  79. <div class="box-footer">
  80. <?= LinkPager::widget([
  81. 'pagination' => $pages
  82. ]);?>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
粤ICP备19079148号