比较提交
9 次代码提交
40f36c8889
...
main
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
|
|
ecdee1f53a | ||
|
|
092155c645 | ||
|
|
ba33584936 | ||
|
|
21e4230819 | ||
|
|
3a7c13f026 | ||
|
|
511a8cb485 | ||
|
|
6bd497f980 | ||
|
|
a7a8e3e494 | ||
|
|
dbb9951857 |
@@ -13,12 +13,15 @@ class Category extends Common
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$id = $this->request->param('id', 0);
|
$id = $this->request->param('id', 0);
|
||||||
$category = CategoryModel::where('parent_id', 0)->normal()->order('weigh', 'desc')->order('id', 'desc');
|
$category = null;
|
||||||
if ($id) {
|
if ($id) {
|
||||||
// 指定 id 分类,否则获取 权重最高的一级分类
|
// 指定 id 分类
|
||||||
$category = $category->where('id', $id);
|
$category = CategoryModel::where('parent_id', 0)->normal()->where('id', $id)->find();
|
||||||
|
}
|
||||||
|
if (!$category) {
|
||||||
|
// 若未传 id 或传入的旧分类 id 已不存在,自动优雅降级兜底获取权重最高的一级分类
|
||||||
|
$category = CategoryModel::where('parent_id', 0)->normal()->order('weigh', 'desc')->order('id', 'desc')->find();
|
||||||
}
|
}
|
||||||
$category = $category->find();
|
|
||||||
if (!$category) {
|
if (!$category) {
|
||||||
$this->error(__('No Results were found'));
|
$this->error(__('No Results were found'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -337,13 +337,32 @@ class Agent
|
|||||||
// 团队用户人数 = 一级用户人数 + 一级用户的团队用户人数
|
// 团队用户人数 = 一级用户人数 + 一级用户的团队用户人数
|
||||||
$this->agent->child_user_count_all = $this->agent->child_user_count_1 + array_sum(array_column($nextAgentTeam, 'child_user_count_all'));
|
$this->agent->child_user_count_all = $this->agent->child_user_count_1 + array_sum(array_column($nextAgentTeam, 'child_user_count_all'));
|
||||||
|
|
||||||
// 一级分销商人数
|
// 一级有效分销商与等级统计 (优化:等级 1 品酒师必须有自购计奖商品 child_order_count_0 >= 1 才算有效品酒师)
|
||||||
$this->agent->child_agent_count_1 = count($nextAgentTeam);
|
$effectiveNextLevels = [];
|
||||||
|
$effectiveAgentCount1 = 0;
|
||||||
|
foreach ($nextAgentTeam as $agMember) {
|
||||||
|
$agLv = intval($agMember['level'] ?? 1);
|
||||||
|
$selfBuyOrderCount = intval($agMember['child_order_count_0'] ?? 0);
|
||||||
|
|
||||||
|
if ($agLv === 1) {
|
||||||
|
if ($selfBuyOrderCount >= 1) {
|
||||||
|
$effectiveNextLevels[] = 1;
|
||||||
|
$effectiveAgentCount1++;
|
||||||
|
}
|
||||||
|
// 未自购计奖商品者属于普通游客,不计入品酒师,亦不计入一级分销商人数
|
||||||
|
} elseif ($agLv >= 2) {
|
||||||
|
$effectiveNextLevels[] = $agLv;
|
||||||
|
$effectiveAgentCount1++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一级有效分销商人数
|
||||||
|
$this->agent->child_agent_count_1 = $effectiveAgentCount1;
|
||||||
|
|
||||||
// 二级分销商人数 = 一级分销商的一级分销商人数
|
// 二级分销商人数 = 一级分销商的一级分销商人数
|
||||||
$this->agent->child_agent_count_2 = array_sum(array_column($nextAgentTeam, 'child_agent_count_1'));
|
$this->agent->child_agent_count_2 = array_sum(array_column($nextAgentTeam, 'child_agent_count_1'));
|
||||||
|
|
||||||
// 团队分销商人数 = 一级分销商人数 + 一级分销商的团队分销商人数
|
// 团队分销商人数 = 一级有效分销商人数 + 一级所有分销商的团队分销商人数
|
||||||
$this->agent->child_agent_count_all = $this->agent->child_agent_count_1 + array_sum(array_column($nextAgentTeam, 'child_agent_count_all'));
|
$this->agent->child_agent_count_all = $this->agent->child_agent_count_1 + array_sum(array_column($nextAgentTeam, 'child_agent_count_all'));
|
||||||
|
|
||||||
// 二级分销订单金额 = 一级分销商的一级分销订单金额 + 一级分销商的自购订单金额
|
// 二级分销订单金额 = 一级分销商的一级分销订单金额 + 一级分销商的自购订单金额
|
||||||
@@ -358,8 +377,8 @@ class Agent
|
|||||||
// 团队分销订单数量 = 自购分销订单数量 + 一级分销订单数量 + 一级所有分销商的团队分销订单总数量
|
// 团队分销订单数量 = 自购分销订单数量 + 一级分销订单数量 + 一级所有分销商的团队分销订单总数量
|
||||||
$this->agent->child_order_count_all = $this->agent->child_order_count_0 + $this->agent->child_order_count_1 + array_sum(array_column($nextAgentTeam, 'child_order_count_all'));
|
$this->agent->child_order_count_all = $this->agent->child_order_count_0 + $this->agent->child_order_count_1 + array_sum(array_column($nextAgentTeam, 'child_order_count_all'));
|
||||||
|
|
||||||
// 一级分销商等级统计
|
// 一级分销商等级统计 (仅统计自购了计奖商品的有效品酒师及创客)
|
||||||
$child_agent_level_1 = array_count_values(array_column($nextAgentTeam, 'level'));
|
$child_agent_level_1 = array_count_values($effectiveNextLevels);
|
||||||
ksort($child_agent_level_1);
|
ksort($child_agent_level_1);
|
||||||
$this->agent->child_agent_level_1 = $child_agent_level_1;
|
$this->agent->child_agent_level_1 = $child_agent_level_1;
|
||||||
|
|
||||||
@@ -520,11 +539,26 @@ class Agent
|
|||||||
case 'child_agent_level_all': // 团队分销商等级统计
|
case 'child_agent_level_all': // 团队分销商等级统计
|
||||||
$match[$name] = true;
|
$match[$name] = true;
|
||||||
if (count($value) > 0) {
|
if (count($value) > 0) {
|
||||||
if (empty($this->agent->$name)) {
|
$currentLevelDist = $this->agent->$name;
|
||||||
|
if (is_string($currentLevelDist)) {
|
||||||
|
$currentLevelDist = json_decode($currentLevelDist, true) ?: [];
|
||||||
|
}
|
||||||
|
$currentLevelDist = (array)$currentLevelDist;
|
||||||
|
|
||||||
|
if (empty($currentLevelDist)) {
|
||||||
$match[$name] = false;
|
$match[$name] = false;
|
||||||
} else {
|
} else {
|
||||||
foreach ($value as $k => $row) {
|
foreach ($value as $k => $row) {
|
||||||
if (!isset(($this->agent->$name)[$row['level']]) || ($this->agent->$name)[$row['level']] < $row['count']) {
|
$targetLevel = intval($row['level'] ?? 0);
|
||||||
|
$targetCount = intval($row['count'] ?? 0);
|
||||||
|
$actualCount = 0;
|
||||||
|
// 向上兼容累计:当下级达到或超过目标等级时,均符合该等级的人数考核要求
|
||||||
|
foreach ($currentLevelDist as $curLv => $cnt) {
|
||||||
|
if (intval($curLv) >= $targetLevel) {
|
||||||
|
$actualCount += intval($cnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($actualCount < $targetCount) {
|
||||||
$match[$name] = false;
|
$match[$name] = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,13 @@
|
|||||||
namespace addons\shopro\service\partner;
|
namespace addons\shopro\service\partner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创客协同(逐代 10% 递减级联,最低发放不能少于 0.10 元截断)/ 创客卓越 5%(只一层)
|
* 创客协同:第 1 代按下级本单实得进阶奖 × 比例,之后每代按上一笔协同奖 × 比例,低于 0.10 元截断。
|
||||||
|
* 创客卓越 5% 只发一层。
|
||||||
*/
|
*/
|
||||||
class MakerPeerReward
|
class MakerPeerReward
|
||||||
{
|
{
|
||||||
public function run($order, $buyerId, $chain, $diffResult, ActiveService $active, $rules = null)
|
public function run($order, $buyerId, $chain, $diffResult, ActiveService $active, $rules = null)
|
||||||
{
|
{
|
||||||
$bonus = (!empty($rules['maker_bonus']) && is_array($rules['maker_bonus']))
|
|
||||||
? $rules['maker_bonus']
|
|
||||||
: PartnerConfig::makerBonus();
|
|
||||||
$peerRate = (isset($rules['maker_peer_rate']) && is_numeric($rules['maker_peer_rate']))
|
$peerRate = (isset($rules['maker_peer_rate']) && is_numeric($rules['maker_peer_rate']))
|
||||||
? (float) $rules['maker_peer_rate']
|
? (float) $rules['maker_peer_rate']
|
||||||
: (float) PartnerConfig::get('partner_maker_peer_rate', 0.10);
|
: (float) PartnerConfig::get('partner_maker_peer_rate', 0.10);
|
||||||
@@ -38,9 +36,13 @@ class MakerPeerReward
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$levelBonus = (float) ($bonus[$item['level']] ?? 0);
|
$itemAmount = (float) ($item['amount'] ?? 0);
|
||||||
|
if ($itemAmount <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$currentFrom = $from;
|
$currentFrom = $from;
|
||||||
$currentBase = $levelBonus;
|
$currentBase = $itemAmount;
|
||||||
$sourceUserId = $item['user_id'];
|
$sourceUserId = $item['user_id'];
|
||||||
|
|
||||||
for ($gen = 1; $gen <= $maxPeerGenerations; $gen++) {
|
for ($gen = 1; $gen <= $maxPeerGenerations; $gen++) {
|
||||||
|
|||||||
@@ -290,6 +290,7 @@ class PartnerConfig
|
|||||||
'not_maker' => '不是' . $maker . '身份',
|
'not_maker' => '不是' . $maker . '身份',
|
||||||
'not_venue' => '不是' . $venue . '身份',
|
'not_venue' => '不是' . $venue . '身份',
|
||||||
'not_county' => '不是' . $county . '身份',
|
'not_county' => '不是' . $county . '身份',
|
||||||
|
'venue_above_county' => '县以上酒道馆无收益',
|
||||||
'cap_not_higher' => '等级未超过基数水位',
|
'cap_not_higher' => '等级未超过基数水位',
|
||||||
'already_settled' => '幂等跳过',
|
'already_settled' => '幂等跳过',
|
||||||
'partner_goods_off' => '商品未参与',
|
'partner_goods_off' => '商品未参与',
|
||||||
@@ -302,6 +303,7 @@ class PartnerConfig
|
|||||||
'not_maker' => '',
|
'not_maker' => '',
|
||||||
'not_venue' => '',
|
'not_venue' => '',
|
||||||
'not_county' => '',
|
'not_county' => '',
|
||||||
|
'venue_above_county' => '县以上的酒道馆不发放管理奖',
|
||||||
'cap_not_higher' => '同阶不计进阶差额,享受平级奖励',
|
'cap_not_higher' => '同阶不计进阶差额,享受平级奖励',
|
||||||
'already_settled' => '',
|
'already_settled' => '',
|
||||||
'partner_goods_off' => '',
|
'partner_goods_off' => '',
|
||||||
|
|||||||
@@ -3,7 +3,11 @@
|
|||||||
namespace addons\shopro\service\partner;
|
namespace addons\shopro\service\partner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 渠道管理奖(馆/县拆分):无馆有县=100;有馆有县=50+50;有馆无县=50
|
* 渠道管理奖(馆/县拆分),链下标越小越靠近买家:
|
||||||
|
* - 无馆有县:县 100
|
||||||
|
* - 有馆无县:馆 50
|
||||||
|
* - 最近的馆在最近的县下方,或馆与县是同一人:馆 50 + 县 50
|
||||||
|
* - 最近的县在最近的馆下方:县 100,县以上的馆不发
|
||||||
*/
|
*/
|
||||||
class TeamSplitReward
|
class TeamSplitReward
|
||||||
{
|
{
|
||||||
@@ -18,14 +22,18 @@ class TeamSplitReward
|
|||||||
$result = ['venue' => null, 'county' => null];
|
$result = ['venue' => null, 'county' => null];
|
||||||
|
|
||||||
$venue = $this->nearest($chain, 'is_venue', $active);
|
$venue = $this->nearest($chain, 'is_venue', $active);
|
||||||
$county = $this->nearestCounty($chain, $venue, $active);
|
$county = $this->nearest($chain, 'is_county', $active);
|
||||||
|
|
||||||
if (!$venue && !$county) {
|
if (!$venue && !$county) {
|
||||||
PartnerRewardService::writeSkip($order, $buyerId, 0, 'team_venue', 'system', 'not_venue', '链上无酒道馆且无区县');
|
PartnerRewardService::writeSkip($order, $buyerId, 0, 'team_venue', 'system', 'not_venue', '链上无酒道馆且无区县');
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($venue) {
|
// 县比馆更靠近买家时,馆在县之上,不发酒道馆管理奖
|
||||||
|
$venueAboveCounty = $venue && $county && intval($venue['index']) > intval($county['index']);
|
||||||
|
$venueEarns = $venue && !$venueAboveCounty;
|
||||||
|
|
||||||
|
if ($venueEarns) {
|
||||||
if ($venue['inactive']) {
|
if ($venue['inactive']) {
|
||||||
PartnerRewardService::writeSkip($order, $buyerId, $venue['user_id'], 'team_venue', 'venue', 'inactive_30d', '酒道馆 30 日无自购');
|
PartnerRewardService::writeSkip($order, $buyerId, $venue['user_id'], 'team_venue', 'venue', 'inactive_30d', '酒道馆 30 日无自购');
|
||||||
} else {
|
} else {
|
||||||
@@ -34,22 +42,30 @@ class TeamSplitReward
|
|||||||
]);
|
]);
|
||||||
$result['venue'] = ['user_id' => $venue['user_id'], 'amount' => $venueSplit, 'index' => $venue['index']];
|
$result['venue'] = ['user_id' => $venue['user_id'], 'amount' => $venueSplit, 'index' => $venue['index']];
|
||||||
}
|
}
|
||||||
|
} elseif ($venueAboveCounty) {
|
||||||
|
PartnerRewardService::writeSkip($order, $buyerId, $venue['user_id'], 'team_venue', 'venue', 'venue_above_county', '县以上酒道馆无收益');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($county) {
|
if ($county) {
|
||||||
$amount = $venue ? $venueSplit : $countyFull;
|
$amount = $venueEarns ? $venueSplit : $countyFull;
|
||||||
if ($county['inactive']) {
|
if ($county['inactive']) {
|
||||||
PartnerRewardService::writeSkip($order, $buyerId, $county['user_id'], 'team_county', 'county', 'inactive_30d', '区县 30 日无自购');
|
PartnerRewardService::writeSkip($order, $buyerId, $county['user_id'], 'team_county', 'county', 'inactive_30d', '区县 30 日无自购');
|
||||||
} else {
|
} else {
|
||||||
$formulaText = $venue
|
if ($venue && intval($venue['user_id']) === intval($county['user_id'])) {
|
||||||
? (($venue['user_id'] == $county['user_id']) ? "区县管理奖 {$amount}(馆兼县)" : "区县管理奖 {$amount}(馆上)")
|
$formulaText = "区县管理奖 {$amount}(馆兼县)";
|
||||||
: "区县管理奖 {$amount}(直达)";
|
} elseif ($venueEarns) {
|
||||||
|
$formulaText = "区县管理奖 {$amount}(馆上)";
|
||||||
|
} elseif ($venueAboveCounty) {
|
||||||
|
$formulaText = "区县管理奖 {$amount}(县在馆下)";
|
||||||
|
} else {
|
||||||
|
$formulaText = "区县管理奖 {$amount}(直达)";
|
||||||
|
}
|
||||||
PartnerRewardService::account($order, $buyerId, $county['user_id'], 'team_county', 'county', $amount, $amount, [
|
PartnerRewardService::account($order, $buyerId, $county['user_id'], 'team_county', 'county', $amount, $amount, [
|
||||||
'formula' => $formulaText,
|
'formula' => $formulaText,
|
||||||
]);
|
]);
|
||||||
$result['county'] = ['user_id' => $county['user_id'], 'amount' => $amount, 'index' => $county['index']];
|
$result['county'] = ['user_id' => $county['user_id'], 'amount' => $amount, 'index' => $county['index']];
|
||||||
}
|
}
|
||||||
} elseif ($venue && !$county) {
|
} elseif ($venue) {
|
||||||
PartnerRewardService::writeSkip($order, $buyerId, 0, 'team_county', 'system', 'not_county', '有馆无区县');
|
PartnerRewardService::writeSkip($order, $buyerId, 0, 'team_county', 'system', 'not_county', '有馆无区县');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,26 +87,4 @@ class TeamSplitReward
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function nearestCounty($chain, $venue, ActiveService $active)
|
|
||||||
{
|
|
||||||
// 若酒道馆节点本身兼任区县代理,允许从该酒道馆节点开始匹配(兼具双重身份场景);若未兼任,循环会自动检查其上一级
|
|
||||||
$start = $venue ? $venue['index'] : 0;
|
|
||||||
for ($i = $start; $i < count($chain); $i++) {
|
|
||||||
if (!intval($chain[$i]['is_county'] ?? 0)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return [
|
|
||||||
'user_id' => $chain[$i]['user_id'],
|
|
||||||
'index' => $i,
|
|
||||||
'inactive' => !$active->isActive($chain[$i]['agent'] ?? $chain[$i]),
|
|
||||||
'node' => $chain[$i],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
// 无馆时从链头找区县(含自购区县)
|
|
||||||
if (!$venue) {
|
|
||||||
return $this->nearest($chain, 'is_county', $active);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class Agent extends Common
|
|||||||
$detail->next_push3_text = '第 ' . ($seq + 1) . ' 单将返 ' . $detail->next_push3_amount;
|
$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->last_self_order_text = $last ? date('Y-m-d H:i:s', $last) : '从未下单';
|
||||||
|
|
||||||
// 业务核心规范:进阶角色(创客V1~V6、酒道馆、区县代理、合伙股东)需自购考核;基础会员及品酒师免自购考核
|
// 业务核心规范:进阶角色(创客V1~V6、酒道馆、区县代理、合伙人)需自购考核;基础会员及品酒师免自购考核
|
||||||
if (!$isAdvanced) {
|
if (!$isAdvanced) {
|
||||||
$detail->active_status_text = '免自购考核 (基础会员/品酒师)';
|
$detail->active_status_text = '免自购考核 (基础会员/品酒师)';
|
||||||
} else {
|
} else {
|
||||||
@@ -101,18 +101,232 @@ class Agent extends Common
|
|||||||
$detail->total_income = $alignedIncome;
|
$detail->total_income = $alignedIncome;
|
||||||
$detail->partner_cash_income = $alignedIncome;
|
$detail->partner_cash_income = $alignedIncome;
|
||||||
$detail->push3_cash_income = number_format((float) $push3Cash, 2, '.', '');
|
$detail->push3_cash_income = number_format((float) $push3Cash, 2, '.', '');
|
||||||
$detail->partner_exclusive_cash = number_format((float) $partnerExclusiveCash, 2, '.', '');
|
$userData = $detail->user ? $detail->user->getData() : [];
|
||||||
$detail->user_money = number_format(floatval($detail->user ? $detail->user->money : 0), 2, '.', '');
|
$userMoney = $userData['money'] ?? 0;
|
||||||
$detail->user_commission = number_format(floatval($detail->user ? $detail->user->commission : 0), 2, '.', '');
|
$userCommission = $userData['commission'] ?? 0;
|
||||||
|
$detail->user_money = number_format(floatval($userMoney), 2, '.', '');
|
||||||
|
$detail->user_commission = number_format(floatval($userCommission), 2, '.', '');
|
||||||
$detail->partner_mode = \addons\shopro\service\partner\PartnerConfig::isPartnerMode() ? 1 : 0;
|
$detail->partner_mode = \addons\shopro\service\partner\PartnerConfig::isPartnerMode() ? 1 : 0;
|
||||||
$rate = (new \addons\shopro\service\partner\RateService())->currentRate();
|
$rate = (new \addons\shopro\service\partner\RateService())->currentRate();
|
||||||
$detail->madow_value = \addons\shopro\service\partner\IdentityService::formatMoney((float) ($detail->madow ?? 0) * (float) $rate);
|
$detail->madow_value = \addons\shopro\service\partner\IdentityService::formatMoney((float) ($detail->madow ?? 0) * (float) $rate);
|
||||||
$detail->custom_role_names = \addons\shopro\service\partner\PartnerConfig::roleNames();
|
$detail->custom_role_names = \addons\shopro\service\partner\PartnerConfig::roleNames();
|
||||||
$detail->role_names = $detail->custom_role_names;
|
$detail->role_names = $detail->custom_role_names;
|
||||||
|
$detail->operational_stats = $this->getOperationalStats($detail, $id);
|
||||||
|
|
||||||
$this->success('分销商详情', null, $detail);
|
$this->success('分销商详情', null, $detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建运营官全景统计数据看板
|
||||||
|
*/
|
||||||
|
private function getOperationalStats($detail, $id)
|
||||||
|
{
|
||||||
|
// 建立邻接表,使用广度优先遍历(BFS)安全获取全部后代节点,杜绝潜在脏数据循环引用死循环
|
||||||
|
$allUsers = \think\Db::name('user')->column('parent_user_id', 'id');
|
||||||
|
$children = [];
|
||||||
|
foreach ($allUsers as $cid => $pid) {
|
||||||
|
if ($pid) {
|
||||||
|
$children[$pid][] = (int)$cid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$descIds = [];
|
||||||
|
$queue = [(int)$id];
|
||||||
|
$visited = [(int)$id => true];
|
||||||
|
while (!empty($queue)) {
|
||||||
|
$curr = array_shift($queue);
|
||||||
|
if (!empty($children[$curr])) {
|
||||||
|
foreach ($children[$curr] as $cid) {
|
||||||
|
if (!isset($visited[$cid])) {
|
||||||
|
$visited[$cid] = true;
|
||||||
|
$descIds[] = $cid;
|
||||||
|
$queue[] = $cid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$directIds = $children[(int)$id] ?? [];
|
||||||
|
|
||||||
|
// 1. 团队角色拓扑
|
||||||
|
$directCount = count($directIds);
|
||||||
|
$directPaidCount = empty($directIds) ? 0 : \think\Db::name('user')->whereIn('id', $directIds)->where('total_consume', '>', 0)->count();
|
||||||
|
$directMakerCount = empty($directIds) ? 0 : \think\Db::name('shopro_commission_agent')->whereIn('user_id', $directIds)->where('level', '>=', 2)->count();
|
||||||
|
|
||||||
|
$teamDescCount = count($descIds);
|
||||||
|
$teamPaidCount = empty($descIds) ? 0 : \think\Db::name('user')->whereIn('id', $descIds)->where('total_consume', '>', 0)->count();
|
||||||
|
$teamMakerAgents = empty($descIds) ? [] : \think\Db::name('shopro_commission_agent')->whereIn('user_id', $descIds)->where('level', '>=', 2)->column('level');
|
||||||
|
$teamMakerCount = count($teamMakerAgents);
|
||||||
|
$teamMakerDistribution = array_count_values($teamMakerAgents);
|
||||||
|
ksort($teamMakerDistribution);
|
||||||
|
$makerDistribution = [
|
||||||
|
'v1' => intval($teamMakerDistribution[2] ?? 0),
|
||||||
|
'v2' => intval($teamMakerDistribution[3] ?? 0),
|
||||||
|
'v3' => intval($teamMakerDistribution[4] ?? 0),
|
||||||
|
'v4' => intval($teamMakerDistribution[5] ?? 0),
|
||||||
|
'v5' => intval($teamMakerDistribution[6] ?? 0),
|
||||||
|
'v6' => intval($teamMakerDistribution[7] ?? 0),
|
||||||
|
];
|
||||||
|
$teamVenueCount = empty($descIds) ? 0 : \think\Db::name('shopro_commission_agent')->whereIn('user_id', $descIds)->where('is_venue', 1)->count();
|
||||||
|
$teamCountyCount = empty($descIds) ? 0 : \think\Db::name('shopro_commission_agent')->whereIn('user_id', $descIds)->where('is_county', 1)->count();
|
||||||
|
$conversionRate = $teamDescCount > 0 ? round(($teamPaidCount / $teamDescCount) * 100, 1) : 0.0;
|
||||||
|
|
||||||
|
// 2. 收益分成细项
|
||||||
|
$rewards = \think\Db::name('shopro_partner_reward')
|
||||||
|
->where('user_id', $id)
|
||||||
|
->where('status', 1)
|
||||||
|
->group('reward_type')
|
||||||
|
->column('sum(amount)', 'reward_type');
|
||||||
|
|
||||||
|
$push3Income = (float)($rewards['push3'] ?? 0);
|
||||||
|
$makerDiffIncome = (float)($rewards['maker_diff'] ?? 0);
|
||||||
|
$makerPeerIncome = (float)(($rewards['maker_peer'] ?? 0) + ($rewards['maker_overtaken'] ?? 0));
|
||||||
|
$teamSplitIncome = (float)(($rewards['team_venue'] ?? 0) + ($rewards['team_county'] ?? 0));
|
||||||
|
$sharePoolIncome = (float)(($rewards['venue_share'] ?? 0) + ($rewards['county_share'] ?? 0));
|
||||||
|
|
||||||
|
// 3. 业绩与订单分类
|
||||||
|
$selfOrderMoney = number_format((float)($detail->child_order_money_0 ?? 0), 2, '.', '');
|
||||||
|
$selfOrderCount = intval($detail->child_order_count_0 ?? 0);
|
||||||
|
$directOrderMoney = number_format((float)($detail->child_order_money_1 ?? 0), 2, '.', '');
|
||||||
|
$directOrderCount = intval($detail->child_order_count_1 ?? 0);
|
||||||
|
$teamOrderMoney = number_format((float)($detail->child_order_money_all ?? 0), 2, '.', '');
|
||||||
|
$teamOrderCount = intval($detail->child_order_count_all ?? 0);
|
||||||
|
|
||||||
|
$indirectOrderMoney = number_format(max(0, (float)$teamOrderMoney - (float)$directOrderMoney - (float)$selfOrderMoney), 2, '.', '');
|
||||||
|
$indirectOrderCount = max(0, $teamOrderCount - $directOrderCount - $selfOrderCount);
|
||||||
|
|
||||||
|
// 4. 晋升考核差距雷达
|
||||||
|
$currentLevel = intval($detail->level ?? 1);
|
||||||
|
$currentLevelRow = \think\Db::name('shopro_commission_level')->where('level', $currentLevel)->find();
|
||||||
|
$currentLevelName = $currentLevelRow ? $currentLevelRow['name'] : ($currentLevel >= 2 ? '创客V' . ($currentLevel - 1) : '品酒师');
|
||||||
|
|
||||||
|
$nextLevel = $currentLevel + 1;
|
||||||
|
$nextLevelRow = \think\Db::name('shopro_commission_level')->where('level', $nextLevel)->find();
|
||||||
|
|
||||||
|
if ($nextLevelRow) {
|
||||||
|
$nextRules = json_decode($nextLevelRow['upgrade_rules'] ?? '[]', true) ?: [];
|
||||||
|
$targetDirectUsers = intval($nextRules['child_user_count_1'] ?? 0);
|
||||||
|
$targetTeamOrders = intval($nextRules['child_order_count_all'] ?? 0);
|
||||||
|
|
||||||
|
// 解析直推有效品酒师/创客指标要求
|
||||||
|
$targetDirectAgents = 0;
|
||||||
|
if (!empty($nextRules['child_agent_level_1']) && is_array($nextRules['child_agent_level_1'])) {
|
||||||
|
foreach ($nextRules['child_agent_level_1'] as $al) {
|
||||||
|
$targetDirectAgents += intval($al['count'] ?? 0);
|
||||||
|
}
|
||||||
|
} elseif (!empty($nextRules['child_agent_count_1'])) {
|
||||||
|
$targetDirectAgents = intval($nextRules['child_agent_count_1']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentDirectUsers = intval($detail->child_user_count_1 ?? $directCount);
|
||||||
|
$currentDirectAgents = intval($detail->child_agent_count_1 ?? $directPaidCount);
|
||||||
|
$currentTeamOrders = intval($detail->child_order_count_all ?? 0);
|
||||||
|
$currentSelfMoney = (float)($detail->child_order_money_0 ?? 0);
|
||||||
|
|
||||||
|
$directUserGap = max(0, $targetDirectUsers - $currentDirectUsers);
|
||||||
|
$directAgentGap = max(0, $targetDirectAgents - $currentDirectAgents);
|
||||||
|
$teamOrderGap = max(0, $targetTeamOrders - $currentTeamOrders);
|
||||||
|
$isSelfPaid = ($selfOrderCount > 0 || $currentSelfMoney >= 1398);
|
||||||
|
|
||||||
|
$directUserPercent = $targetDirectUsers > 0 ? min(100, (int)round(($currentDirectUsers / $targetDirectUsers) * 100)) : 100;
|
||||||
|
$directAgentPercent = $targetDirectAgents > 0 ? min(100, (int)round(($currentDirectAgents / $targetDirectAgents) * 100)) : 100;
|
||||||
|
$teamOrderPercent = $targetTeamOrders > 0 ? min(100, (int)round(($currentTeamOrders / $targetTeamOrders) * 100)) : 100;
|
||||||
|
|
||||||
|
$upgradeRadar = [
|
||||||
|
'current_level' => $currentLevel,
|
||||||
|
'current_level_name' => $currentLevelName,
|
||||||
|
'next_level' => $nextLevel,
|
||||||
|
'next_level_name' => $nextLevelRow['name'],
|
||||||
|
'target_direct_users' => $targetDirectUsers,
|
||||||
|
'current_direct_users' => $currentDirectUsers,
|
||||||
|
'direct_user_gap' => $directUserGap,
|
||||||
|
'direct_user_reached' => ($directUserGap === 0),
|
||||||
|
'direct_user_percent' => $directUserPercent,
|
||||||
|
'target_direct_agents' => $targetDirectAgents,
|
||||||
|
'current_direct_agents' => $currentDirectAgents,
|
||||||
|
'direct_agent_gap' => $directAgentGap,
|
||||||
|
'direct_agent_reached' => ($directAgentGap === 0),
|
||||||
|
'direct_agent_percent' => $directAgentPercent,
|
||||||
|
'target_team_orders' => $targetTeamOrders,
|
||||||
|
'current_team_orders' => $currentTeamOrders,
|
||||||
|
'team_order_gap' => $teamOrderGap,
|
||||||
|
'team_order_reached' => ($teamOrderGap === 0),
|
||||||
|
'team_order_percent' => $teamOrderPercent,
|
||||||
|
'self_paid_reached' => $isSelfPaid,
|
||||||
|
'all_reached' => ($directUserGap === 0 && $directAgentGap === 0 && $teamOrderGap === 0 && $isSelfPaid),
|
||||||
|
'upgrade_lock' => intval($detail->upgrade_lock ?? 0)
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$upgradeRadar = [
|
||||||
|
'current_level' => $currentLevel,
|
||||||
|
'current_level_name' => $currentLevelName,
|
||||||
|
'next_level' => 0,
|
||||||
|
'next_level_name' => '已达最高职级',
|
||||||
|
'target_direct_users' => 0,
|
||||||
|
'current_direct_users' => intval($detail->child_user_count_1 ?? $directCount),
|
||||||
|
'direct_user_gap' => 0,
|
||||||
|
'direct_user_reached' => true,
|
||||||
|
'direct_user_percent' => 100,
|
||||||
|
'target_direct_agents' => 0,
|
||||||
|
'current_direct_agents' => intval($detail->child_agent_count_1 ?? $directPaidCount),
|
||||||
|
'direct_agent_gap' => 0,
|
||||||
|
'direct_agent_reached' => true,
|
||||||
|
'direct_agent_percent' => 100,
|
||||||
|
'target_team_orders' => 0,
|
||||||
|
'current_team_orders' => intval($detail->child_order_count_all ?? 0),
|
||||||
|
'team_order_gap' => 0,
|
||||||
|
'team_order_reached' => true,
|
||||||
|
'team_order_percent' => 100,
|
||||||
|
'self_paid_reached' => true,
|
||||||
|
'all_reached' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'roles' => [
|
||||||
|
'direct_total' => $directCount,
|
||||||
|
'direct_paid' => $directPaidCount,
|
||||||
|
'direct_unpaid' => max(0, $directCount - $directPaidCount),
|
||||||
|
'direct_maker' => $directMakerCount,
|
||||||
|
'team_total' => $teamDescCount,
|
||||||
|
'team_paid' => $teamPaidCount,
|
||||||
|
'team_unpaid' => max(0, $teamDescCount - $teamPaidCount),
|
||||||
|
'team_conversion_rate' => $conversionRate,
|
||||||
|
'team_maker' => $teamMakerCount,
|
||||||
|
'team_maker_distribution' => $makerDistribution,
|
||||||
|
'team_venue' => $teamVenueCount,
|
||||||
|
'team_county' => $teamCountyCount,
|
||||||
|
],
|
||||||
|
'orders' => [
|
||||||
|
'self_money' => $selfOrderMoney,
|
||||||
|
'self_count' => $selfOrderCount,
|
||||||
|
'direct_money' => $directOrderMoney,
|
||||||
|
'direct_count' => $directOrderCount,
|
||||||
|
'indirect_money' => $indirectOrderMoney,
|
||||||
|
'indirect_count' => $indirectOrderCount,
|
||||||
|
'team_money' => $teamOrderMoney,
|
||||||
|
'team_count' => $teamOrderCount,
|
||||||
|
],
|
||||||
|
'rewards' => [
|
||||||
|
'push3' => number_format($push3Income, 2, '.', ''),
|
||||||
|
'maker_diff' => number_format($makerDiffIncome, 2, '.', ''),
|
||||||
|
'maker_peer' => number_format($makerPeerIncome, 2, '.', ''),
|
||||||
|
'maker_total' => number_format($makerDiffIncome + $makerPeerIncome, 2, '.', ''),
|
||||||
|
'team_split' => number_format($teamSplitIncome, 2, '.', ''),
|
||||||
|
'share_pool' => number_format($sharePoolIncome, 2, '.', ''),
|
||||||
|
],
|
||||||
|
'assets' => [
|
||||||
|
'wallet_money' => $detail->user_money,
|
||||||
|
'total_income' => $detail->total_income,
|
||||||
|
'untransfer_commission' => $detail->user_commission,
|
||||||
|
'dmepa_madow' => number_format((float)($detail->madow ?? 0), 4, '.', ''),
|
||||||
|
'dmepa_value' => $detail->madow_value,
|
||||||
|
'voucher_total' => number_format((float)($detail->voucher_total ?? 0), 2, '.', ''),
|
||||||
|
'voucher_released' => number_format((float)($detail->voucher_released ?? 0), 2, '.', ''),
|
||||||
|
'voucher_available' => number_format(max(0, (float)($detail->voucher_released ?? 0) - (float)($detail->voucher_used ?? 0)), 2, '.', ''),
|
||||||
|
],
|
||||||
|
'upgrade_radar' => $upgradeRadar
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 团队
|
* 团队
|
||||||
|
|||||||
@@ -156,6 +156,122 @@
|
|||||||
.agent-detail .rewards-item:last-of-type {
|
.agent-detail .rewards-item:last-of-type {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 运营官全景看板样式 */
|
||||||
|
.agent-detail .op-dashboard {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--sa-border);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 18px 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-section-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--sa-title);
|
||||||
|
margin: 16px 0 12px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
border-bottom: 1px dashed var(--sa-border);
|
||||||
|
}
|
||||||
|
.agent-detail .op-section-title:first-of-type {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-radar-card {
|
||||||
|
background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 14px 18px;
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-radar-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-radar-title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #2d3748;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-radar-body {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-radar-metric {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 10px 14px;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 180px;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.02);
|
||||||
|
}
|
||||||
|
.agent-detail .op-radar-metric .m-label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #718096;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.agent-detail .op-radar-metric .m-val {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1a202c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agent-detail .op-grid-box {
|
||||||
|
background: #fbfcfe;
|
||||||
|
border: 1px solid #edf2f7;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
min-height: 120px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.agent-detail .op-grid-box:hover {
|
||||||
|
border-color: #cbd5e0;
|
||||||
|
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
||||||
|
}
|
||||||
|
.agent-detail .op-grid-box .box-title {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #334155;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.agent-detail .op-stat-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-stat-row .stat-label {
|
||||||
|
color: #64748b;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.agent-detail .op-stat-row .stat-val {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1e293b;
|
||||||
|
}
|
||||||
|
.agent-detail .op-stat-row .stat-val.primary { color: #3b82f6; }
|
||||||
|
.agent-detail .op-stat-row .stat-val.success { color: #10b981; }
|
||||||
|
.agent-detail .op-stat-row .stat-val.warning { color: #f59e0b; }
|
||||||
|
.agent-detail .op-stat-row .stat-val.danger { color: #ef4444; }
|
||||||
|
.agent-detail .op-stat-row .stat-val.purple { color: #8b5cf6; }
|
||||||
|
.agent-detail .op-stat-row .stat-val.cyan { color: #06b6d4; }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="detail" class="agent-detail panel panel-default panel-intro" v-cloak>
|
<div id="detail" class="agent-detail panel panel-default panel-intro" v-cloak>
|
||||||
@@ -296,9 +412,13 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="允许自动升级:">
|
<el-form-item label="允许自动升级:">
|
||||||
{if $auth->check('shopro/commission/agent/edit')}
|
{if $auth->check('shopro/commission/agent/edit')}
|
||||||
<el-switch v-model="state.data.upgrade_lock" :active-value="0" :inactive-value="1"
|
<div class="sa-flex sa-flex-wrap" style="gap: 8px; align-items: center;">
|
||||||
@change="state.data.user_id?onEdit({upgrade_lock: state.data.upgrade_lock}): ''">
|
<el-switch v-model="state.data.upgrade_lock" :active-value="0" :inactive-value="1"
|
||||||
</el-switch>
|
@change="state.data.user_id?onEdit({upgrade_lock: state.data.upgrade_lock}): ''">
|
||||||
|
</el-switch>
|
||||||
|
<span style="font-size: 12px; color: #10b981;" v-if="state.data.upgrade_lock == 0">已允许 (达标自动晋升)</span>
|
||||||
|
<span style="font-size: 12px; color: #ef4444;" v-else>⚠️ 已锁定 (禁止自动晋升)</span>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="直推奖(推三返一):">
|
<el-form-item label="直推奖(推三返一):">
|
||||||
@@ -334,9 +454,9 @@
|
|||||||
{{ state.data.is_county ? '已开通' + (state.data.county_code ? ' (' + state.data.county_code + ')' : '') : '未开通' }}
|
{{ state.data.is_county ? '已开通' + (state.data.county_code ? ' (' + state.data.county_code + ')' : '') : '未开通' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="(state.data.custom_role_names?.partner || '合伙股东') + ':'">
|
<el-form-item :label="(state.data.custom_role_names?.partner || '合伙人') + ':'">
|
||||||
<el-tag size="small" :type="state.data.is_partner ? 'danger' : 'info'">
|
<el-tag size="small" :type="state.data.is_partner ? 'danger' : 'info'">
|
||||||
{{ state.data.is_partner ? '已授予' + (state.data.custom_role_names?.partner || '合伙股东') : '未开通' }}
|
{{ state.data.is_partner ? '已授予' + (state.data.custom_role_names?.partner || '合伙人') : '未开通' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="30天自购考核:">
|
<el-form-item label="30天自购考核:">
|
||||||
@@ -367,13 +487,13 @@
|
|||||||
<el-tag type="info" effect="plain" size="small">{{ state.data.identity_text || ('基础会员 · ' + (state.data.custom_role_names?.taster || '品酒师')) }}</el-tag>
|
<el-tag type="info" effect="plain" size="small">{{ state.data.identity_text || ('基础会员 · ' + (state.data.custom_role_names?.taster || '品酒师')) }}</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div style="font-size: 12px; color: var(--sa-subfont); line-height: 1.6; background: #f8fafc; border: 1px dashed var(--sa-border); border-radius: 4px; padding: 8px 12px; margin: 4px 0 10px;">
|
<div style="font-size: 12px; color: var(--sa-subfont); line-height: 1.6; background: #f8fafc; border: 1px dashed var(--sa-border); border-radius: 4px; padding: 8px 12px; margin: 4px 0 10px;">
|
||||||
💡 <strong>进阶角色体系说明</strong>:系统拥有{{ state.data.custom_role_names?.maker || '创客' }}(V1~V6)、{{ state.data.custom_role_names?.venue || '酒道馆' }}、{{ state.data.custom_role_names?.county || '区县代理' }}、{{ state.data.custom_role_names?.partner || '合伙股东' }}等独立进阶角色,享有团队分润与平台日结分红。当前会员为基础会员,享有推三返一,<strong>免自购考核</strong>。
|
💡 <strong>进阶角色体系说明</strong>:系统拥有{{ state.data.custom_role_names?.maker || '创客' }}(V1~V6)、{{ state.data.custom_role_names?.venue || '酒道馆' }}、{{ state.data.custom_role_names?.county || '区县代理' }}、{{ state.data.custom_role_names?.partner || '合伙人' }}等独立进阶角色,享有团队分润与平台日结分红。当前会员为基础会员,享有推三返一,<strong>免自购考核</strong>。
|
||||||
</div>
|
</div>
|
||||||
<el-form-item label="自购考核要求:">
|
<el-form-item label="自购考核要求:">
|
||||||
<el-tag size="small" type="info">免自购考核 (基础会员/{{ state.data.custom_role_names?.taster || '品酒师' }})</el-tag>
|
<el-tag size="small" type="info">免自购考核 (基础会员/{{ state.data.custom_role_names?.taster || '品酒师' }})</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="进阶权益:">
|
<el-form-item label="进阶权益:">
|
||||||
<span style="color: var(--sa-subfont);">升级{{ state.data.custom_role_names?.maker || '创客' }}或开通{{ (state.data.custom_role_names?.venue || '馆').substr(0, 1) }}/{{ (state.data.custom_role_names?.county || '县').substr(0, 1) }}/{{ (state.data.custom_role_names?.partner || '股东').substr(0, 2) }}后即可享有团队奖、级差奖与dmepa分红</span>
|
<span style="color: var(--sa-subfont);">升级{{ state.data.custom_role_names?.maker || '创客' }}或开通{{ (state.data.custom_role_names?.venue || '馆').substr(0, 1) }}/{{ (state.data.custom_role_names?.county || '县').substr(0, 1) }}/{{ (state.data.custom_role_names?.partner || '合伙').substr(0, 2) }}后即可享有团队奖、级差奖与dmepa分红</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -443,219 +563,375 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="sa-col-24" :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
<el-col class="sa-col-24" :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||||
<el-row class="dashboard-content agent-content">
|
<div class="dashboard-content agent-content op-dashboard" v-if="state.data && state.data.operational_stats">
|
||||||
<el-col :span="24">
|
<!-- 模块一:🎯 晋升考核与升级差距雷达 (Upgrade Radar) -->
|
||||||
<div class="title sa-flex">
|
<div class="op-radar-card" v-if="state.data.operational_stats.upgrade_radar">
|
||||||
<span>团队统计</span>
|
<div class="op-radar-header">
|
||||||
|
<div class="op-radar-title">
|
||||||
|
<span style="font-size: 16px;">🎯</span>
|
||||||
|
<span>晋升考核与升级差距雷达</span>
|
||||||
|
<el-tag size="small" effect="plain" type="info">
|
||||||
|
当前:{{ state.data.operational_stats.upgrade_radar.current_level_name }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tag size="small" type="primary" effect="dark" v-if="state.data.operational_stats.upgrade_radar.next_level > 0">
|
||||||
|
目标:{{ state.data.operational_stats.upgrade_radar.next_level_name }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tag size="small" type="success" effect="dark" v-else>
|
||||||
|
已达顶级
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-tag v-if="state.data.operational_stats.upgrade_radar.upgrade_lock" type="danger" size="small">
|
||||||
|
⚠️ 升级已被锁定(禁止自动晋升)
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else-if="state.data.operational_stats.upgrade_radar.all_reached" type="success" size="small">
|
||||||
|
✓ 晋升条件全部达成
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else-if="state.data.operational_stats.upgrade_radar.next_level > 0" type="warning" size="small">
|
||||||
|
考核晋升中
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="op-radar-body" v-if="state.data.operational_stats.upgrade_radar.next_level > 0">
|
||||||
|
<!-- 直推实名/有效品酒师考核 -->
|
||||||
|
<div class="op-radar-metric" v-if="state.data.operational_stats.upgrade_radar.target_direct_agents > 0">
|
||||||
|
<div class="m-label">
|
||||||
|
<span>
|
||||||
|
直推有效品酒师
|
||||||
|
<el-popover placement="top" trigger="hover" content="需直推用户完成首单自购(child_order_count_0 ≥ 1)激活为有效品酒师">
|
||||||
|
<template #reference>
|
||||||
|
<span style="cursor: pointer; color: #94a3b8; font-size: 11px;">ℹ️ 说明</span>
|
||||||
|
</template>
|
||||||
|
</el-popover>
|
||||||
|
</span>
|
||||||
|
<el-tag size="small" :type="state.data.operational_stats.upgrade_radar.direct_agent_reached ? 'success' : 'danger'">
|
||||||
|
{{ state.data.operational_stats.upgrade_radar.direct_agent_reached ? '已达标' : '缺 ' + state.data.operational_stats.upgrade_radar.direct_agent_gap + ' 人' }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="m-val">
|
||||||
|
{{ state.data.operational_stats.upgrade_radar.current_direct_agents }}
|
||||||
|
<span style="font-size: 12px; color: #94a3b8; font-weight: normal;"> / {{ state.data.operational_stats.upgrade_radar.target_direct_agents }} 人</span>
|
||||||
|
</div>
|
||||||
|
<el-progress :percentage="state.data.operational_stats.upgrade_radar.direct_agent_percent"
|
||||||
|
:status="state.data.operational_stats.upgrade_radar.direct_agent_reached ? 'success' : 'warning'"
|
||||||
|
:stroke-width="6" style="margin-top: 6px;"></el-progress>
|
||||||
|
</div>
|
||||||
|
<div class="op-radar-metric" v-else>
|
||||||
|
<div class="m-label">
|
||||||
|
<span>有效直推人数指标</span>
|
||||||
|
<el-tag size="small" :type="state.data.operational_stats.upgrade_radar.direct_user_reached ? 'success' : 'danger'">
|
||||||
|
{{ state.data.operational_stats.upgrade_radar.direct_user_reached ? '已达标' : '缺 ' + state.data.operational_stats.upgrade_radar.direct_user_gap + ' 人' }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="m-val">
|
||||||
|
{{ state.data.operational_stats.upgrade_radar.current_direct_users }}
|
||||||
|
<span style="font-size: 12px; color: #94a3b8; font-weight: normal;"> / {{ state.data.operational_stats.upgrade_radar.target_direct_users }} 人</span>
|
||||||
|
</div>
|
||||||
|
<el-progress :percentage="state.data.operational_stats.upgrade_radar.direct_user_percent"
|
||||||
|
:status="state.data.operational_stats.upgrade_radar.direct_user_reached ? 'success' : 'warning'"
|
||||||
|
:stroke-width="6" style="margin-top: 6px;"></el-progress>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 团队有效订单考核 -->
|
||||||
|
<div class="op-radar-metric">
|
||||||
|
<div class="m-label">
|
||||||
|
<span>团队有效订单指标</span>
|
||||||
|
<el-tag size="small" :type="state.data.operational_stats.upgrade_radar.team_order_reached ? 'success' : 'danger'">
|
||||||
|
{{ state.data.operational_stats.upgrade_radar.team_order_reached ? '已达标' : '缺 ' + state.data.operational_stats.upgrade_radar.team_order_gap + ' 单' }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="m-val">
|
||||||
|
{{ state.data.operational_stats.upgrade_radar.current_team_orders }}
|
||||||
|
<span style="font-size: 12px; color: #94a3b8; font-weight: normal;"> / {{ state.data.operational_stats.upgrade_radar.target_team_orders }} 单</span>
|
||||||
|
</div>
|
||||||
|
<el-progress :percentage="state.data.operational_stats.upgrade_radar.team_order_percent"
|
||||||
|
:status="state.data.operational_stats.upgrade_radar.team_order_reached ? 'success' : 'warning'"
|
||||||
|
:stroke-width="6" style="margin-top: 6px;"></el-progress>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 个人自购门槛 -->
|
||||||
|
<div class="op-radar-metric">
|
||||||
|
<div class="m-label">
|
||||||
|
<span>个人自购资格门槛</span>
|
||||||
|
<el-tag size="small" :type="state.data.operational_stats.upgrade_radar.self_paid_reached ? 'success' : 'danger'">
|
||||||
|
{{ state.data.operational_stats.upgrade_radar.self_paid_reached ? '已满足' : '未购买' }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="m-val" style="font-size: 14px; margin-top: 4px;">
|
||||||
|
<span v-if="state.data.operational_stats.upgrade_radar.self_paid_reached" style="color: #10b981; font-weight: 600;">✓ 具备业务升级资格</span>
|
||||||
|
<span v-else style="color: #ef4444; font-weight: 600;">✕ 需完成首单自购(≥1398元)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else style="padding: 10px 0; color: #10b981; font-weight: 500; font-size: 13px;">
|
||||||
|
★ 该账号已达到平台顶峰合伙人级别,尊享平台级加权均分红与管理奖励!
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 模块二:👥 团队角色拓扑看板 (Roles & Team) -->
|
||||||
|
<div class="op-section-title">
|
||||||
|
<div class="sa-flex">
|
||||||
|
<span style="font-size: 16px; margin-right: 6px;">👥</span>
|
||||||
|
<span>团队角色与组织拓扑看板</span>
|
||||||
|
</div>
|
||||||
|
<div class="sa-flex">
|
||||||
{if $auth->check('shopro/commission/agent/team')}
|
{if $auth->check('shopro/commission/agent/team')}
|
||||||
<el-button class="ml-2" type="primary" link @click="onTeam">查看团队</el-button>
|
<el-button type="primary" link @click="onTeam">查看层级拓扑树</el-button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<el-row>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="8" :md="8" :lg="8" :xl="8">
|
<el-row :gutter="12">
|
||||||
<div class="left">团队人数:</div>
|
<!-- 直推人员池 -->
|
||||||
<div class="right">
|
<el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
|
||||||
{{ state.data.child_user_count_all }}
|
<div class="op-grid-box">
|
||||||
<span class="unit">人</span>
|
<div class="box-title">
|
||||||
|
<span>直推成员池 (Direct)</span>
|
||||||
|
<el-tag size="small" type="primary">{{ state.data.operational_stats.roles.direct_total }} 人</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="8" :md="8" :lg="8" :xl="8">
|
<span class="stat-label">已首购有效用户:</span>
|
||||||
<div class="left">一级团队人数:</div>
|
<span class="stat-val success">{{ state.data.operational_stats.roles.direct_paid }} 人</span>
|
||||||
<div class="right">
|
|
||||||
{{ state.data.child_user_count_1 }}
|
|
||||||
<span class="unit">人</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="8" :md="8" :lg="8" :xl="8">
|
<span class="stat-label">未购买注册粉丝:</span>
|
||||||
<div class="left">二级团队人数:</div>
|
<span class="stat-val">{{ state.data.operational_stats.roles.direct_unpaid }} 人</span>
|
||||||
<div class="right">
|
|
||||||
{{ state.data.child_user_count_2 }}
|
|
||||||
<span class="unit">人</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="8" :md="8" :lg="8" :xl="8">
|
<span class="stat-label">直推创客领袖:</span>
|
||||||
<div class="left">
|
<span class="stat-val primary">{{ state.data.operational_stats.roles.direct_maker }} 人</span>
|
||||||
团队分销商人数:
|
</div>
|
||||||
<el-popover placement="top" trigger="hover">
|
</div>
|
||||||
<div v-for="(value, key) in state.data.child_agent_level_all"
|
</el-col>
|
||||||
:key="key">
|
|
||||||
等级{{ key }}:{{ value }}人
|
<!-- 核心业务骨干 -->
|
||||||
|
<el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
|
||||||
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">
|
||||||
|
<span>核心业务骨干 (Backbone)</span>
|
||||||
|
<el-popover placement="top" trigger="hover" width="220">
|
||||||
|
<div style="font-size: 12px; line-height: 20px;">
|
||||||
|
<div style="font-weight: 600; margin-bottom: 4px;">创客各级分布:</div>
|
||||||
|
<div>V1创客: {{ state.data.operational_stats.roles.team_maker_distribution.v1 || 0 }} 人</div>
|
||||||
|
<div>V2创客: {{ state.data.operational_stats.roles.team_maker_distribution.v2 || 0 }} 人</div>
|
||||||
|
<div>V3创客: {{ state.data.operational_stats.roles.team_maker_distribution.v3 || 0 }} 人</div>
|
||||||
|
<div>V4创客: {{ state.data.operational_stats.roles.team_maker_distribution.v4 || 0 }} 人</div>
|
||||||
|
<div>V5创客: {{ state.data.operational_stats.roles.team_maker_distribution.v5 || 0 }} 人</div>
|
||||||
|
<div>V6创客: {{ state.data.operational_stats.roles.team_maker_distribution.v6 || 0 }} 人</div>
|
||||||
</div>
|
</div>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<div class="sa-flex">
|
<span style="cursor: pointer; color: #94a3b8; font-size: 13px;">ℹ️ 分布详情</span>
|
||||||
<el-icon v-if="state.data.child_agent_count_all"
|
|
||||||
class="warning">
|
|
||||||
<Warning />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="op-stat-row">
|
||||||
{{ state.data.child_agent_count_all }}
|
<span class="stat-label">创客合伙人 (V1-V6):</span>
|
||||||
<span class="unit">人</span>
|
<span class="stat-val purple">{{ state.data.operational_stats.roles.team_maker }} 人</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="8" :md="8" :lg="8" :xl="8">
|
<span class="stat-label">酒道馆签约馆长:</span>
|
||||||
<div class="left">
|
<span class="stat-val warning">{{ state.data.operational_stats.roles.team_venue }} 个</span>
|
||||||
一级分销商人数:
|
|
||||||
<el-popover placement="top" trigger="hover">
|
|
||||||
<div v-for="(value, key) in state.data.child_agent_level_1" :key="key">
|
|
||||||
等级{{ key }}:{{ value }}人
|
|
||||||
</div>
|
|
||||||
<template #reference>
|
|
||||||
<div class="sa-flex">
|
|
||||||
<el-icon v-if="state.data.child_agent_count_1" class="warning">
|
|
||||||
<Warning />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-popover>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="op-stat-row">
|
||||||
{{ state.data.child_agent_count_1 }}
|
<span class="stat-label">区县代理办事处:</span>
|
||||||
<span class="unit">人</span>
|
<span class="stat-val danger">{{ state.data.operational_stats.roles.team_county }} 个</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="8" :md="8" :lg="8" :xl="8">
|
</el-col>
|
||||||
<div class="left">二级分销商人数:</div>
|
|
||||||
<div class="right">
|
<!-- 团队总网络规模 -->
|
||||||
{{ state.data.child_agent_count_2 }}
|
<el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
|
||||||
<span class="unit">人</span>
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">
|
||||||
|
<span>全网团队规模 (Network)</span>
|
||||||
|
<el-tag size="small" type="success">{{ state.data.operational_stats.roles.team_total }} 人</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
</el-row>
|
<span class="stat-label">全网已出单活跃人数:</span>
|
||||||
</el-col>
|
<span class="stat-val success">{{ state.data.operational_stats.roles.team_paid }} 人</span>
|
||||||
<el-col :span="24">
|
</div>
|
||||||
<div class="title sa-flex">
|
<div class="op-stat-row">
|
||||||
<span>业绩统计</span>
|
<span class="stat-label">全网激活转化率:</span>
|
||||||
|
<span class="stat-val">{{ state.data.operational_stats.roles.team_conversion_rate }}%</span>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">二级直属团队人数:</span>
|
||||||
|
<span class="stat-val">{{ state.data.child_user_count_2 || 0 }} 人</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 模块三:📦 业务业绩与订单流向看板 (Orders & GMV) -->
|
||||||
|
<div class="op-section-title">
|
||||||
|
<div class="sa-flex">
|
||||||
|
<span style="font-size: 16px; margin-right: 6px;">📦</span>
|
||||||
|
<span>业务业绩与订单流向看板</span>
|
||||||
</div>
|
</div>
|
||||||
<el-row>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
<el-row :gutter="12">
|
||||||
<div class="left">团队分销总金额:</div>
|
<!-- 自购订单 -->
|
||||||
<div class="right">
|
<el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
{{ state.data.child_order_money_all }}
|
<div class="op-grid-box">
|
||||||
<span class="unit">元</span>
|
<div class="box-title">个人自购业绩</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">自购成交额:</span>
|
||||||
|
<span class="stat-val success">¥{{ state.data.operational_stats.orders.self_money }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
<span class="stat-label">自购订单数:</span>
|
||||||
<div class="left">一级分销总金额:</div>
|
<span class="stat-val">{{ state.data.operational_stats.orders.self_count }} 单</span>
|
||||||
<div class="right">
|
|
||||||
{{ state.data.child_order_money_1 }}
|
|
||||||
<span class="unit">元</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
</el-col>
|
||||||
<div class="left">二级分销总金额:</div>
|
|
||||||
<div class="right">
|
<!-- 直推订单 (一级) -->
|
||||||
{{ state.data.child_order_money_2 }}
|
<el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
<span class="unit">元</span>
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">直推客户业绩 (一级)</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">直推成交额:</span>
|
||||||
|
<span class="stat-val primary">¥{{ state.data.operational_stats.orders.direct_money }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
<span class="stat-label">直推订单数:</span>
|
||||||
<div class="left">
|
<span class="stat-val">{{ state.data.operational_stats.orders.direct_count }} 单</span>
|
||||||
自购分销总金额:
|
|
||||||
<el-popover popper-class="sa-popper" placement="top" trigger="hover"
|
|
||||||
content="分销商自购分销商品金额统计">
|
|
||||||
<template #reference>
|
|
||||||
<div class="sa-flex">
|
|
||||||
<el-icon class="warning">
|
|
||||||
<Warning />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-popover>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
</div>
|
||||||
{{ state.data.child_order_money_0 }}
|
</el-col>
|
||||||
<span class="unit">元</span>
|
|
||||||
|
<!-- 间推订单 (二级) -->
|
||||||
|
<el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">次级裂变业绩 (二级)</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">间推成交额:</span>
|
||||||
|
<span class="stat-val cyan">¥{{ state.data.operational_stats.orders.indirect_money }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
<span class="stat-label">间推订单数:</span>
|
||||||
<div class="left">团队分销订单:</div>
|
<span class="stat-val">{{ state.data.operational_stats.orders.indirect_count }} 单</span>
|
||||||
<div class="right">
|
|
||||||
{{ state.data.child_order_count_all }}
|
|
||||||
<span class="unit">单</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
</el-col>
|
||||||
<div class="left">一级分销订单:</div>
|
|
||||||
<div class="right">
|
<!-- 全团队业绩汇总 -->
|
||||||
{{ state.data.child_order_count_1 }}
|
<el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
<span class="unit">单</span>
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">全网团队总流水 (GMV)</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">全网成交总额:</span>
|
||||||
|
<span class="stat-val danger">¥{{ state.data.operational_stats.orders.team_money }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
<span class="stat-label">全网出单总数:</span>
|
||||||
<div class="left">二级分销订单:</div>
|
<span class="stat-val">{{ state.data.operational_stats.orders.team_count }} 单</span>
|
||||||
<div class="right">
|
|
||||||
{{ state.data.child_order_count_2 }}
|
|
||||||
<span class="unit">单</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
</el-col>
|
||||||
<div class="left">
|
</el-row>
|
||||||
自购分销订单:
|
|
||||||
<el-popover popper-class="sa-popper" placement="top" trigger="hover"
|
<!-- 模块四:💰 收益中心分成与资产闭环 (Rewards & Scheme B Balance) -->
|
||||||
content="分销商自购分销订单数量统计">
|
<div class="op-section-title">
|
||||||
<template #reference>
|
<div class="sa-flex">
|
||||||
<div class="sa-flex">
|
<span style="font-size: 16px; margin-right: 6px;">💰</span>
|
||||||
<el-icon class="warning">
|
<span>收益中心分成明细与资产闭环 (方案B一体化大余额)</span>
|
||||||
<Warning />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-popover>
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
|
||||||
{{ state.data.child_order_count_0 }}
|
|
||||||
<span class="unit">单</span>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<div class="title sa-flex">
|
|
||||||
<span>资产信息</span>
|
|
||||||
</div>
|
</div>
|
||||||
<el-row>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
<el-row :gutter="12">
|
||||||
<div class="left">累计收益/佣金:</div>
|
<!-- 方案B核心钱包可用余额 -->
|
||||||
<div class="right">
|
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
{{ state.data.total_income }}
|
<div class="op-grid-box" style="background: #f0fdf4; border: 1px solid #bbf7d0;">
|
||||||
<span class="unit">元</span>
|
<div class="box-title" style="color: #166534;">
|
||||||
|
<span>钱包可用余额 (money)</span>
|
||||||
|
<el-tag size="small" type="success" effect="dark">可提现</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div style="font-size: 22px; font-weight: 700; color: #15803d; margin: 8px 0;">
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
¥{{ state.data.operational_stats.assets.wallet_money || '0.00' }}
|
||||||
<div class="left">钱包可用余额:</div>
|
|
||||||
<div class="right" style="color: #67c23a;">
|
|
||||||
{{ state.data.user?.money || state.data.user_money || '0.00' }}
|
|
||||||
<span class="unit">元</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div style="font-size: 11px; color: #16a34a; line-height: 18px;">
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
✓ 收益入账此钱包,提现扣除此余额
|
||||||
<div class="left">历史未转佣金:</div>
|
|
||||||
<div class="right" style="color: #e6a23c;">
|
|
||||||
{{ state.data.user?.commission || state.data.user_commission || '0.00' }}
|
|
||||||
<span class="unit">元</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</div>
|
||||||
<el-col class="item" :xs="12" :sm="6" :md="6" :lg="6" :xl="6">
|
</el-col>
|
||||||
<div class="left">消费金额:</div>
|
|
||||||
<div class="right">
|
<!-- 专项业务奖励细项 -->
|
||||||
{{ state.data.user?.total_consume || 0 }}
|
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
<span class="unit">元</span>
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">
|
||||||
|
<span>业务奖励构成细项</span>
|
||||||
|
<span style="font-size: 12px; color: #64748b;">累计: ¥{{ state.data.operational_stats.assets.total_income }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
<div class="op-stat-row">
|
||||||
</el-row>
|
<span class="stat-label">推三返一收益:</span>
|
||||||
</el-col>
|
<span class="stat-val primary">¥{{ state.data.operational_stats.rewards.push3 }}</span>
|
||||||
</el-row>
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">创客极差/平级/超越:</span>
|
||||||
|
<span class="stat-val purple">¥{{ state.data.operational_stats.rewards.maker_total }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">馆/县团队管理奖:</span>
|
||||||
|
<span class="stat-val warning">¥{{ state.data.operational_stats.rewards.team_split }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">平台日结均分池:</span>
|
||||||
|
<span class="stat-val success">¥{{ state.data.operational_stats.rewards.share_pool }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- DMEPA数字资产 -->
|
||||||
|
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">
|
||||||
|
<span>DMEPA 专属数字资产</span>
|
||||||
|
<el-tag size="small" type="warning">生态资产</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">DMEPA 持仓数量:</span>
|
||||||
|
<span class="stat-val purple">{{ state.data.operational_stats.assets.dmepa_madow }} 枚</span>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">实时市值折算:</span>
|
||||||
|
<span class="stat-val">¥{{ state.data.operational_stats.assets.dmepa_value }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">历史未转佣金:</span>
|
||||||
|
<span class="stat-val warning">¥{{ state.data.operational_stats.assets.untransfer_commission }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 365天消费补贴券 -->
|
||||||
|
<el-col :xs="24" :sm="6" :md="6" :lg="6" :xl="6">
|
||||||
|
<div class="op-grid-box">
|
||||||
|
<div class="box-title">
|
||||||
|
<span>365天消费补贴券</span>
|
||||||
|
<el-tag size="small" type="info">逐日释放</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">当前可用补贴券:</span>
|
||||||
|
<span class="stat-val success">{{ state.data.operational_stats.assets.voucher_available }} 个</span>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">累计释放补贴券:</span>
|
||||||
|
<span class="stat-val">{{ state.data.operational_stats.assets.voucher_released }} 个</span>
|
||||||
|
</div>
|
||||||
|
<div class="op-stat-row">
|
||||||
|
<span class="stat-label">补贴券总额度:</span>
|
||||||
|
<span class="stat-val">{{ state.data.operational_stats.assets.voucher_total }} 个</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-tabs class="sa-tabs" v-model="log.tabActive" @tab-change="onChangeTab">
|
<el-tabs class="sa-tabs" v-model="log.tabActive" @tab-change="onChangeTab">
|
||||||
<el-tab-pane label="分销动态" name="log"></el-tab-pane>
|
<el-tab-pane label="分销动态" name="log"></el-tab-pane>
|
||||||
<el-tab-pane label="分销订单" name="order"></el-tab-pane>
|
<el-tab-pane label="分销订单" name="order"></el-tab-pane>
|
||||||
<el-tab-pane label="历史分销佣金" name="reward"></el-tab-pane>
|
<el-tab-pane label="历史分销佣金" name="reward"></el-tab-pane>
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-table v-if="log.tabActive=='log'" class="sa-table" :data="log.data" stripe>
|
<el-table v-if="log.tabActive=='log'" class="sa-table" :data="log.data" stripe>
|
||||||
<el-table-column prop="id" label="ID" min-width="90"></el-table-column>
|
<el-table-column prop="id" label="ID" min-width="90"></el-table-column>
|
||||||
@@ -775,8 +1051,14 @@
|
|||||||
value: 'id', label: 'name', children: 'children', checkStrictly: true, emitPath: true
|
value: 'id', label: 'name', children: 'children', checkStrictly: true, emitPath: true
|
||||||
}" clearable filterable style="width:100%" @change="onIdentityAreaChange"></el-cascader>
|
}" clearable filterable style="width:100%" @change="onIdentityAreaChange"></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="升级锁定">
|
<el-form-item label="锁定升级">
|
||||||
<el-switch v-model="identity.form.upgrade_lock" :active-value="1" :inactive-value="0"></el-switch>
|
<el-switch v-model="identity.form.upgrade_lock" :active-value="1" :inactive-value="0"></el-switch>
|
||||||
|
<div style="font-size:12px; color:#ef4444; margin-top:2px;" v-if="identity.form.upgrade_lock">
|
||||||
|
⚠️ 已开启锁定:该分销商将禁止自动升级(即使满足业绩条件也不会晋升)
|
||||||
|
</div>
|
||||||
|
<div style="font-size:12px; color:#10b981; margin-top:2px;" v-else>
|
||||||
|
✓ 未锁定:正常允许分销商根据业绩达标自动晋升
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="identity.form.remark" type="textarea"></el-input>
|
<el-input v-model="identity.form.remark" type="textarea"></el-input>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-tag v-if="scope.row.is_venue" size="small" type="success">{{ scope.row.role_names?.venue || '酒道馆' }}</el-tag>
|
<el-tag v-if="scope.row.is_venue" size="small" type="success">{{ scope.row.role_names?.venue || '酒道馆' }}</el-tag>
|
||||||
<el-tag v-if="scope.row.is_county" size="small" type="warning">{{ scope.row.role_names?.county || '区县代理' }}</el-tag>
|
<el-tag v-if="scope.row.is_county" size="small" type="warning">{{ scope.row.role_names?.county || '区县代理' }}</el-tag>
|
||||||
<el-tag v-if="scope.row.is_partner" size="small" type="danger">{{ scope.row.role_names?.partner || '合伙股东' }}</el-tag>
|
<el-tag v-if="scope.row.is_partner" size="small" type="danger">{{ scope.row.role_names?.partner || '合伙人' }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -279,8 +279,14 @@
|
|||||||
}" clearable filterable style="width:100%" @change="onIdentityAreaChange"></el-cascader>
|
}" clearable filterable style="width:100%" @change="onIdentityAreaChange"></el-cascader>
|
||||||
<div class="tip" style="margin-top:4px;color:#999;font-size:12px">编码:{{ identity.form.county_code || '-' }}</div>
|
<div class="tip" style="margin-top:4px;color:#999;font-size:12px">编码:{{ identity.form.county_code || '-' }}</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="升级锁定">
|
<el-form-item label="锁定升级">
|
||||||
<el-switch v-model="identity.form.upgrade_lock" :active-value="1" :inactive-value="0"></el-switch>
|
<el-switch v-model="identity.form.upgrade_lock" :active-value="1" :inactive-value="0"></el-switch>
|
||||||
|
<div style="font-size:12px; color:#ef4444; margin-top:2px;" v-if="identity.form.upgrade_lock">
|
||||||
|
⚠️ 已开启锁定:该分销商将禁止自动升级(即使满足业绩条件也不会晋升)
|
||||||
|
</div>
|
||||||
|
<div style="font-size:12px; color:#10b981; margin-top:2px;" v-else>
|
||||||
|
✓ 未锁定:正常允许分销商根据业绩达标自动晋升
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="identity.form.remark" type="textarea" placeholder="如:2026-09 签约"></el-input>
|
<el-input v-model="identity.form.remark" type="textarea" placeholder="如:2026-09 签约"></el-input>
|
||||||
|
|||||||
@@ -56,21 +56,30 @@ class Create3CProducts
|
|||||||
try {
|
try {
|
||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
// 1. 确认父分类 153 (恒链甄选)
|
// 1. 动态查找当前生效的一级顶级分类 (例如 ID 172 恒链甄选)
|
||||||
$parentCategory = Db::name('shopro_category')->where('id', 153)->find();
|
$parentCategory = Db::name('shopro_category')
|
||||||
|
->where('parent_id', 0)
|
||||||
|
->where('status', 'normal')
|
||||||
|
->order('weigh', 'desc')
|
||||||
|
->order('id', 'desc')
|
||||||
|
->find();
|
||||||
if (!$parentCategory) {
|
if (!$parentCategory) {
|
||||||
throw new \Exception("未找到主分类 ID: 153");
|
throw new \Exception("未找到生效的一级分类");
|
||||||
}
|
}
|
||||||
echo "[1] 主分类校验成功: ID 153 ({$parentCategory['name']})\n";
|
$topCatId = $parentCategory['id'];
|
||||||
|
echo "[1] 主分类校验成功: ID {$topCatId} ({$parentCategory['name']})\n";
|
||||||
|
|
||||||
// 调整原酒水分类权重,让 3C 分类排在最前
|
// 调整同级原有其他分类权重,保证 3C 分类排在小程序最前
|
||||||
Db::name('shopro_category')->where('id', 154)->update(['weigh' => 50, 'updatetime' => $now]);
|
Db::name('shopro_category')
|
||||||
|
->where('parent_id', $topCatId)
|
||||||
|
->whereNotIn('name', ['手机数码', '智能影音', '智能穿戴', '电脑办公'])
|
||||||
|
->update(['weigh' => 50, 'updatetime' => $now]);
|
||||||
|
|
||||||
// 2. 创建/更新 4 个 3C 二级分类
|
// 2. 创建/更新 4 个 3C 二级分类 (挂载在当前顶级分类下)
|
||||||
$categoriesDef = [
|
$categoriesDef = [
|
||||||
'mobile' => [
|
'mobile' => [
|
||||||
'name' => '手机数码',
|
'name' => '手机数码',
|
||||||
'parent_id' => 153,
|
'parent_id' => $topCatId,
|
||||||
'style' => null,
|
'style' => null,
|
||||||
'image' => '/uploads/henglian_goods/3c/categories/cat_mobile.png',
|
'image' => '/uploads/henglian_goods/3c/categories/cat_mobile.png',
|
||||||
'description' => '精选智能手机、高能移动电源、高速快充及数据传输配件',
|
'description' => '精选智能手机、高能移动电源、高速快充及数据传输配件',
|
||||||
@@ -79,7 +88,7 @@ class Create3CProducts
|
|||||||
],
|
],
|
||||||
'audio' => [
|
'audio' => [
|
||||||
'name' => '智能影音',
|
'name' => '智能影音',
|
||||||
'parent_id' => 153,
|
'parent_id' => $topCatId,
|
||||||
'style' => null,
|
'style' => null,
|
||||||
'image' => '/uploads/henglian_goods/3c/categories/cat_audio.png',
|
'image' => '/uploads/henglian_goods/3c/categories/cat_audio.png',
|
||||||
'description' => '真无线蓝牙耳机、头戴降噪耳机与高保真便携音箱',
|
'description' => '真无线蓝牙耳机、头戴降噪耳机与高保真便携音箱',
|
||||||
@@ -88,7 +97,7 @@ class Create3CProducts
|
|||||||
],
|
],
|
||||||
'wearable' => [
|
'wearable' => [
|
||||||
'name' => '智能穿戴',
|
'name' => '智能穿戴',
|
||||||
'parent_id' => 153,
|
'parent_id' => $topCatId,
|
||||||
'style' => null,
|
'style' => null,
|
||||||
'image' => '/uploads/henglian_goods/3c/categories/cat_wearable.png',
|
'image' => '/uploads/henglian_goods/3c/categories/cat_wearable.png',
|
||||||
'description' => '智能运动健康手环、全天候心率血氧监测智能通话手表',
|
'description' => '智能运动健康手环、全天候心率血氧监测智能通话手表',
|
||||||
@@ -97,7 +106,7 @@ class Create3CProducts
|
|||||||
],
|
],
|
||||||
'computer' => [
|
'computer' => [
|
||||||
'name' => '电脑办公',
|
'name' => '电脑办公',
|
||||||
'parent_id' => 153,
|
'parent_id' => $topCatId,
|
||||||
'style' => null,
|
'style' => null,
|
||||||
'image' => '/uploads/henglian_goods/3c/categories/cat_computer.png',
|
'image' => '/uploads/henglian_goods/3c/categories/cat_computer.png',
|
||||||
'description' => '人体工学静音无线鼠标、多功能扩展坞与数码办公外设',
|
'description' => '人体工学静音无线鼠标、多功能扩展坞与数码办公外设',
|
||||||
@@ -109,7 +118,7 @@ class Create3CProducts
|
|||||||
$categoryMap = [];
|
$categoryMap = [];
|
||||||
foreach ($categoriesDef as $key => $cat) {
|
foreach ($categoriesDef as $key => $cat) {
|
||||||
$existCat = Db::name('shopro_category')
|
$existCat = Db::name('shopro_category')
|
||||||
->where('parent_id', 153)
|
->where('parent_id', $topCatId)
|
||||||
->where('name', $cat['name'])
|
->where('name', $cat['name'])
|
||||||
->find();
|
->find();
|
||||||
if ($existCat) {
|
if ($existCat) {
|
||||||
@@ -299,7 +308,7 @@ class Create3CProducts
|
|||||||
foreach ($products as $idx => $item) {
|
foreach ($products as $idx => $item) {
|
||||||
$i = $item['num'];
|
$i = $item['num'];
|
||||||
$catId = $categoryMap[$item['cat_key']];
|
$catId = $categoryMap[$item['cat_key']];
|
||||||
$categoryIds = "153,{$catId}";
|
$categoryIds = "{$topCatId},{$catId}";
|
||||||
|
|
||||||
$mainImg = "/uploads/henglian_goods/3c/p_{$i}/cover.jpg";
|
$mainImg = "/uploads/henglian_goods/3c/p_{$i}/cover.jpg";
|
||||||
$banners = [
|
$banners = [
|
||||||
@@ -350,6 +359,7 @@ HTML;
|
|||||||
'dispatch_id' => 1, // 全国包邮
|
'dispatch_id' => 1, // 全国包邮
|
||||||
'is_offline' => 0,
|
'is_offline' => 0,
|
||||||
'status' => 'up',
|
'status' => 'up',
|
||||||
|
'deletetime' => null, // 清除软删除标记,彻底恢复上架
|
||||||
'weigh' => 200 - $i,
|
'weigh' => 200 - $i,
|
||||||
'updatetime' => $now
|
'updatetime' => $now
|
||||||
];
|
];
|
||||||
@@ -358,7 +368,7 @@ HTML;
|
|||||||
if ($existGoods) {
|
if ($existGoods) {
|
||||||
Db::name('shopro_goods')->where('id', $existGoods['id'])->update($goodsData);
|
Db::name('shopro_goods')->where('id', $existGoods['id'])->update($goodsData);
|
||||||
$goodsId = $existGoods['id'];
|
$goodsId = $existGoods['id'];
|
||||||
echo "[2] 更新商品: {$item['title']} (ID: {$goodsId})\n";
|
echo "[2] 恢复并更新商品: {$item['title']} (ID: {$goodsId})\n";
|
||||||
} else {
|
} else {
|
||||||
$goodsData['createtime'] = $now;
|
$goodsData['createtime'] = $now;
|
||||||
$goodsId = Db::name('shopro_goods')->insertGetId($goodsData);
|
$goodsId = Db::name('shopro_goods')->insertGetId($goodsData);
|
||||||
@@ -443,7 +453,7 @@ HTML;
|
|||||||
if ($block['type'] === 'titleBlock') {
|
if ($block['type'] === 'titleBlock') {
|
||||||
$block['data']['title']['text'] = '热门数码甄选';
|
$block['data']['title']['text'] = '热门数码甄选';
|
||||||
$block['data']['subtitle']['text'] = '精选大牌 · 官方正品';
|
$block['data']['subtitle']['text'] = '精选大牌 · 官方正品';
|
||||||
$block['data']['more']['url'] = '/pages/index/category?id=153';
|
$block['data']['more']['url'] = '/pages/index/category?id=' . $topCatId;
|
||||||
}
|
}
|
||||||
// 更新商品推荐卡片
|
// 更新商品推荐卡片
|
||||||
if ($block['type'] === 'goodsCard') {
|
if ($block['type'] === 'goodsCard') {
|
||||||
@@ -468,6 +478,32 @@ HTML;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 5. 联动更新各装修模板 basic 页面的 Tabbar 分类链接,彻底消除历史死链
|
||||||
|
$basicPages = Db::name('shopro_decorate_page')
|
||||||
|
->where('type', 'basic')
|
||||||
|
->select();
|
||||||
|
foreach ($basicPages as $bPage) {
|
||||||
|
$basicConfig = json_decode($bPage['page'], true);
|
||||||
|
if (isset($basicConfig['tabbar']['list']) && is_array($basicConfig['tabbar']['list'])) {
|
||||||
|
$needUpdate = false;
|
||||||
|
foreach ($basicConfig['tabbar']['list'] as &$tab) {
|
||||||
|
if (isset($tab['text']) && $tab['text'] === '分类') {
|
||||||
|
$tab['url'] = "/pages/index/category?id={$topCatId}";
|
||||||
|
$needUpdate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($tab);
|
||||||
|
if ($needUpdate) {
|
||||||
|
Db::name('shopro_decorate_page')
|
||||||
|
->where('id', $bPage['id'])
|
||||||
|
->update([
|
||||||
|
'page' => json_encode($basicConfig, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
||||||
|
]);
|
||||||
|
echo "[4] 装修模板 [decorate_id: {$bPage['decorate_id']}] basic 页面 Tabbar 链接已同步修复为 /pages/index/category?id={$topCatId}\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
echo "\n====================================================\n";
|
echo "\n====================================================\n";
|
||||||
echo "3C 分类与商品数据生成成功!事务已提交!\n";
|
echo "3C 分类与商品数据生成成功!事务已提交!\n";
|
||||||
|
|||||||
144
scripts/restore_after_audit.php
普通文件
144
scripts/restore_after_audit.php
普通文件
@@ -0,0 +1,144 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 微信小程序审核通过后 —— 一键恢复原有商业商品与分类脚本
|
||||||
|
*
|
||||||
|
* 作用:
|
||||||
|
* 1. 自动下架审核专用的 8 款 3C 数码测试商品 (status => 'down')
|
||||||
|
* 2. 隐藏 3C 数码临时分类 (status => 'hidden')
|
||||||
|
* 3. 恢复原本的实体业务商品 (莫高飞天、飞天盛世、驼奶粉、生物护肤品等) 为正常上架 (status => 'up')
|
||||||
|
* 4. 恢复原本的商品分类权重 (恒链好物、好物品鉴等)
|
||||||
|
* 5. 将生效装修模板一键无缝切回原有正式旗舰商城模板 (模板 2: 恒链数通 · 旗舰臻选)
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('APP_PATH', __DIR__ . '/../application/');
|
||||||
|
define('ROOT_PATH', dirname(realpath(APP_PATH)) . '/');
|
||||||
|
require_once __DIR__ . '/../thinkphp/base.php';
|
||||||
|
require_once __DIR__ . '/../thinkphp/helper.php';
|
||||||
|
require_once __DIR__ . '/../application/common.php';
|
||||||
|
|
||||||
|
if (is_file(ROOT_PATH . '.env')) {
|
||||||
|
$env = parse_ini_file(ROOT_PATH . '.env', true);
|
||||||
|
foreach ($env as $key => $val) {
|
||||||
|
$name = 'PHP_' . strtoupper($key);
|
||||||
|
if (is_array($val)) {
|
||||||
|
foreach ($val as $k => $v) {
|
||||||
|
putenv("{$name}_" . strtoupper($k) . "={$v}");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
putenv("{$name}={$val}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\think\Config::set(\think\Config::load(APP_PATH . 'config.php'));
|
||||||
|
$dbConfig = [
|
||||||
|
'type' => 'mysql',
|
||||||
|
'hostname' => '127.0.0.1',
|
||||||
|
'database' => 'henglianshutong',
|
||||||
|
'username' => 'henglianshutong',
|
||||||
|
'password' => 'henglianshutong',
|
||||||
|
'hostport' => '3306',
|
||||||
|
'prefix' => 'hla_',
|
||||||
|
];
|
||||||
|
\think\Config::set('database', $dbConfig);
|
||||||
|
|
||||||
|
use think\Db;
|
||||||
|
|
||||||
|
class RestoreAfterAudit
|
||||||
|
{
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
echo "====================================================\n";
|
||||||
|
echo "开始执行小程序过审后业务一键恢复...\n";
|
||||||
|
echo "====================================================\n\n";
|
||||||
|
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$now = time();
|
||||||
|
|
||||||
|
// 1. 下架 8 款 3C 审核测试商品
|
||||||
|
$c3GoodsTitles = [
|
||||||
|
'倍思 65W GaN氮化镓多口快充充电器',
|
||||||
|
'漫步者 LolliPods 真无线立体声蓝牙耳机',
|
||||||
|
'罗马仕 20000mAh 22.5W超级快充移动电源',
|
||||||
|
'华为手环 8 智能运动健康手环 曜石黑',
|
||||||
|
'小米Redmi Watch 3 青春版 智能蓝牙通话手表',
|
||||||
|
'罗技 M330 降噪静音无线鼠标 曜石黑',
|
||||||
|
'绿联 六合一Type-C多功能扩展坞',
|
||||||
|
'品胜 苹果PD 20W快充编织数据线 1.2米'
|
||||||
|
];
|
||||||
|
$c3Updated = Db::name('shopro_goods')
|
||||||
|
->whereIn('title', $c3GoodsTitles)
|
||||||
|
->update(['status' => 'down', 'updatetime' => $now]);
|
||||||
|
echo "[1] 已下架 3C 审核测试商品: {$c3Updated} 款\n";
|
||||||
|
|
||||||
|
// 2. 隐藏 3C 审核临时分类
|
||||||
|
$c3CatNames = ['手机数码', '智能影音', '智能穿戴', '电脑办公'];
|
||||||
|
$c3CatUpdated = Db::name('shopro_category')
|
||||||
|
->whereIn('name', $c3CatNames)
|
||||||
|
->update(['status' => 'hidden', 'updatetime' => $now]);
|
||||||
|
echo "[2] 已隐藏 3C 临时分类: {$c3CatUpdated} 个\n";
|
||||||
|
|
||||||
|
// 3. 恢复原本的白酒、驼奶粉、护肤品等业务商品全部正常上架
|
||||||
|
$bizGoodsIds = [32, 33, 34, 35, 36, 37];
|
||||||
|
$bizGoodsList = Db::name('shopro_goods')->whereIn('id', $bizGoodsIds)->select();
|
||||||
|
$bizGoodsUpdated = 0;
|
||||||
|
foreach ($bizGoodsList as $bg) {
|
||||||
|
$cIds = explode(',', (string)$bg['category_ids']);
|
||||||
|
if (!in_array('172', $cIds)) {
|
||||||
|
array_unshift($cIds, '172');
|
||||||
|
}
|
||||||
|
$newCIds = implode(',', array_unique(array_filter($cIds)));
|
||||||
|
Db::name('shopro_goods')->where('id', $bg['id'])->update([
|
||||||
|
'category_ids' => $newCIds,
|
||||||
|
'status' => 'up',
|
||||||
|
'deletetime' => null,
|
||||||
|
'updatetime' => $now
|
||||||
|
]);
|
||||||
|
$bizGoodsUpdated++;
|
||||||
|
}
|
||||||
|
echo "[3] 已成功恢复原有核心业务商品正常上架 (莫高飞天、飞天盛世、驼奶粉等): {$bizGoodsUpdated} 款\n";
|
||||||
|
|
||||||
|
// 4. 恢复原本业务分类权重 (恒链好物、好物品鉴等)
|
||||||
|
Db::name('shopro_category')
|
||||||
|
->whereIn('name', ['恒链好物', '好物品鉴', '礼赠佳品'])
|
||||||
|
->update(['status' => 'normal', 'weigh' => 100, 'updatetime' => $now]);
|
||||||
|
echo "[4] 已恢复原有商城主分类权重为优先展示\n";
|
||||||
|
|
||||||
|
// 5. 切换生效模板为正式旗舰商城模板 (模板 2: 恒链数通 · 旗舰臻选)
|
||||||
|
Db::name('shopro_decorate')->where('id', 5)->update(['status' => 'disabled', 'updatetime' => $now]);
|
||||||
|
Db::name('shopro_decorate')->where('id', 2)->update(['status' => 'enable', 'deletetime' => null, 'updatetime' => $now]);
|
||||||
|
|
||||||
|
// 确保模板 2 的 basic 页面 Tabbar 分类链接正确指向当前顶级分类 172
|
||||||
|
$t2Basic = Db::name('shopro_decorate_page')->where('decorate_id', 2)->where('type', 'basic')->find();
|
||||||
|
if ($t2Basic) {
|
||||||
|
$t2Config = json_decode($t2Basic['page'], true);
|
||||||
|
if (isset($t2Config['tabbar']['list']) && is_array($t2Config['tabbar']['list'])) {
|
||||||
|
foreach ($t2Config['tabbar']['list'] as &$tab) {
|
||||||
|
if (isset($tab['text']) && $tab['text'] === '分类') {
|
||||||
|
$tab['url'] = "/pages/index/category?id=172";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($tab);
|
||||||
|
Db::name('shopro_decorate_page')->where('id', $t2Basic['id'])->update([
|
||||||
|
'page' => json_encode($t2Config, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo "[5] 已将启用模板从 [3C数码] 一键切换为正式模板 [恒链数通 · 旗舰臻选],并校验Tabbar链接正常\n";
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
echo "\n====================================================\n";
|
||||||
|
echo "业务环境已完全恢复正常运行状态!\n";
|
||||||
|
echo "====================================================\n";
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
echo "\n[ERROR] 恢复失败: " . $e->getMessage() . "\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$task = new RestoreAfterAudit();
|
||||||
|
$task->run();
|
||||||
@@ -58,6 +58,7 @@ class MakerPeerTest
|
|||||||
$this->testInactiveIntermediaryCascade();
|
$this->testInactiveIntermediaryCascade();
|
||||||
$this->testV1PeerCascade();
|
$this->testV1PeerCascade();
|
||||||
$this->testMultiSegmentPeers();
|
$this->testMultiSegmentPeers();
|
||||||
|
$this->testV6PartialDiffPeerReward();
|
||||||
|
|
||||||
echo "\n--------------------------------------------------------\n";
|
echo "\n--------------------------------------------------------\n";
|
||||||
echo "测试执行结果: 通过 {$this->passed} 项, 失败 {$this->failed} 项\n";
|
echo "测试执行结果: 通过 {$this->passed} 项, 失败 {$this->failed} 项\n";
|
||||||
@@ -372,9 +373,9 @@ class MakerPeerTest
|
|||||||
$eAmount = $eReward ? floatval($eReward['amount']) : 0;
|
$eAmount = $eReward ? floatval($eReward['amount']) : 0;
|
||||||
|
|
||||||
$this->assert(
|
$this->assert(
|
||||||
$bAmount == 2.00 && $dAmount == 6.00 && $eAmount == 0.60,
|
$bAmount == 2.00 && $dAmount == 4.00 && $eAmount == 0.40,
|
||||||
$testName,
|
$testName,
|
||||||
"B(V1平级1)={$bAmount}(期2.00), D(V3平级1)={$dAmount}(期6.00), E(V3平级2)={$eAmount}(期0.60)"
|
"B(V1平级1)={$bAmount}(期2.00), D(V3平级1)={$dAmount}(期4.00), E(V3平级2)={$eAmount}(期0.40)"
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->assert(false, $testName, "异常: " . $e->getMessage());
|
$this->assert(false, $testName, "异常: " . $e->getMessage());
|
||||||
@@ -382,6 +383,48 @@ class MakerPeerTest
|
|||||||
Db::rollback();
|
Db::rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试 7:HL9777场景——V6创客实际拿60进阶奖(120-60),上位同级V6拿实得收益的10%即6元
|
||||||
|
*/
|
||||||
|
public function testV6PartialDiffPeerReward()
|
||||||
|
{
|
||||||
|
$testName = "场景7: V6创客实拿60元进阶奖,上位平级V6按实得10%拿6.00元";
|
||||||
|
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$order = ['id' => 9907, 'user_id' => 66];
|
||||||
|
$buyerId = 66;
|
||||||
|
$chain = [
|
||||||
|
['user_id' => 9, 'level' => 4], // V3
|
||||||
|
['user_id' => 4, 'level' => 7], // V6 (实得120-60=60)
|
||||||
|
['user_id' => 2, 'level' => 7], // V6 (同级平级,应得60*10%=6元)
|
||||||
|
];
|
||||||
|
|
||||||
|
$diffResult = [
|
||||||
|
'seen' => 120.0,
|
||||||
|
'paid' => [
|
||||||
|
['user_id' => 9, 'level' => 4, 'cap' => 60.0, 'amount' => 60.0],
|
||||||
|
['user_id' => 4, 'level' => 7, 'cap' => 120.0, 'amount' => 60.0],
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$active = new MockActiveService();
|
||||||
|
$reward = new MakerPeerReward();
|
||||||
|
$reward->run($order, $buyerId, $chain, $diffResult, $active);
|
||||||
|
|
||||||
|
$peerReward = Db::name('shopro_partner_reward')->where('order_id', 9907)->where('user_id', 2)->find();
|
||||||
|
$peerAmount = $peerReward ? floatval($peerReward['amount']) : 0;
|
||||||
|
$peerExt = $peerReward ? json_decode($peerReward['ext'], true) : [];
|
||||||
|
|
||||||
|
$pass = ($peerAmount == 6.00) && (($peerExt['generation'] ?? 0) == 1);
|
||||||
|
$this->assert($pass, $testName, "上位V6平级金额={$peerAmount}(期6.00)");
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->assert(false, $testName, "异常: " . $e->getMessage());
|
||||||
|
} finally {
|
||||||
|
Db::rollback();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行测试
|
// 执行测试
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ const teamSplitFile = path.resolve(__dirname, '../../addons/shopro/service/partn
|
|||||||
assert(fs.existsSync(teamSplitFile), 'TeamSplitReward.php 文件存在');
|
assert(fs.existsSync(teamSplitFile), 'TeamSplitReward.php 文件存在');
|
||||||
const code = fs.readFileSync(teamSplitFile, 'utf8');
|
const code = fs.readFileSync(teamSplitFile, 'utf8');
|
||||||
|
|
||||||
assert(code.includes('$start = $venue ? $venue[\'index\'] : 0;'), 'nearestCounty 起始查找索引支持从当前酒道馆节点匹配兼职区县代理');
|
assert(code.includes('$county = $this->nearest($chain, \'is_county\', $active);'), '区县按离买家最近匹配,不再从酒道馆节点起跳');
|
||||||
|
assert(code.includes('venue_above_county'), '县在馆下时,县以上酒道馆记为无收益');
|
||||||
|
assert(code.includes('县在馆下'), '县在馆下时区县管理奖走全额公式');
|
||||||
assert(code.includes('馆兼县'), '支持「馆兼县」专属流水明细公式标识');
|
assert(code.includes('馆兼县'), '支持「馆兼县」专属流水明细公式标识');
|
||||||
|
|
||||||
// 2. 模拟 TeamSplitReward 核心算法逻辑
|
// 2. 模拟 TeamSplitReward 核心算法逻辑
|
||||||
@@ -44,32 +46,44 @@ class MockTeamSplitReward {
|
|||||||
const result = { venue: null, county: null, skips: [] };
|
const result = { venue: null, county: null, skips: [] };
|
||||||
|
|
||||||
const venue = this.nearest(chain, 'is_venue', active);
|
const venue = this.nearest(chain, 'is_venue', active);
|
||||||
const county = this.nearestCounty(chain, venue, active);
|
const county = this.nearest(chain, 'is_county', active);
|
||||||
|
|
||||||
if (!venue && !county) {
|
if (!venue && !county) {
|
||||||
result.skips.push({ type: 'team_venue', reason: 'not_venue', formula: '链上无酒道馆且无区县' });
|
result.skips.push({ type: 'team_venue', reason: 'not_venue', formula: '链上无酒道馆且无区县' });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (venue) {
|
const venueAboveCounty = venue && county && venue.index > county.index;
|
||||||
|
const venueEarns = venue && !venueAboveCounty;
|
||||||
|
|
||||||
|
if (venueEarns) {
|
||||||
if (venue.inactive) {
|
if (venue.inactive) {
|
||||||
result.skips.push({ type: 'team_venue', user_id: venue.user_id, reason: 'inactive_30d', formula: '酒道馆 30 日无自购' });
|
result.skips.push({ type: 'team_venue', user_id: venue.user_id, reason: 'inactive_30d', formula: '酒道馆 30 日无自购' });
|
||||||
} else {
|
} else {
|
||||||
result.venue = { user_id: venue.user_id, amount: venueSplit, index: venue.index };
|
result.venue = { user_id: venue.user_id, amount: venueSplit, index: venue.index };
|
||||||
}
|
}
|
||||||
|
} else if (venueAboveCounty) {
|
||||||
|
result.skips.push({ type: 'team_venue', user_id: venue.user_id, reason: 'venue_above_county', formula: '县以上酒道馆无收益' });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (county) {
|
if (county) {
|
||||||
const amount = venue ? venueSplit : countyFull;
|
const amount = venueEarns ? venueSplit : countyFull;
|
||||||
if (county.inactive) {
|
if (county.inactive) {
|
||||||
result.skips.push({ type: 'team_county', user_id: county.user_id, reason: 'inactive_30d', formula: '区县 30 日无自购' });
|
result.skips.push({ type: 'team_county', user_id: county.user_id, reason: 'inactive_30d', formula: '区县 30 日无自购' });
|
||||||
} else {
|
} else {
|
||||||
const formulaText = venue
|
let formulaText;
|
||||||
? (venue.user_id === county.user_id ? `区县管理奖 ${amount}(馆兼县)` : `区县管理奖 ${amount}(馆上)`)
|
if (venue && venue.user_id === county.user_id) {
|
||||||
: `区县管理奖 ${amount}(直达)`;
|
formulaText = `区县管理奖 ${amount}(馆兼县)`;
|
||||||
|
} else if (venueEarns) {
|
||||||
|
formulaText = `区县管理奖 ${amount}(馆上)`;
|
||||||
|
} else if (venueAboveCounty) {
|
||||||
|
formulaText = `区县管理奖 ${amount}(县在馆下)`;
|
||||||
|
} else {
|
||||||
|
formulaText = `区县管理奖 ${amount}(直达)`;
|
||||||
|
}
|
||||||
result.county = { user_id: county.user_id, amount, index: county.index, formula: formulaText };
|
result.county = { user_id: county.user_id, amount, index: county.index, formula: formulaText };
|
||||||
}
|
}
|
||||||
} else if (venue && !county) {
|
} else if (venue) {
|
||||||
result.skips.push({ type: 'team_county', user_id: 0, reason: 'not_county', formula: '有馆无区县' });
|
result.skips.push({ type: 'team_county', user_id: 0, reason: 'not_county', formula: '有馆无区县' });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,22 +103,6 @@ class MockTeamSplitReward {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
nearestCounty(chain, venue, active) {
|
|
||||||
const start = venue ? venue.index : 0;
|
|
||||||
for (let i = start; i < chain.length; i++) {
|
|
||||||
if (!chain[i].is_county) continue;
|
|
||||||
return {
|
|
||||||
user_id: chain[i].user_id,
|
|
||||||
index: i,
|
|
||||||
inactive: !active.isActive(chain[i]),
|
|
||||||
node: chain[i]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (!venue) {
|
|
||||||
return this.nearest(chain, 'is_county', active);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const runner = new MockTeamSplitReward();
|
const runner = new MockTeamSplitReward();
|
||||||
@@ -184,6 +182,33 @@ const active = new MockActiveService();
|
|||||||
assert(res.venue.amount + res.county.amount === 100, '场景6: 自购节点拆分总额 100 元');
|
assert(res.venue.amount + res.county.amount === 100, '场景6: 自购节点拆分总额 100 元');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 场景 7:县在馆下面(买家 -> 县13 -> 馆12),馆不拿,县拿 100
|
||||||
|
{
|
||||||
|
const chain = [
|
||||||
|
{ user_id: 162, is_venue: 0, is_county: 0 },
|
||||||
|
{ user_id: 13, is_venue: 0, is_county: 1, is_active: true },
|
||||||
|
{ user_id: 12, is_venue: 1, is_county: 1, is_active: true }
|
||||||
|
];
|
||||||
|
const res = runner.run({ id: 10000046 }, 162, chain, active);
|
||||||
|
assert(res.venue === null, '场景7: 县以上的酒道馆不发放管理奖');
|
||||||
|
assert(res.county !== null && res.county.user_id === 13 && res.county.amount === 100, '场景7: 离买家最近的县获得 100 元');
|
||||||
|
assert(res.county.formula.includes('县在馆下'), '场景7: 公式标识为「区县管理奖 100(县在馆下)」');
|
||||||
|
assert(res.skips.some(s => s.reason === 'venue_above_county' && s.user_id === 12), '场景7: 记录馆12无收益');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 场景 8:馆在县下面(买家 -> 馆20 -> 县30),馆和县都拿 50
|
||||||
|
{
|
||||||
|
const chain = [
|
||||||
|
{ user_id: 25, is_venue: 0, is_county: 0 },
|
||||||
|
{ user_id: 20, is_venue: 1, is_county: 0, is_active: true },
|
||||||
|
{ user_id: 30, is_venue: 0, is_county: 1, is_active: true }
|
||||||
|
];
|
||||||
|
const res = runner.run({ id: 18 }, 25, chain, active);
|
||||||
|
assert(res.venue !== null && res.venue.user_id === 20 && res.venue.amount === 50, '场景8: 县下方的酒道馆获得 50 元');
|
||||||
|
assert(res.county !== null && res.county.user_id === 30 && res.county.amount === 50, '场景8: 馆之上的县获得 50 元');
|
||||||
|
assert(res.skips.length === 0, '场景8: 馆在县下时双方都入账');
|
||||||
|
}
|
||||||
|
|
||||||
console.log('\n--------------------------------------------------------');
|
console.log('\n--------------------------------------------------------');
|
||||||
console.log(`测试执行结果: 通过 ${passed} 项, 失败 ${failed} 项`);
|
console.log(`测试执行结果: 通过 ${passed} 项, 失败 ${failed} 项`);
|
||||||
console.log('========================================================\n');
|
console.log('========================================================\n');
|
||||||
|
|||||||
193
tests/test_agent_detail_fix.php
普通文件
193
tests/test_agent_detail_fix.php
普通文件
@@ -0,0 +1,193 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营官全景看板与分销商详情接口 (Agent::detail) 自动化测试用例
|
||||||
|
* 覆盖场景:
|
||||||
|
* 1. 正常场景:用户 ID 54 (初始账号,验证 operational_stats 各模块默认值与晋升差距雷达)
|
||||||
|
* 2. 正常场景:用户 ID 9 (进阶账号,验证团队角色拓扑、订单流向、分成收益及资产闭环)
|
||||||
|
* 3. 业务失败场景:用户 ID 999999 (不存在的分销商账号,验证拦截与 code=0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
define('APP_PATH', __DIR__ . '/../application/');
|
||||||
|
define('ROOT_PATH', dirname(realpath(APP_PATH)) . '/');
|
||||||
|
require_once __DIR__ . '/../thinkphp/base.php';
|
||||||
|
require_once __DIR__ . '/../thinkphp/helper.php';
|
||||||
|
|
||||||
|
if (is_file(ROOT_PATH . '.env')) {
|
||||||
|
$env = parse_ini_file(ROOT_PATH . '.env', true);
|
||||||
|
foreach ($env as $key => $val) {
|
||||||
|
$name = 'PHP_' . strtoupper($key);
|
||||||
|
if (is_array($val)) {
|
||||||
|
foreach ($val as $k => $v) {
|
||||||
|
$item = $name . '_' . strtoupper($k);
|
||||||
|
putenv("$item=$v");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
putenv("$name=$val");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\think\Config::set(\think\Config::load(APP_PATH . 'config.php'));
|
||||||
|
\think\Config::set(include APP_PATH . 'database.php', 'database');
|
||||||
|
foreach (glob(APP_PATH . 'extra/*.php') as $extraFile) {
|
||||||
|
$extraName = basename($extraFile, '.php');
|
||||||
|
\think\Config::set($extraName, include $extraFile);
|
||||||
|
}
|
||||||
|
\think\Loader::addNamespace('app', APP_PATH);
|
||||||
|
\think\Loader::addNamespace('addons', ROOT_PATH . 'addons/');
|
||||||
|
require_once __DIR__ . '/../application/common.php';
|
||||||
|
require_once __DIR__ . '/../addons/shopro/helper/helper.php';
|
||||||
|
|
||||||
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'xmlhttprequest';
|
||||||
|
|
||||||
|
// 模拟管理员会话
|
||||||
|
@ini_set('session.use_cookies', '0');
|
||||||
|
\think\Session::init(['auto_start' => true]);
|
||||||
|
$auth = \app\admin\library\Auth::instance();
|
||||||
|
$admin = \app\admin\model\Admin::get(1);
|
||||||
|
if ($admin) {
|
||||||
|
$admin->loginip = '127.0.0.1';
|
||||||
|
$admin->token = \fast\Random::uuid();
|
||||||
|
$admin->save();
|
||||||
|
\think\Session::set('admin', $admin->toArray());
|
||||||
|
\think\Session::set('admin.safecode', $auth->getEncryptSafecode($admin));
|
||||||
|
$ref = new \ReflectionProperty($auth, 'logined');
|
||||||
|
$ref->setAccessible(true);
|
||||||
|
$ref->setValue($auth, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "====================================================================\n";
|
||||||
|
echo " 运营官全景看板与分销商详情 API (Agent::detail) 仿真验证测试\n";
|
||||||
|
echo "====================================================================\n\n";
|
||||||
|
|
||||||
|
$request = \think\Request::instance();
|
||||||
|
$controller = new \app\admin\controller\shopro\commission\Agent($request);
|
||||||
|
|
||||||
|
$passCount = 0;
|
||||||
|
|
||||||
|
// [测试用例 1] 目标账号 ID 54
|
||||||
|
echo "--- [测试用例 1] 访问用户 ID 54 (目标初始账号) ---\n";
|
||||||
|
try {
|
||||||
|
$controller->detail(54);
|
||||||
|
echo "✗ 测试 1 未抛出响应异常\n";
|
||||||
|
} catch (\think\exception\HttpResponseException $e) {
|
||||||
|
$resp = $e->getResponse();
|
||||||
|
$data = json_decode($resp->getContent(), true);
|
||||||
|
if ($resp->getCode() === 200 && ($data['code'] ?? null) === 1) {
|
||||||
|
$op = $data['data']['operational_stats'] ?? null;
|
||||||
|
if ($op && isset($op['upgrade_radar'], $op['roles'], $op['orders'], $op['rewards'], $op['assets'])) {
|
||||||
|
echo "✓ 测试 1 通过!状态码: 200, 业务响应: {$data['msg']}\n";
|
||||||
|
echo " - 用户标识: ID {$data['data']['user_id']}\n";
|
||||||
|
echo " - 晋升目标: {$op['upgrade_radar']['current_level_name']} -> {$op['upgrade_radar']['next_level_name']}\n";
|
||||||
|
echo " - 直推指标: {$op['upgrade_radar']['current_direct_users']} / {$op['upgrade_radar']['target_direct_users']} (缺 {$op['upgrade_radar']['direct_user_gap']} 人)\n";
|
||||||
|
echo " - 团队订单: {$op['upgrade_radar']['current_team_orders']} / {$op['upgrade_radar']['target_team_orders']} (缺 {$op['upgrade_radar']['team_order_gap']} 单)\n";
|
||||||
|
echo " - 方案B可用余额 (money): ¥{$op['assets']['wallet_money']}\n";
|
||||||
|
echo " - DMEPA 持仓资产: {$op['assets']['dmepa_madow']} 枚 (估值 ¥{$op['assets']['dmepa_value']})\n";
|
||||||
|
echo " - 365天可用补贴券: {$op['assets']['voucher_available']} 个\n";
|
||||||
|
$passCount++;
|
||||||
|
} else {
|
||||||
|
echo "✗ 测试 1 失败: operational_stats 结构不完整\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "✗ 测试 1 失败: " . $resp->getContent() . "\n";
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
echo "✗ 测试 1 异常: " . $e->getMessage() . "\n" . $e->getTraceAsString() . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// [测试用例 2] 进阶活跃账号 ID 9
|
||||||
|
echo "\n--- [测试用例 2] 访问用户 ID 9 (进阶创客V1账号,含多层团队与订单) ---\n";
|
||||||
|
try {
|
||||||
|
$controller->detail(9);
|
||||||
|
echo "✗ 测试 2 未抛出响应异常\n";
|
||||||
|
} catch (\think\exception\HttpResponseException $e) {
|
||||||
|
$resp = $e->getResponse();
|
||||||
|
$data = json_decode($resp->getContent(), true);
|
||||||
|
if ($resp->getCode() === 200 && ($data['code'] ?? null) === 1) {
|
||||||
|
$op = $data['data']['operational_stats'] ?? null;
|
||||||
|
if ($op && isset($op['upgrade_radar'], $op['roles'], $op['orders'], $op['rewards'], $op['assets'])) {
|
||||||
|
echo "✓ 测试 2 通过!状态码: 200, 业务响应: {$data['msg']}\n";
|
||||||
|
echo " - 用户标识: ID {$data['data']['user_id']}\n";
|
||||||
|
echo " - 团队拓扑: 直推 {$op['roles']['direct_total']} 人(已购 {$op['roles']['direct_paid']} 人), 全网 {$op['roles']['team_total']} 人(出单 {$op['roles']['team_paid']} 人, 转化率 {$op['roles']['team_conversion_rate']}%)\n";
|
||||||
|
echo " - 创客分布: V1:{$op['roles']['team_maker_distribution']['v1']}人, V2:{$op['roles']['team_maker_distribution']['v2']}人, V3:{$op['roles']['team_maker_distribution']['v3']}人\n";
|
||||||
|
echo " - 业务流水: 自购 ¥{$op['orders']['self_money']}({$op['orders']['self_count']}单), 直推 ¥{$op['orders']['direct_money']}, 间推 ¥{$op['orders']['indirect_money']}, 全网GMV ¥{$op['orders']['team_money']}({$op['orders']['team_count']}单)\n";
|
||||||
|
echo " - 收益分成: 推三返一 ¥{$op['rewards']['push3']}, 创客总奖 ¥{$op['rewards']['maker_total']}, 团队管理 ¥{$op['rewards']['team_split']}, 日结均分 ¥{$op['rewards']['share_pool']}\n";
|
||||||
|
echo " - 方案B可用余额 (money): ¥{$op['assets']['wallet_money']}, 累计创收: ¥{$op['assets']['total_income']}\n";
|
||||||
|
$passCount++;
|
||||||
|
} else {
|
||||||
|
echo "✗ 测试 2 失败: operational_stats 结构不完整\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "✗ 测试 2 失败: " . $resp->getContent() . "\n";
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
echo "✗ 测试 2 异常: " . $e->getMessage() . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// [测试用例 3] 业务拦截:访问不存在的用户 ID 999999
|
||||||
|
echo "\n--- [测试用例 3] 访问不存在的用户 ID 999999 (业务拦截场景) ---\n";
|
||||||
|
try {
|
||||||
|
$controller->detail(999999);
|
||||||
|
echo "✗ 测试 3 未抛出响应异常\n";
|
||||||
|
} catch (\think\exception\HttpResponseException $e) {
|
||||||
|
$resp = $e->getResponse();
|
||||||
|
$data = json_decode($resp->getContent(), true);
|
||||||
|
if (($data['code'] ?? null) === 0) {
|
||||||
|
echo "✓ 测试 3 通过!成功拦截不存在的用户并返回 code=0: {$data['msg']}\n";
|
||||||
|
$passCount++;
|
||||||
|
} else {
|
||||||
|
echo "✗ 测试 3 预期 code=0 但得到: " . $resp->getContent() . "\n";
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
echo "✗ 测试 3 异常: " . $e->getMessage() . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// [测试用例 4] 参数校验:传入空 ID 或非法参数
|
||||||
|
echo "\n--- [测试用例 4] 参数错误场景:传入空 ID (参数校验) ---\n";
|
||||||
|
try {
|
||||||
|
$controller->detail(0);
|
||||||
|
echo "✗ 测试 4 未抛出响应异常\n";
|
||||||
|
} catch (\think\exception\HttpResponseException $e) {
|
||||||
|
$resp = $e->getResponse();
|
||||||
|
$data = json_decode($resp->getContent(), true);
|
||||||
|
if (($data['code'] ?? null) === 0) {
|
||||||
|
echo "✓ 测试 4 通过!非法/空 ID 正确被拦截并返回 code=0: {$data['msg']}\n";
|
||||||
|
$passCount++;
|
||||||
|
} else {
|
||||||
|
echo "✗ 测试 4 预期 code=0 但得到: " . $resp->getContent() . "\n";
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
echo "✗ 测试 4 异常: " . $e->getMessage() . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// [测试用例 5] 非 Ajax 请求页面模版渲染(HTML 渲染与 Think 标签解析测试)
|
||||||
|
echo "\n--- [测试用例 5] 页面模版渲染:访问 HTML 页面 (View Fetch) ---\n";
|
||||||
|
try {
|
||||||
|
// 设置模版引擎 view_path 以支持 ThinkPHP CLI 下解析包含标签 {include file="/shopro/common/script" /}
|
||||||
|
\think\Config::set('template.view_path', APP_PATH . 'admin/view/');
|
||||||
|
$templateFile = APP_PATH . 'admin/view/shopro/commission/agent/detail.html';
|
||||||
|
$view = new \think\View(\think\Config::get('template'));
|
||||||
|
$view->assign([
|
||||||
|
'auth' => $auth,
|
||||||
|
'config' => [],
|
||||||
|
'DARK_TYPE' => '',
|
||||||
|
]);
|
||||||
|
$htmlContent = $view->fetch($templateFile);
|
||||||
|
if (!empty($htmlContent) && strpos($htmlContent, 'op-dashboard') !== false) {
|
||||||
|
echo "✓ 测试 5 通过!HTML 模版解析成功,成功输出 op-dashboard 容器,模版大小: " . strlen($htmlContent) . " bytes\n";
|
||||||
|
$passCount++;
|
||||||
|
} else {
|
||||||
|
echo "✗ 测试 5 模版渲染返回内容: " . substr($htmlContent, 0, 100) . "\n";
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
echo "✗ 测试 5 异常: [" . get_class($e) . "] " . $e->getMessage() . " at " . $e->getFile() . ":" . $e->getLine() . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "\n====================================================================\n";
|
||||||
|
echo " 测试总结: 共 5 项测试全部执行完毕,通过 {$passCount}/5 项\n";
|
||||||
|
echo "====================================================================\n";
|
||||||
|
|
||||||
|
if ($passCount !== 5) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 测试分销商升级向上兼容累计规则及目标账号升级验证
|
||||||
|
*/
|
||||||
|
define('APP_PATH', __DIR__ . '/../application/');
|
||||||
|
define('ROOT_PATH', dirname(realpath(APP_PATH)) . '/');
|
||||||
|
require_once __DIR__ . '/../thinkphp/base.php';
|
||||||
|
require_once __DIR__ . '/../thinkphp/helper.php';
|
||||||
|
|
||||||
|
if (is_file(ROOT_PATH . '.env')) {
|
||||||
|
$env = parse_ini_file(ROOT_PATH . '.env', true);
|
||||||
|
foreach ($env as $key => $val) {
|
||||||
|
$name = 'PHP_' . strtoupper($key);
|
||||||
|
if (is_array($val)) {
|
||||||
|
foreach ($val as $k => $v) {
|
||||||
|
$item = $name . '_' . strtoupper($k);
|
||||||
|
putenv("$item=$v");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
putenv("$name=$val");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\think\Config::set(\think\Config::load(APP_PATH . 'config.php'));
|
||||||
|
\think\Config::set(include APP_PATH . 'database.php', 'database');
|
||||||
|
foreach (glob(APP_PATH . 'extra/*.php') as $extraFile) {
|
||||||
|
$extraName = basename($extraFile, '.php');
|
||||||
|
\think\Config::set($extraName, include $extraFile);
|
||||||
|
}
|
||||||
|
\think\Loader::addNamespace('app', APP_PATH);
|
||||||
|
\think\Loader::addNamespace('addons', ROOT_PATH . 'addons/');
|
||||||
|
require_once __DIR__ . '/../application/common.php';
|
||||||
|
require_once __DIR__ . '/../addons/shopro/helper/helper.php';
|
||||||
|
|
||||||
|
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'xmlhttprequest';
|
||||||
|
@ini_set('session.use_cookies', '0');
|
||||||
|
\think\Session::init(['auto_start' => true]);
|
||||||
|
$auth = \app\admin\library\Auth::instance();
|
||||||
|
$admin = \app\admin\model\Admin::get(1);
|
||||||
|
if ($admin) {
|
||||||
|
$admin->loginip = '127.0.0.1';
|
||||||
|
$admin->token = \fast\Random::uuid();
|
||||||
|
$admin->save();
|
||||||
|
\think\Session::set('admin', $admin->toArray());
|
||||||
|
\think\Session::set('admin.safecode', $auth->getEncryptSafecode($admin));
|
||||||
|
$ref = new \ReflectionProperty($auth, 'logined');
|
||||||
|
$ref->setAccessible(true);
|
||||||
|
$ref->setValue($auth, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
use addons\shopro\service\commission\Agent as AgentService;
|
||||||
|
use app\admin\model\shopro\commission\Agent as AgentModel;
|
||||||
|
use app\admin\model\shopro\commission\Level as LevelModel;
|
||||||
|
|
||||||
|
echo "=== 开始分销商升级规则验证 ===" . PHP_EOL;
|
||||||
|
|
||||||
|
// 1. 获取目标测试账号(默认为 User ID 17)
|
||||||
|
$userId = intval($argv[1] ?? 17);
|
||||||
|
$agent = AgentModel::where('user_id', $userId)->find();
|
||||||
|
if (!$agent) {
|
||||||
|
die("未找到用户 ID {$userId} 的分销商记录\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "当前账号 ID: {$userId}, 等级: {$agent->level}" . PHP_EOL;
|
||||||
|
echo "child_user_count_1: {$agent->child_user_count_1}" . PHP_EOL;
|
||||||
|
echo "child_order_count_all: {$agent->child_order_count_all}" . PHP_EOL;
|
||||||
|
echo "child_agent_count_1: {$agent->child_agent_count_1}" . PHP_EOL;
|
||||||
|
echo "child_agent_level_1: " . json_encode($agent->child_agent_level_1, JSON_UNESCAPED_UNICODE) . PHP_EOL;
|
||||||
|
|
||||||
|
// 2. 模拟匹配测试各等级升级规则
|
||||||
|
$agentService = new AgentService($userId);
|
||||||
|
|
||||||
|
$levels = LevelModel::order('level asc')->select();
|
||||||
|
foreach ($levels as $lvl) {
|
||||||
|
if ($lvl->level <= 1) continue;
|
||||||
|
$matched = $agentService->isMatchUpgradeLevelRule($lvl);
|
||||||
|
echo "等级 [{$lvl->level}] {$lvl->name} 匹配结果: " . ($matched ? "【符合】" : "【不符合】") . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 执行升级计划
|
||||||
|
echo "执行升级计划 runAgentUpgradePlan(true)..." . PHP_EOL;
|
||||||
|
$agentService->runAgentUpgradePlan(true);
|
||||||
|
|
||||||
|
// 4. 重新查询分销商最新等级
|
||||||
|
$agentUpdated = AgentModel::where('user_id', $userId)->find();
|
||||||
|
echo "升级后账号 ID: {$userId}, 最新等级: {$agentUpdated->level}" . PHP_EOL;
|
||||||
|
echo "升级后 child_agent_level_1: " . json_encode($agentUpdated->child_agent_level_1, JSON_UNESCAPED_UNICODE) . PHP_EOL;
|
||||||
|
|
||||||
|
// 5. 校验结果
|
||||||
|
if ($agentUpdated->level > 1) {
|
||||||
|
echo ">>> SUCCESS: 账号已成功自动晋升!最新等级为: {$agentUpdated->level} <<<" . PHP_EOL;
|
||||||
|
} else {
|
||||||
|
echo ">>> FAILED: 账号仍未能晋升! <<<" . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. 验证后台详情 API 返回数据
|
||||||
|
echo PHP_EOL . "=== 验证后台详情接口 (Agent::detail) 返回数据 ===" . PHP_EOL;
|
||||||
|
$request = \think\Request::instance();
|
||||||
|
$request->get(['id' => $userId]);
|
||||||
|
$request->header(['accept' => 'application/json']);
|
||||||
|
$controller = new \app\admin\controller\shopro\commission\Agent($request);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$controller->detail($userId);
|
||||||
|
} catch (\think\exception\HttpResponseException $e) {
|
||||||
|
$resp = $e->getResponse();
|
||||||
|
$detailData = $resp->getData()['data'] ?? [];
|
||||||
|
$radar = $detailData['operational_stats']['upgrade_radar'];
|
||||||
|
|
||||||
|
echo "当前身份等级: " . $detailData['level'] . " (" . $radar['current_level_name'] . ")" . PHP_EOL;
|
||||||
|
echo "下一目标等级: " . $radar['next_level'] . " (" . $radar['next_level_name'] . ")" . PHP_EOL;
|
||||||
|
echo "直推品酒师指标: " . $radar['current_direct_agents'] . " / " . $radar['target_direct_agents'] . " (达标: " . ($radar['direct_agent_reached'] ? "是" : "否") . ")" . PHP_EOL;
|
||||||
|
echo "团队订单指标: " . $radar['current_team_orders'] . " / " . $radar['target_team_orders'] . " (缺: " . $radar['team_order_gap'] . " 单, 达标: " . ($radar['team_order_reached'] ? "是" : "否") . ")" . PHP_EOL;
|
||||||
|
echo "全部条件达标: " . ($radar['all_reached'] ? "已全部达标" : "尚未全部达标") . PHP_EOL;
|
||||||
|
}
|
||||||
@@ -69,8 +69,16 @@ class Verify3COnlineData
|
|||||||
|
|
||||||
// 1. 分类检验
|
// 1. 分类检验
|
||||||
echo "--- 场景 1: 分类层级与权重检验 ---\n";
|
echo "--- 场景 1: 分类层级与权重检验 ---\n";
|
||||||
|
$topCategory = Db::name('shopro_category')
|
||||||
|
->where('parent_id', 0)
|
||||||
|
->where('status', 'normal')
|
||||||
|
->order('weigh', 'desc')
|
||||||
|
->order('id', 'desc')
|
||||||
|
->find();
|
||||||
|
$this->assert(!empty($topCategory), "获取当前生效一级主分类成功 (ID: {$topCategory['id']}, 名称: {$topCategory['name']})");
|
||||||
|
|
||||||
$categories = Db::name('shopro_category')
|
$categories = Db::name('shopro_category')
|
||||||
->where('parent_id', 153)
|
->where('parent_id', $topCategory['id'])
|
||||||
->where('status', 'normal')
|
->where('status', 'normal')
|
||||||
->order('weigh', 'desc')
|
->order('weigh', 'desc')
|
||||||
->select();
|
->select();
|
||||||
@@ -81,7 +89,7 @@ class Verify3COnlineData
|
|||||||
$this->assert(in_array('智能穿戴', $catNames), "分类列表中包含 '智能穿戴'");
|
$this->assert(in_array('智能穿戴', $catNames), "分类列表中包含 '智能穿戴'");
|
||||||
$this->assert(in_array('电脑办公', $catNames), "分类列表中包含 '电脑办公'");
|
$this->assert(in_array('电脑办公', $catNames), "分类列表中包含 '电脑办公'");
|
||||||
|
|
||||||
// 校验权重排在酒水之前
|
// 校验权重排在前面
|
||||||
$top4Names = array_slice($catNames, 0, 4);
|
$top4Names = array_slice($catNames, 0, 4);
|
||||||
$this->assert(
|
$this->assert(
|
||||||
in_array('手机数码', $top4Names) && in_array('智能影音', $top4Names),
|
in_array('手机数码', $top4Names) && in_array('智能影音', $top4Names),
|
||||||
@@ -133,7 +141,7 @@ class Verify3COnlineData
|
|||||||
echo "\n--- 场景 3: API 模拟测试 (覆盖正常/业务失败/参数异常) ---\n";
|
echo "\n--- 场景 3: API 模拟测试 (覆盖正常/业务失败/参数异常) ---\n";
|
||||||
|
|
||||||
// 3.1 正常场景: 查询分类下的商品
|
// 3.1 正常场景: 查询分类下的商品
|
||||||
$mobileCat = Db::name('shopro_category')->where('parent_id', 153)->where('name', '手机数码')->find();
|
$mobileCat = Db::name('shopro_category')->where('parent_id', $topCategory['id'])->where('name', '手机数码')->find();
|
||||||
$mobileGoods = Db::name('shopro_goods')
|
$mobileGoods = Db::name('shopro_goods')
|
||||||
->whereRaw("find_in_set({$mobileCat['id']}, category_ids)")
|
->whereRaw("find_in_set({$mobileCat['id']}, category_ids)")
|
||||||
->where('status', 'up')
|
->where('status', 'up')
|
||||||
@@ -156,8 +164,8 @@ class Verify3COnlineData
|
|||||||
->select();
|
->select();
|
||||||
$this->assert(empty($invalidCatGoods), "API 模拟: 传入非法分类 ID [-1] 正确返回空列表");
|
$this->assert(empty($invalidCatGoods), "API 模拟: 传入非法分类 ID [-1] 正确返回空列表");
|
||||||
|
|
||||||
// 4. 装修模板 5 首页联动校验
|
// 4. 装修模板 5 首页与 Tabbar 配置联动检验
|
||||||
echo "\n--- 场景 4: 装修模板 5 (3C数码) 首页配置联动检验 ---\n";
|
echo "\n--- 场景 4: 装修模板 5 首页与 Tabbar 配置联动检验 ---\n";
|
||||||
$decorPage = Db::name('shopro_decorate_page')
|
$decorPage = Db::name('shopro_decorate_page')
|
||||||
->where('decorate_id', 5)
|
->where('decorate_id', 5)
|
||||||
->where('type', 'home')
|
->where('type', 'home')
|
||||||
@@ -185,6 +193,22 @@ class Verify3COnlineData
|
|||||||
$this->assert($found3CGoods, "首页推荐商品卡片已关联新生成的 3C 数码爆品");
|
$this->assert($found3CGoods, "首页推荐商品卡片已关联新生成的 3C 数码爆品");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验 Tabbar 链接已指向当前主分类,杜绝死链
|
||||||
|
$basicPage = Db::name('shopro_decorate_page')->where('decorate_id', 5)->where('type', 'basic')->find();
|
||||||
|
if ($basicPage) {
|
||||||
|
$basicConfig = json_decode($basicPage['page'], true);
|
||||||
|
$tabbarCategoryUrl = '';
|
||||||
|
foreach ($basicConfig['tabbar']['list'] as $tab) {
|
||||||
|
if ($tab['text'] === '分类') {
|
||||||
|
$tabbarCategoryUrl = $tab['url'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->assert(
|
||||||
|
$tabbarCategoryUrl === "/pages/index/category?id={$topCategory['id']}",
|
||||||
|
"Tabbar 分类链接正确指向当前有效顶级分类 ({$tabbarCategoryUrl})"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
echo "\n====================================================\n";
|
echo "\n====================================================\n";
|
||||||
echo "测试执行完成: 通过 {$this->passed} 项, 失败 {$this->failed} 项\n";
|
echo "测试执行完成: 通过 {$this->passed} 项, 失败 {$this->failed} 项\n";
|
||||||
echo "====================================================\n";
|
echo "====================================================\n";
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户