game/_incl_data/class/UserEffects.php

25 lines
615 B
PHP
Raw Normal View History

<?php
use Core\Db;
class UserEffects
{
/** <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
* @param int $uid id <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param int $id id <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return void
*/
public static function addById(int $uid, int $id)
{
$eff = Db::getRow('select mname, mdata, oneType, id2 from eff_main where id2 = ?', [$id]);
if (!$eff['id2']) {
return;
}
Db::sql(
'insert into eff_users (overType, id_eff, uid, name, timeUse, data) values (?,?,?,?,unix_timestamp(),?)',
[$eff['oneType'], $eff['id2'], $uid, $eff['mname'], $eff['mdata']]
);
}
}