| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464 |
- <?php
- use common\services\xhCouponService;
- use common\services\xhUserService;
- use common\services\xhUserAssetService;
- use common\components\stringUtil;
- ?>
- <?php
- use backend\widgets\TabWidget;
- echo TabWidget::widget(['list' => $this->context->menuList, 'currentMenu' => $this->context->id]);
- ?>
- <div class="panel panel-default">
- <?php
- use backend\widgets\SubTabWidget;
-
- echo SubTabWidget::widget(['list' => $this->context->subMenuList, 'currentMenu' => $this->context->action->id]);
- ?>
- <div class="panel-body">
- <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <div class="row">
- <form action="" method="GET">
- <div class="col-xs-6" style="width:90%;">
- <div class="dataTables_length" style="padding-bottom:10px">
- <label>昵称/手机号:<input type="search" value="<?php if (isset($_GET['content'])) {
- echo $_GET['content'];
- } ?>" class="form-control" name="content" placeholder=""></label>
- <input class="btn btn-secondary btn-single" type="submit" name="" value="搜索"/>
- <span style="margin-left:30px;font-size:14px;">
- <span>客户数:<b><?= $merchantAsset['totalUser'] ?></b></span>
- <span>粉丝数:<b><?= $merchantAsset['totalFans'] ?></b></span>
- <span>会员数:<b><?= $merchantAsset['totalMember'] ?></b></span>
- </span>
- </div>
- </div>
- </form>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover table-condensed">
- <thead>
- <tr class="active">
- <th class="no-sorting hidden-xs"><input name="selectAll" type="checkbox"></th>
- <th class="hidden-xs">ID</th>
- <th class="hidden-xs">头像</th>
- <th>来源 昵称</th>
- <th class="hidden-xs">手机号</th>
- <th class="hidden-xs">标签</th>
- <th class="hidden-xs">会员级别</th>
- <th class="hidden-xs">余额</th>
- <th class="hidden-xs">积分</th>
- <th class="hidden-xs">关注公众号</th>
- <th class="hidden-xs">最近访问</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php foreach ($models as $key => $val) {
- if ($val['id'] == 12541128) {
- continue;
- } ?>
- <tr>
- <td class="hidden-xs"><input name="uId" value="<?= $val['id'] ?>" type="checkbox"></td>
- <td class="hidden-xs">
- <a href="/user/detail?id=<?= $val['id'] ?>" title="<?= $val['userName'] ?>"><?= $val['id'] ?>
- </td>
- <td class="hidden-xs">
- <a href="/user/detail?id=<?= $val['id'] ?>" title="<?= $val['userName'] ?>">
- <img src="<?php if (!empty($val['avatar'])) {
- $avatar = xhUserService::getAvatarList($val['avatar']);
- echo Yii::$app->params['imgUrl'] . $avatar['small'];
- } else {
- echo Yii::$app->params['imgUrl'] . '/unknowavatar.png';
- } ?>"
- style="width:20px;border-radius:10px;"/> </a>
- </td>
- <td>
- <img src="/images/<?= $this->context->sourceImg[$val['source']] ?>" width="15"/>
-
- <a class="add-under-line" href="/user/detail?id=<?= $val['id'] ?>" title="<?= $val['userName'] ?>"><?php echo stringUtil::subStringUtf8($val['userName'], 10, '..'); ?></a>
- </td>
- <td class="hidden-xs">
- <?= $val['mobile'] ?>
- </td>
- <td class="hidden-xs">
- <?php
- $cacheTag = isset($val['tag']) ? $val['tag'] : '';
- if (!empty($cacheTag)) {
- $cacheTagList = explode(',', $cacheTag);
- foreach ($cacheTagList as $cacheKey => $cacheVal) {
- if (isset($merchantTag[$cacheVal])) {
- echo '<a href="javascript:void(0)" title="' . $merchantTag[$cacheVal] . '">' . stringUtil::subStringUtf8($merchantTag[$cacheVal], 3, '…') . '</a><br />';
- }
- }
- }
- $userAsset = xhUserAssetService::getByUserId($val['id']);
- $coupon = xhCouponService::getUserCoupon($val['id']);
- $couponJson = json_encode($coupon);
- ?>
- </td>
- <td class="hidden-xs">
- <?php
- if ($userAsset['memberLevel'] > 0) {
- echo $userAsset['memberLevel'];
- } else {
- if ($userAsset['integral']) {
- echo '积分卡';
- }
- } ?>
- </td>
- <td class="hidden-xs">
- <?php if ($userAsset['balance'] > 0) { ?>
- <a style="background-color: #68b828;color:white;padding:2px;border-radius:5px;text-decoration:none;color:#ffffff;" href="/capital/user?id=<?= $val['id'] ?>">
- <?= $userAsset['balance'] ?>
- </a>
- <?php } ?>
- </td>
- <td class="hidden-xs">
- <?php if ($userAsset['integral'] > 0) { ?>
- <a style="background-color: #68b828;color:white;padding:2px;border-radius:5px;text-decoration:none;color:#ffffff;"
- href="/integral/user?id=<?= $val['id'] ?>"><?= $userAsset['integral'] ?></a>
- <?php } ?>
- </td>
- <td class="hidden-xs">
- <?php if ($val['subscribe'] == 1) { ?>
- <a href="javascript:void(0)" style="color:#68b828;"><i class="fa fa-check"></i></a>
- <?php } ?>
- </td>
- <td><?php if (!empty($val['visitTime'])) {
- if (date("m-d") == date("m-d", $val['visitTime'])) {
- echo '今天 ' . date("H:i", $val['visitTime']);
- } else {
- echo date("m-d H:i", $val['visitTime']);
- }
- } ?></td>
- <td style="text-align:center;">
- <a href="javascript:void(0);" title="充值" style="color:#68b828;" onclick="globalRecharge(<?= $val['id'] ?>,'<?= $val['userName'] ?>')">
- <i class="fa-rmb"></i> </a>
-
- <a href="javascript:void(0);" title="绑定手机" style="color:#68b828;font-size:15px;" onclick="globalBindMobile(<?= $val['id'] ?>,'<?= $val['userName'] ?>')">
- <i class="fa-mobile"></i> </a>
- <style>
- .all_user_more {
- position: relative;
- margin-left: 14px;
- }
- .all_user_more .all_user_show_more_list {
- display: none;
- width: 100px;
- z-index: 9999;
- position: absolute;
- right: -40px;
- top: 15px;
- text-align: center;
- background: white;
- border: 1px solid #ccc;
- border-top: none;
- height: 95px;
- }
- .all_user_more .all_user_show_more_list dd {
- padding: 6px 0 6px 0;
- border-top: 1px solid #ccc;
- cursor: pointer;
- }
- </style>
- <span class="all_user_more" id="all_user_more_<?= $val['id'] ?>">
- <a href="javascript:;" class="all_user_text" id="all_user_text_<?= $val['id'] ?>">更多</a>
- <div class="all_user_show_more_list" id="all_user_show_more_list_<?= $val['id'] ?>">
- <dl>
- <dd onclick="upgradeUser('<?= $val['userName'] ?>',<?= $val['id'] ?>)">升级</dd>
- <dd onclick="resetPassword('<?= $val['userName'] ?>',<?= $val['id'] ?>)">重置支付密码</dd>
- <dd onclick="remarkInfo('<?= $val['userName'] ?>',<?= $val['id'] ?>)">备注信息</dd>
- </dl>
- </div>
- </span>
- <script>
- var all_user_t_<?= $val['id'] ?>;
- $("#all_user_text_<?= $val['id'] ?>").mouseover(function () {
- console.log('abc');
- clearTimeout(all_user_t_<?= $val['id'] ?>);
- $('#all_user_show_more_list_<?= $val['id'] ?>').css('display', 'block');
- }).mouseout(function () {
- all_user_t_<?= $val['id'] ?> = setTimeout(function () {
- $('#all_user_show_more_list_<?= $val['id'] ?>').css('display', 'none');
- }, 100);
- })
- $("#all_user_show_more_list_<?= $val['id'] ?>").mouseover(function () {
- clearTimeout(all_user_t_<?= $val['id'] ?>);
- }).mouseout(function () {
- all_user_t_<?= $val['id'] ?> = setTimeout(function () {
- $('#all_user_show_more_list_<?= $val['id'] ?>').css('display', 'none');
- }, 100);
- });
- $("#all_user_show_more_list_<?= $val['id'] ?> > dl > dd").each(function () {
- $(this).mousemove(function () {
- clearTimeout(all_user_t_<?= $val['id'] ?>);
- $(this).css('background', '#f5f5f5');
- }).mouseout(function () {
- $(this).css('background', '#FFFFFF');
- });
- });
- </script>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <div class="row">
- <div>
- <div class="dataTables_paginate paging_simple_numbers"
- style="float:right;padding-top:0px;margin-right:15px;">
- <?= $pages ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- footer -->
- <?php
- use backend\widgets\FooterWidget;
- ?>
- <?= FooterWidget::widget() ?>
- <!-- footer -->
- <!-- modal 升级会员确认提醒框 -->
- <div class="modal fade" id="memberModal">
- <div class="modal-dialog" style="height:300px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">消息提示</h4>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label for="field-1" class="control-label">确认将 <span></span>会员等级设置为</label>
- <select class="form-control" name="memberLevel">
- <?php foreach ($memberIntegral as $key => $val) { ?>
- <?php echo '<option value="' . $val['level'] . '">' . $val['level'] . '级 ' . $val['discount'] . '折</option>'; ?>
- <?php } ?>
- </select>
- </div>
- </div>
- </div>
- <input type="hidden" name="upgradeUserId" value=""/>
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label for="field-1" class="control-label">请输入确认密码:</label>
- <input type="password" class="form-control" name="confirmPassword" placeholder="" value="">
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="memberConfirmButton">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- //升级为会员 取消会员操作
- function upgradeUser(name, id) {
- $("#memberModal .modal-body span").text(name);
- $("#memberModal .modal-body input[name=upgradeUserId]").val(id);
- jQuery('#memberModal').modal('show', {backdrop: 'fade'});
- }
- $(function () {
- //确认升级会员
- jQuery("button[name=memberConfirmButton]").click(function () {
- var confirmPassword = $("#memberModal .modal-body input[name=confirmPassword]").val();
- var upgradeUserId = $("#memberModal .modal-body input[name=upgradeUserId]").val();
- var memberLevel = $("select[name=memberLevel]").find("option:selected").val();
- $.ajax({
- type: "GET",
- url: "/user/upgrade?confirmPassword=" + confirmPassword + "&memberLevel=" + memberLevel + '&userId=' + upgradeUserId,
- async: false,
- dataType: 'json',
- success: function (data) {
- if (data.code == 'A0001') {
- setTimeout(function () {
- window.location.reload();
- }, 2000);
- }
- xhPopMsg(data.msg, 2000);
- }
- });
- });
- });
- </script>
- <script>
- //全选 全不选
- $(":checkbox[name=selectAll]").click(function () {
- var status = $(this).prop("checked");
- if (status == true) {
- $(":checkbox[name=uId]").prop("checked", true);
- } else {
- $(":checkbox[name=uId]").prop("checked", false);
- }
- });
- </script>
- <!-- 添加标签 -->
- <div class="modal fade" id="userTagModal">
- <div class="modal-dialog" style="height:450px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">请选择你要添加的标签</h4>
- </div>
- <div class="modal-body">
- <input type="hidden" name="requestUrl" value="/user/batch-add-user-tag"/>
- <?php if (!empty($merchantTag)) { ?>
- <?php foreach ($merchantTag as $key => $val) { ?>
- <div class="row">
- <div class="col-md-6">
- <div class="checkbox">
- <label> <input name="theTag" value="<?= $key ?>" type="radio"> <?= $val ?>
- </label>
- </div>
- </div>
- </div>
- <?php }
- } ?>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="userTagConfirmButton">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- var shopProvince = "<?=$merchant['shopProvince'] ?>";
- var shopCity = "<?=$merchant['shopCity'] ?>";
- $("button[name=multipConfirm]").click(function () {
- var ids = new Array();
- $(":checkbox[name=uId]:checked").each(function () {
- var theId = $(this).val();
- ids.push(theId);
- });
- if (ids.length <= 0) {
- xhPopMsg('请选择你要操作的用户', 1300);
- return;
- }
- var option = $("select[name=doOption]").val();
- option = parseInt(option);
- switch (option) {
- case 0:
- //批量添加标签
- jQuery('#userTagModal').modal('show');
- break;
- case 1:
- xhPopMsg('此功能开发中…', 1300);
- break;
- }
- });
- //确认添加标签
- jQuery("button[name=userTagConfirmButton]").click(function () {
- var tagId = $("#userTagModal .modal-body :input[name=theTag]:checked").val();
- var url = $("#userTagModal .modal-body input[name=requestUrl]").val();
- var ids = new Array();
- $(":checkbox[name=uId]:checked").each(function () {
- var theId = $(this).val();
- ids.push(theId);
- });
- if (ids.length <= 0) {
- xhPopMsg('请选择用户', 1300);
- return;
- }
- var userIdStr = ids.join(',');
- $.ajax({
- type: "GET",
- url: url + '?tagId=' + tagId + '&userIdStr=' + userIdStr,
- async: false,
- dataType: 'json',
- success: function (data) {
- xhPopMsg(data.msg, 1300);
- if (data.code == 'A0001') {
- setTimeout(function () {
- window.location.reload();
- }, 1000);
- }
- }
- });
- });
- </script>
- <!-- 重置支付密码 -->
- <div class="modal fade" id="resetPasswordConfirmMention">
- <div class="modal-dialog" style="height:300px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">提示</h4>
- </div>
- <div class="modal-body">
- 确认对 <span></span> 的支付密码进行重置? <input type="hidden" name="resetUserId" value=""/>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="resetPasswordConfirmOk">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- function remarkInfo(userName, id) {
- xhPopMsg('开发中...');
- }
- function resetPassword(userName, id) {
- $("#resetPasswordConfirmMention .modal-body span").text(userName);
- $("#resetPasswordConfirmMention .modal-body input[name=resetUserId]").val(id);
- jQuery('#resetPasswordConfirmMention').modal('show', {backdrop: 'fade'}).css({
- 'margin-top': function () {
- var modalHeight = jQuery("#resetPasswordConfirmMention").find('.modal-dialog').height();
- return ($(window).height() / 2 - (modalHeight / 2));
- }
- });
- }
- $(function () {
- //点击确认操作
- jQuery("button[name=resetPasswordConfirmOk]").click(function () {
- var resetUserId = jQuery("#resetPasswordConfirmMention .modal-body input[name=resetUserId]").val();
- var url = '/user/reset-pay-password?id=' + resetUserId;
- $.ajax({
- type: "GET", url: url, async: false, dataType: 'json', success: function (data) {
- if (data.code == 'A0001') {
- xhPopMsg('操作成功');
- $('#resetPasswordConfirmMention').modal('hide');
- return;
- }
- xhPopMsg(data.msg);
- }
- });
- });
- });
- </script>
|