index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. <div class="tpl-table-black-operation">
  106. <?php if (checkPrivilege('apps.dealer.user/edit')): ?>
  107. <a class="tpl-table-black-operation-default"
  108. href="<?= url('apps.dealer.user/edit', ['dealer_id' => $item['user_id']]) ?>">
  109. <i class="am-icon-pencil"></i> 编辑
  110. </a>
  111. <?php endif; ?>
  112. <?php if (checkPrivilege([
  113. 'apps.dealer.order/index',
  114. 'apps.dealer.withdraw/index',
  115. 'apps.dealer.user/delete',
  116. 'apps.dealer.user/qrcode',
  117. ], false)): ?>
  118. <div class="operation-select am-dropdown">
  119. <button type="button"
  120. class="am-dropdown-toggle am-btn am-btn-sm am-btn-secondary">
  121. <span>操作</span>
  122. <span class="am-icon-caret-down"></span>
  123. </button>
  124. <ul class="am-dropdown-content" data-id="<?= $item['user_id'] ?>">
  125. <?php if (checkPrivilege('apps.dealer.order/index')): ?>
  126. <li>
  127. <a class="" target="_blank"
  128. href="<?= url('apps.dealer.order/index', ['user_id' => $item['user_id']]) ?>">分销订单</a>
  129. </li>
  130. <?php endif; ?>
  131. <?php if (checkPrivilege('apps.dealer.withdraw/index')): ?>
  132. <li>
  133. <a class="" target="_blank"
  134. href="<?= url('apps.dealer.withdraw/index', ['user_id' => $item['user_id']]) ?>">提现明细</a>
  135. </li>
  136. <?php endif; ?>
  137. <?php if (checkPrivilege('apps.dealer.user/delete')): ?>
  138. <li>
  139. <a data-type="delete" class=""
  140. href="javascript:void(0);">删除分销商</a>
  141. </li>
  142. <?php endif; ?>
  143. <?php if (checkPrivilege('apps.dealer.user/qrcode')): ?>
  144. <li>
  145. <a class=""
  146. href="<?= url('apps.dealer.user/qrcode', ['dealer_id' => $item['user_id']]) ?>"
  147. target="_blank">分销二维码</a>
  148. </li>
  149. <?php endif; ?>
  150. </ul>
  151. </div>
  152. <?php endif; ?>
  153. </div>
  154. </td>
  155. </tr>
  156. <?php endforeach; else: ?>
  157. <tr>
  158. <td colspan="9" class="am-text-center">暂无记录</td>
  159. </tr>
  160. <?php endif; ?>
  161. </tbody>
  162. </table>
  163. <div class="am-u-lg-12 am-cf">
  164. <div class="am-fr"><?= $list->render() ?> </div>
  165. <div class="am-fr pagination-total am-margin-right">
  166. <div class="am-vertical-align-middle">总记录:<?= $list->total() ?></div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <script>
  176. $(function () {
  177. /**
  178. * 注册操作事件
  179. * @type {jQuery|HTMLElement}
  180. */
  181. var $dropdown = $('.operation-select');
  182. $dropdown.dropdown();
  183. $dropdown.on('click', 'li a', function () {
  184. var $this = $(this)
  185. , id = $this.parent().parent().data('id');
  186. if ($this.data('type') === 'delete') {
  187. layer.confirm(
  188. '确定要删除吗?删除后下级成员关系将会中断,不可恢复,请谨慎操作'
  189. , {title: '友情提示'}
  190. , function (index) {
  191. $.post("<?= url('apps.dealer.user/delete') ?>", {dealer_id: id}, function (result) {
  192. result.code === 1 ? $.show_success(result.msg, result.url)
  193. : $.show_error(result.msg);
  194. });
  195. layer.close(index);
  196. }
  197. );
  198. }
  199. $dropdown.dropdown('close');
  200. });
  201. });
  202. </script>