model.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. use yii\widgets\LinkPager;
  3. ?>
  4. <?php
  5. use backend\widgets\TabWidget;
  6. echo TabWidget::widget(['list' => $this->context->menuList, 'currentMenu' => $this->context->id]);
  7. ?>
  8. <div class="panel panel-default">
  9. <?php
  10. use backend\widgets\SubTabWidget;
  11. echo SubTabWidget::widget(['list' => $this->context->subMenuList, 'currentMenu' => $this->context->action->id]);
  12. ?>
  13. <div class="panel-body">
  14. <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
  15. <!--
  16. <div style="margin-bottom:10px;">
  17. <button class="btn btn-secondary btn-single" onclick="addToShowCoupon(0,0,'')">通用卷设置</button>
  18. </div>
  19. -->
  20. <div class="table-responsive">
  21. <table class="table table-bordered table-striped table-hover">
  22. <thead>
  23. <tr class="active">
  24. <th class="no-sorting hidden-xs"><input type="checkbox"></th>
  25. <th class="hidden-xs">优先级</th>
  26. <th class="hidden-xs">类型编号</th>
  27. <th>适用范围</th>
  28. <th>优惠金额</th>
  29. <th>最底消费</th>
  30. <th>新人用卷奖励</th>
  31. <th class="hidden-xs">领卷有效期</th>
  32. <th>发卷人数</th>
  33. <th>领卷数</th>
  34. <th class="hidden-xs">状态</th>
  35. <th>操作</th>
  36. </tr>
  37. </thead>
  38. <tbody class="middle-align">
  39. <?php if (!empty($list)) {
  40. foreach ($list as $key => $val) { ?>
  41. <tr>
  42. <td class="hidden-xs"><input type="checkbox"></td>
  43. <td><?= $val['level']; ?></td>
  44. <td class="hidden-xs"><?= $val['id']; ?></td>
  45. <td>
  46. <?php
  47. //0通用卷 1商品分类卷 2商品用途卷
  48. if ($val['type'] == 0) {
  49. if($val['targetId'] == 0){
  50. echo '<span style="color:green;font-weight:bold;">通用型</span>';
  51. }elseif($val['targetId'] == 1){
  52. echo '<span style="color:green;font-weight:bold;">通用型(二次)</span>';
  53. }elseif($val['targetId'] == 2){
  54. echo '<span style="color:green;font-weight:bold;">通用型(三次)</span>';
  55. }else{
  56. echo '<span style="color:green;font-weight:bold;">通用型(未知)</span>';
  57. }
  58. } elseif ($val['type'] == 1) {
  59. echo isset($categoryList[$val['targetId']]) ? $categoryList[$val['targetId']]['name'] : '';
  60. } elseif ($val['type'] == 2) {
  61. echo isset($usageList[$val['targetId']]) ? $usageList[$val['targetId']]['name'] : '';
  62. } else {
  63. }
  64. ?>
  65. </td>
  66. <td><?= $val['amount']; ?></td>
  67. <td><?= $val['meetAmount']; ?></td>
  68. <td><?= $val['reward']; ?></td>
  69. <td><?= $val['validTime'] ?>天</td>
  70. <td><?= $val['rightNum'] ?></td>
  71. <td><?= $val['getNum'] ?></td>
  72. <td>
  73. <?php if ($val['status'] == 0) {
  74. echo '停用';
  75. } ?>
  76. </td>
  77. <td>
  78. <!--
  79. <a href="javascript:void(0);" onclick="modifyToShowCoupon(<?= $val['id']; ?>)" style="color:blue;">修改</a>
  80. -->
  81. </td>
  82. </tr>
  83. <?php }
  84. } ?>
  85. </tbody>
  86. </table>
  87. </div>
  88. <div class="row">
  89. <div>
  90. <div class="dataTables_paginate paging_simple_numbers" style="float:right;padding-top:0px;margin-right:15px;">
  91. <?= LinkPager::widget(['pagination' => $pages]); ?>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <!-- footer -->
  99. <?php
  100. use backend\widgets\FooterWidget;
  101. ?>
  102. <?= FooterWidget::widget() ?>
  103. <!-- footer -->