index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <div class="row-content am-cf">
  2. <div class="row">
  3. <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
  4. <div class="widget am-cf">
  5. <div class="widget-head am-cf">
  6. <div class="widget-title am-cf">分销商列表</div>
  7. </div>
  8. <div class="widget-body am-fr">
  9. <!-- 工具栏 -->
  10. <div class="page_toolbar am-margin-bottom-xs am-cf">
  11. <form class="toolbar-form" action="">
  12. <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">
  13. <div class="am-u-sm-12 am-u-md-9 am-u-sm-push-3">
  14. <div class="am fr">
  15. <div class="am-form-group am-fl">
  16. <div class="am-input-group am-input-group-sm tpl-form-border-form">
  17. <input type="text" class="am-form-field" name="search"
  18. placeholder="请输入昵称/姓名/手机号"
  19. value="<?= $request->get('search') ?>">
  20. <div class="am-input-group-btn">
  21. <button class="am-btn am-btn-default am-icon-search"
  22. type="submit"></button>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="__am-scrollable-horizontal am-u-sm-12 am-padding-bottom-lg">
  31. <table width="100%" class="am-table am-table-compact am-table-striped
  32. tpl-table-black am-text-nowrap">
  33. <thead>
  34. <tr>
  35. <th>用户ID</th>
  36. <th>微信头像</th>
  37. <th>微信昵称</th>
  38. <th>
  39. <p>姓名</p>
  40. <p>手机号</p>
  41. </th>
  42. <th>
  43. <p>累计佣金</p>
  44. <p>可提现佣金</p>
  45. </th>
  46. <th>推荐人</th>
  47. <th>下级用户</th>
  48. <th>成为时间</th>
  49. <th>操作</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
  54. <tr>
  55. <td class="am-text-middle"><?= $item['user_id'] ?></td>
  56. <td class="am-text-middle">
  57. <a href="<?= $item['avatarUrl'] ?>" title="点击查看大图" target="_blank">
  58. <img src="<?= $item['avatarUrl'] ?>"
  59. width="50" height="50" alt="">
  60. </a>
  61. </td>
  62. <td class="am-text-middle">
  63. <p><span><?= $item['nickName'] ?></span></p>
  64. </td>
  65. <td class="am-text-middle">
  66. <?php if (!empty($item['real_name']) || !empty($item['mobile'])): ?>
  67. <p><?= $item['real_name'] ?: '--' ?></p>
  68. <p><?= $item['mobile'] ?: '--' ?></p>
  69. <?php else: ?>
  70. <p>--</p>
  71. <?php endif; ?>
  72. </td>
  73. <td class="am-text-middle">
  74. <p><?= sprintf('%.2f', $item['money'] + $item['freeze_money'] + $item['total_money']) ?></p>
  75. <p><?= $item['money'] ?></p>
  76. </td>
  77. <td class="am-text-middle">
  78. <?php if ($item['referee_id'] > 0): ?>
  79. <p><?= $item['referee']['nickName'] ?></p>
  80. <p class="am-link-muted f-12">(ID:<?= $item['referee']['user_id'] ?>)</p>
  81. <?php else: ?>
  82. <p>平台</p>
  83. <?php endif; ?>
  84. </td>
  85. <td class="am-text-middle">
  86. <p>
  87. <a href="<?= url('apps.dealer.user/fans', ['user_id' => $item['user_id'], 'level' => 1]) ?>"
  88. target="_blank">一级:<?= $item['first_num'] ?></a>
  89. </p>
  90. <?php if ($basicSetting['level'] >= 2): ?>
  91. <p>
  92. <a href="<?= url('apps.dealer.user/fans', ['user_id' => $item['user_id'], 'level' => 2]) ?>"
  93. target="_blank">二级:<?= $item['second_num'] ?></a>
  94. </p>
  95. <?php endif; ?>
  96. <?php if ($basicSetting['level'] == 3): ?>
  97. <p>
  98. <a href="<?= url('apps.dealer.user/fans', ['user_id' => $item['user_id'], 'level' => 3]) ?>"
  99. target="_blank">三级:<?= $item['third_num'] ?></a>
  100. </p>
  101. <?php endif; ?>
  102. </td>
  103. <td class="am-text-middle"><?= $item['create_time'] ?></td>
  104. <td class="am-text-middle">
  105. <?php if (checkPrivilege([
  106. 'apps.dealer.order/index',
  107. 'apps.dealer.withdraw/index',
  108. 'apps.dealer.user/delete',
  109. 'apps.dealer.user/qrcode',
  110. ], false)): ?>
  111. <div class="operation-select am-dropdown">
  112. <button type="button"
  113. class="am-dropdown-toggle am-btn am-btn-sm am-btn-secondary">
  114. <span>操作</span>
  115. <span class="am-icon-caret-down"></span>
  116. </button>
  117. <ul class="am-dropdown-content" data-id="<?= $item['user_id'] ?>">
  118. <?php if (checkPrivilege('apps.dealer.order/index')): ?>
  119. <li>
  120. <a class="" target="_blank"
  121. href="<?= url('apps.dealer.order/index', ['user_id' => $item['user_id']]) ?>">分销订单</a>
  122. </li>
  123. <?php endif; ?>
  124. <?php if (checkPrivilege('apps.dealer.withdraw/index')): ?>
  125. <li>
  126. <a class="" target="_blank"
  127. href="<?= url('apps.dealer.withdraw/index', ['user_id' => $item['user_id']]) ?>">提现明细</a>
  128. </li>
  129. <?php endif; ?>
  130. <?php if (checkPrivilege('apps.dealer.user/delete')): ?>
  131. <li>
  132. <a data-type="delete" class=""
  133. href="javascript:void(0);">删除分销商</a>
  134. </li>
  135. <?php endif; ?>
  136. <?php if (checkPrivilege('apps.dealer.user/qrcode')): ?>
  137. <li>
  138. <a class=""
  139. href="<?= url('apps.dealer.user/qrcode', ['dealer_id' => $item['user_id']]) ?>"
  140. target="_blank">分销二维码</a>
  141. </li>
  142. <?php endif; ?>
  143. </ul>
  144. </div>
  145. <?php endif; ?>
  146. </td>
  147. </tr>
  148. <?php endforeach; else: ?>
  149. <tr>
  150. <td colspan="9" class="am-text-center">暂无记录</td>
  151. </tr>
  152. <?php endif; ?>
  153. </tbody>
  154. </table>
  155. <div class="am-u-lg-12 am-cf">
  156. <div class="am-fr"><?= $list->render() ?> </div>
  157. <div class="am-fr pagination-total am-margin-right">
  158. <div class="am-vertical-align-middle">总记录:<?= $list->total() ?></div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <script>
  168. $(function () {
  169. /**
  170. * 注册操作事件
  171. * @type {jQuery|HTMLElement}
  172. */
  173. var $dropdown = $('.operation-select');
  174. $dropdown.dropdown();
  175. $dropdown.on('click', 'li a', function () {
  176. var $this = $(this);
  177. var id = $this.parent().parent().data('id');
  178. var type = $this.data('type');
  179. if (type === 'delete') {
  180. layer.confirm('确定要删除分销商吗?', function (index) {
  181. $.post("<?= url('apps.dealer.user/delete') ?>", {dealer_id: id}, function (result) {
  182. result.code === 1 ? $.show_success(result.msg, result.url)
  183. : $.show_error(result.msg);
  184. });
  185. layer.close(index);
  186. });
  187. }
  188. $dropdown.dropdown('close');
  189. });
  190. });
  191. </script>