diff --git a/application/admin/controller/shopro/commission/Agent.php b/application/admin/controller/shopro/commission/Agent.php index ebfcb38..6b597f3 100644 --- a/application/admin/controller/shopro/commission/Agent.php +++ b/application/admin/controller/shopro/commission/Agent.php @@ -58,18 +58,43 @@ class Agent extends Common $last = intval($detail->last_self_order_time ?? 0); $days = \addons\shopro\service\partner\PartnerConfig::activeDays(); $ago = $last ? intval(floor((time() - $last) / 86400)) : null; - $cash = \app\admin\model\shopro\partner\Reward::where('user_id', $id) - ->where('status', 1) - ->where('amount', '>', 0) - ->sum('amount'); + + $identityInfo = \addons\shopro\service\partner\IdentityService::build($detail); + $isPartner = !empty($identityInfo['is_partner']); + $detail->is_partner = $isPartner ? 1 : 0; $detail->next_push3_amount = number_format((float) $next, 2, '.', ''); $detail->next_push3_text = '第 ' . ($seq + 1) . ' 单将返 ' . $detail->next_push3_amount; $detail->last_self_order_text = $last ? date('Y-m-d H:i:s', $last) : '从未下单'; - $detail->active_status_text = !empty($detail->active_30d) - ? '正常领取' - : ('已暂停' . ($ago !== null ? '(距今 ' . $ago . ' 天)' : '')); - $detail->partner_cash_income = number_format((float) $cash, 2, '.', ''); + + // 业务核心规范:合伙股东仅是会员专属进阶身份,普通会员与品酒师免自购考核 + if (!$isPartner) { + $detail->active_status_text = '免自购考核 (基础会员/品酒师)'; + } else { + $detail->active_status_text = !empty($detail->active_30d) + ? '正常领取' + : ('已暂停' . ($ago !== null ? '(距今 ' . $ago . ' 天)' : '')); + } + + $totalCash = \app\admin\model\shopro\partner\Reward::where('user_id', $id) + ->where('status', 1) + ->where('amount', '>', 0) + ->sum('amount'); + $push3Cash = \app\admin\model\shopro\partner\Reward::where('user_id', $id) + ->where('status', 1) + ->where('amount', '>', 0) + ->where('reward_type', 'push3') + ->sum('amount'); + $partnerExclusiveCash = \app\admin\model\shopro\partner\Reward::where('user_id', $id) + ->where('status', 1) + ->where('amount', '>', 0) + ->where('reward_type', '<>', 'push3') + ->sum('amount'); + + $detail->income_total_cash = number_format((float) $totalCash, 2, '.', ''); + $detail->push3_cash_income = number_format((float) $push3Cash, 2, '.', ''); + $detail->partner_exclusive_cash = number_format((float) $partnerExclusiveCash, 2, '.', ''); + $detail->partner_cash_income = $detail->income_total_cash; $detail->partner_mode = \addons\shopro\service\partner\PartnerConfig::isPartnerMode() ? 1 : 0; $rate = (new \addons\shopro\service\partner\RateService())->currentRate(); $detail->madow_value = \addons\shopro\service\partner\IdentityService::formatMoney((float) ($detail->madow ?? 0) * (float) $rate); diff --git a/application/admin/view/shopro/commission/agent/detail.html b/application/admin/view/shopro/commission/agent/detail.html index df6643b..554ff03 100644 --- a/application/admin/view/shopro/commission/agent/detail.html +++ b/application/admin/view/shopro/commission/agent/detail.html @@ -202,7 +202,10 @@ : state.data.user_id }} - + +
+ 基础分销信息 +
{{ value.label }} + color: value.color, + }" v-for="(value, key) in statusStyle" :key="key" :command="key">{{ value.label }} {/if} @@ -228,7 +231,7 @@