mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 09:30:10 +08:00
[fix] Statistics
This commit is contained in:
parent
551f8f1f34
commit
746d75cf89
@ -169,8 +169,11 @@ class Statistics
|
||||
$results = 0;
|
||||
is_null($second_key) ? self::initKeyValue($target, $key) : self::initKeyValue($target, $key, 0, $second_key);
|
||||
foreach ($target as $item) {
|
||||
$skip = is_null($second_key) ? isset($item[$key]) : $item[$key][$second_key];
|
||||
if ($skip) {
|
||||
is_null($second_key) ? $results += intval($item[$key]) : $results += intval($item[$key][$second_key]);
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
@ -236,7 +239,18 @@ class Statistics
|
||||
array_push($tr_list_profit, $td);
|
||||
}
|
||||
}
|
||||
return [$tr_list_count, $tr_list_profit];
|
||||
return [self::unique_arr($tr_list_count), self::unique_arr($tr_list_profit)];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @use 二维数组去重
|
||||
* @param $result
|
||||
* @return array
|
||||
*/
|
||||
private static function unique_arr(array $result): array
|
||||
{
|
||||
return array_unique($result, SORT_REGULAR);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -109,10 +109,14 @@ class StormRaffle extends BaseRaffle
|
||||
for ($i = 1; $i < $num; $i++) {
|
||||
$raw = Curl::post('app', $url, Sign::common($payload));
|
||||
if (strpos((string)$raw, 'html') !== false) {
|
||||
Log::notice(self::formatInfo($raffle['raffle_id'], $num, '由于触发哔哩哔哩安全风控策略,该次访问请求被拒绝'));
|
||||
Log::notice(self::formatInfo($raffle['raffle_id'], $num, '触发哔哩哔哩安全风控策略(412)'));
|
||||
break;
|
||||
}
|
||||
$de_raw = json_decode($raw, true);
|
||||
// {"code":-412,"message":"请求被拦截","ttl":1,"data":null}
|
||||
if ($de_raw['code'] == -412) {
|
||||
Log::notice(self::formatInfo($raffle['raffle_id'], $num, '触发哔哩哔哩安全风控策略(-412)'));
|
||||
}
|
||||
if ($de_raw['code'] == 429 || $de_raw['code'] == -429) {
|
||||
Log::notice(self::formatInfo($raffle['raffle_id'], $num, '节奏风暴未实名或异常验证码'));
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user