From 189181e4ceced401ae72c31fd976795e0581fe24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 20 May 2021 10:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=90=86=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data/controller/user/Admin.php | 21 +++++++++++++++++++++ app/data/view/user/admin/index.html | 13 ++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/data/controller/user/Admin.php b/app/data/controller/user/Admin.php index e93ddb95d..cd61f5813 100644 --- a/app/data/controller/user/Admin.php +++ b/app/data/controller/user/Admin.php @@ -110,6 +110,27 @@ class Admin extends Controller empty($status) ? $this->error($message) : $this->success($message); } + /** + * 取消上级代理 + * @auth true + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function unbind() + { + $map = $this->_vali(['id.require' => '用户ID不能为空!']); + $user = $this->app->db->name($this->table)->where($map)->find(); + if (empty($user)) $this->error('用户不符合操作要求!'); + // 修改指定用户代理数据 + $this->app->db->name($this->table)->where(['id' => $user['id']])->update([ + 'pid0' => 0, 'pid1' => 0, 'pid2' => 0, 'pids' => 1, 'path' => '-', 'layer' => 1, + ]); + // 刷新用户等级及上级等级 + UserUpgradeService::instance()->upgrade($user['id'], true); + $this->success('取消上级代理成功!'); + } + /** * 绑定上级代理 * @auth true diff --git a/app/data/view/user/admin/index.html b/app/data/view/user/admin/index.html index 3693aea0d..40ff16b88 100644 --- a/app/data/view/user/admin/index.html +++ b/app/data/view/user/admin/index.html @@ -98,7 +98,11 @@
间接团队 {$vo.teams_users_indirect} 人 ( 业绩 {$vo.teams_amount_indirect+0} 元 )
-
累计交易:{$vo.order_amount_total+0}
+
+ 累计交易:{$vo.order_amount_total+0} 元 + {if $vo.buy_vip_entry}已入会{else}未入会{/if} +
+
注册时间:{$vo.create_at|format_datetime}
使用状态:{if $vo.status eq 0}已冻结{elseif $vo.status eq 1}已激活{/if} 永久绑定 @@ -109,7 +113,7 @@ {notempty name='vo.pid0'} 临时绑定 - 改为永久 + 改为永久 {else} 没有绑定 @@ -118,8 +122,11 @@ {/notempty} + + 取消绑定 +
-
注册时间:{$vo.create_at|format_datetime}
+