Рефакторинг, отказ от $u->testAction('',2) для разрыва зависимости с User::class. Добавлен зачаточный генератор запросов.

This commit is contained in:
2024-05-14 17:24:54 +03:00
parent 7b8ffdfd6a
commit bc136cc030
11 changed files with 802 additions and 742 deletions

View File

@@ -1,6 +1,7 @@
<?php
use Helper\Conversion;
use Model\ActionModel;
use Model\Constant\Stat;
class BotPriemLogic
@@ -105,7 +106,6 @@ class BotPriemLogic
private static function testpriem($pl): int
{
global $u;
$notr = 0;
$statnames = new Stat();
$statnames->getRequirement();
@@ -125,8 +125,8 @@ class BotPriemLogic
}
if ($pl['xuse'] > 0) {
$xu = $u->testAction('`vars` = "use_priem_' . BotLogic::$bot['battle'] . '_' . BotLogic::$bot['id'] . '" AND `vals` = "' . $pl['id'] . '" LIMIT ' . $pl['xuse'] . '', 2);
if ($xu[0] >= $pl['xuse']) {
$xu = ActionModel::testCount(['vars = ' . 'use_priem_' . BotLogic::$bot['battle'] . '_' . BotLogic::$bot['id'], "vals = {$pl['id']}",], $pl['xuse']);
if ($xu >= $pl['xuse']) {
$notr++;
}
}