修复A2C工单蜘蛛

This commit is contained in:
root
2026-07-01 01:26:27 +08:00
parent 9f2e904fab
commit 54c13c54ef
22 changed files with 1614 additions and 272 deletions
@@ -9,7 +9,10 @@ use app\admin\model\split\Number;
use think\Collection;
/**
* 分流链接落地页:查链、轮转选号、拼接跳转 URL、访问计数
* 分流链接落地页:查链、跨工单合并选号、拼接跳转 URL、访问计数
*
* 号码池为同一 split_link_id 下全部 status=normal 的号码;
* random_shuffle 关闭时严格轮转,开启时每次访问随机选号。
*/
class SplitRedirectService
{
@@ -59,7 +62,7 @@ class SplitRedirectService
}
$linkId = (int) $link->getAttr('id');
$index = $this->roundRobinStore->nextIndex($linkId, $count);
$index = SplitNumberWeighService::resolvePickIndex($linkId, $count, $this->roundRobinStore);
$list = $numbers instanceof \think\Collection ? $numbers->all() : (array) $numbers;
$picked = $list[$index] ?? $list[0] ?? null;
if ($picked === null) {