index.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. use yii\widgets\LinkPager;
  3. use common\helpers\Html;
  4. use common\enums\StatusEnum;
  5. $this->title = '定时群发';
  6. $this->params['breadcrumbs'][] = ['label' => $this->title];
  7. ?>
  8. <div class="row">
  9. <div class="col-12">
  10. <div class="box">
  11. <div class="box-header">
  12. <h3 class="box-title"><?= $this->title; ?></h3>
  13. <div class="box-tools">
  14. <!-- 权限校验判断 -->
  15. <?= Html::create(['edit']); ?>
  16. </div>
  17. </div>
  18. <div class="box-body table-responsive">
  19. <table class="table table-hover">
  20. <thead>
  21. <tr>
  22. <th>#</th>
  23. <th>发送对象</th>
  24. <th>发送类别</th>
  25. <th>粉丝数量</th>
  26. <th>发送时间</th>
  27. <th>发送状态</th>
  28. <th>创建时间</th>
  29. <th>操作</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <?php foreach ($models as $model) { ?>
  34. <tr>
  35. <td><?= $model->id; ?></td>
  36. <td><?= Html::encode($model->tag_name) ?></td>
  37. <td><span class="label label-info"><?= Html::encode($model->module) ?></span></td>
  38. <td><?= $model->fans_num ?></td>
  39. <td>
  40. 预计:<?= Yii::$app->formatter->asDatetime($model->send_time) ?><br>
  41. 实际:<?= !empty($model->final_send_time) ? Yii::$app->formatter->asDatetime($model->final_send_time) : '暂无' ?>
  42. </td>
  43. <td>
  44. <?php if ($model->send_status == StatusEnum::ENABLED) { ?>
  45. <span class="label label-info">已发送</span>
  46. <?php } else {
  47. if ($model->send_status == StatusEnum::DELETE) { ?>
  48. <span class="label label-danger">发送失败</span>
  49. <?php } else { ?>
  50. <span class="label label-default">待发送</span>
  51. <?php }
  52. } ?>
  53. </td>
  54. <td><?= Yii::$app->formatter->asDatetime($model->created_at) ?></td>
  55. <td>
  56. <?= Html::edit(['edit', 'id' => $model->id]); ?>
  57. <?= Html::delete(['delete', 'id' => $model->id]); ?>
  58. </td>
  59. </tr>
  60. <?php } ?>
  61. </tbody>
  62. </table>
  63. </div>
  64. <div class="box-footer">
  65. <?= LinkPager::widget([
  66. 'pagination' => $pages,
  67. ]); ?>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
粤ICP备19079148号