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])