From 97d36eca897bb71abfffbadc31fdd165a72bade0 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Mon, 18 Mar 2024 16:58:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E7=BB=8F=E9=94=80?= =?UTF-8?q?=E5=95=86=E4=BD=A3=E9=87=91=E5=92=8C=E5=B9=B3=E7=BA=A7=E5=A5=96?= =?UTF-8?q?=E5=9C=A8=E5=95=86=E5=93=81=E5=BC=80=E5=90=AF=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E8=BF=94=E5=88=A9=E6=83=85=E5=86=B5=E4=B8=8B=E4=BB=85=E4=B8=8A?= =?UTF-8?q?=E7=BA=A7=E8=8E=B7=E5=BE=97=E5=A5=96=E5=8A=B1=E3=80=81=E4=B8=8A?= =?UTF-8?q?=E4=B8=8A=E7=BA=A7=E8=8E=B7=E5=BE=97=E5=B9=B3=E7=BA=A7=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../withdraw/controllers/ApplyController.php | 2 +- .../src/services/TeamReturnService.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/frontend/modules/withdraw/controllers/ApplyController.php b/app/frontend/modules/withdraw/controllers/ApplyController.php index c94a88cf..5d0f2d36 100644 --- a/app/frontend/modules/withdraw/controllers/ApplyController.php +++ b/app/frontend/modules/withdraw/controllers/ApplyController.php @@ -137,7 +137,7 @@ class ApplyController extends ApiController if ($explain = $this->withdrawalExplain()) { return str_replace('[奖励余额]', $this->awardBalance(), $explain); } - return $this->withdrawalName() . '申请成功,预计到账时间T+2'; + return $this->withdrawalName() . '申请成功,预计到账时间T+1'; } private function validateWithdrawDeductionLove() diff --git a/plugins/team-dividend/src/services/TeamReturnService.php b/plugins/team-dividend/src/services/TeamReturnService.php index eb3e6224..927c6753 100644 --- a/plugins/team-dividend/src/services/TeamReturnService.php +++ b/plugins/team-dividend/src/services/TeamReturnService.php @@ -61,6 +61,8 @@ class TeamReturnService private $team_levels; + private $parentId; + private $parentUpId; // public function __construct($order, $set, $buyMember, $order_goods, $agents) // { // $this->order = $order; @@ -80,6 +82,7 @@ class TeamReturnService $this->buyMember = $buyMember; $this->order_goods = $order_goods; $this->agents = $agents; + $this->team_goods = GoodsTeamDividend::getGoodsByGoodsId($this->order_goods->goods_id)->first(); $this->levels = TeamDividendLevelModel::uniacid()->orderBy('level_weight','asc')->get()->toArray(); $this->flat_prize_limit = 0; @@ -88,6 +91,13 @@ class TeamReturnService ->get() ->toArray(); + // 购买者上级 uid + $this->parentId = MemberShopInfo::where('member_id',$this->buyMember->uid)->value('parent_id'); + // 购买者上级的上级 uid + $this->parentUpId = MemberShopInfo::where('member_id', $this->parentId)->value('parent_id'); + + + \Log::debug('经销商创建-team_goods:' . $this->order_goods->goods_id, $this->team_goods ? $this->team_goods->toArray() : []); $this->init(); @@ -211,6 +221,9 @@ class TeamReturnService $ratio = $this->amount_service->getRatio(); // 分红金额 判断:是否开启分期 if($this->team_goods->is_stages == 1){ + // 判断:仅直推上级获取 + if($agent['uid'] != $this->parentId ) return; + // 佣金处理 $levelName = 'level_'.$agent['level']; $stages_num = unserialize($this->team_goods->stages_num);//分期数量 $stages_type = unserialize($this->team_goods->stages_type);//分期类型 @@ -333,6 +346,9 @@ class TeamReturnService // 分红金额 判断:是否开启分期 if($this->team_goods->is_stages == 1){ + // 仅购买者上级的上级可得 + if($agent['uid'] != $this->parentUpId) return; + // 佣金处理 $amountList = TeamDividendModel::where('order_sn',$this->order->order_sn) ->select(['amount','status','expect_thaw_time','reality_thaw_time','month']) ->whereIn('type',[7,8])