Mass update

This commit is contained in:
2022-12-30 21:03:37 +02:00
parent 7a5dfd22a7
commit e9ec7eb2f2
172 changed files with 14838 additions and 35914 deletions
+7 -7
View File
@@ -1,25 +1,25 @@
<?php
use Insallah\Db;
use Core\Db;
class UserStats
{
/**
* Ñîáèðàåò ñóììû âñåõ áîíóñîâ ñ îäåòûõ ïðåäìåòîâ è àêòèâíûõ ýôåêòîâ.
* @param $userId
* @param int $userId
* @param bool $showAll
* @return array
*/
public static function getAllBonuses($userId, $showAll = false)
public static function getAllBonuses(int $userId, bool $showAll = false): array
{
require_once '_incl_data/class/Insallah/Core/Db.php';
$db = new Db();
$q = 'select data from items_users where uid = ? and inOdet > 0 and `delete` = 0
union all select data from eff_users where uid = ? and `delete` = 0';
$iData = $db::getColumn($q, [$userId, $userId]);
$iData = Db::getColumn($q, [$userId, $userId]);
$params = [];
foreach ($iData as $datum) {
foreach (explode('|', $datum) as $inner) {
list($a, $b) = explode('=', $inner);
[$a, $b] = explode('=', $inner);
if (strpos($a, 'add') !== false || strpos($a, 'sv') !== false || $showAll) {
if (isset($params[$a])) {
$params[$a] += $b;