@@ -337,9 +337,9 @@ |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
340 | - * @param $string |
|
340 | + * @param string $string |
|
341 | 341 | * |
342 | - * @return mixed|string |
|
342 | + * @return string |
|
343 | 343 | */ |
344 | 344 | protected function stringEscape($string) { |
345 | 345 | return |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @return array|bool|mysqli_result|null |
67 | 67 | */ |
68 | 68 | public static function db_user_list_non_bots() { |
69 | - $query = doquery("SELECT `id` FROM {{users}} WHERE `user_as_ally` IS NULL AND `user_bot` = " . USER_BOT_PLAYER . " FOR UPDATE;"); |
|
69 | + $query = doquery("SELECT `id` FROM {{users}} WHERE `user_as_ally` IS NULL AND `user_bot` = ".USER_BOT_PLAYER." FOR UPDATE;"); |
|
70 | 70 | |
71 | 71 | return $query; |
72 | 72 | } |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | public static function db_user_lock_with_target_owner_and_acs($user, $planet = array()) { |
75 | 75 | static::$dbStatic->execute( |
76 | 76 | static::buildSelectLock() |
77 | - ->where(array("`id` = " . idval($user['id']) . |
|
78 | - (isset($planet['id_owner']) ? ' OR `id` = ' . idval($planet['id_owner']) : ''))) |
|
77 | + ->where(array("`id` = ".idval($user['id']). |
|
78 | + (isset($planet['id_owner']) ? ' OR `id` = '.idval($planet['id_owner']) : ''))) |
|
79 | 79 | ); |
80 | 80 | |
81 | 81 | // doquery("SELECT 1 FROM {{users}} WHERE `id` = " . idval($user['id']) . |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | public static function db_user_list_set_mass_mail(&$owners_list, $set) { |
112 | - return classSupernova::db_upd_record_list(LOC_USER, !empty($owners_list) ? '`id` IN (' . implode(',', $owners_list) . ');' : '', $set); |
|
112 | + return classSupernova::db_upd_record_list(LOC_USER, !empty($owners_list) ? '`id` IN ('.implode(',', $owners_list).');' : '', $set); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | public static function db_user_list_set_by_ally_and_rank($ally_id, $ally_rank_id, $set) { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | |
129 | 129 | public static function db_user_count($online = false) { |
130 | - $result = doquery('SELECT COUNT(id) AS user_count FROM `{{users}}` WHERE user_as_ally IS NULL' . ($online ? ' AND onlinetime > ' . (SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ''), true); |
|
130 | + $result = doquery('SELECT COUNT(id) AS user_count FROM `{{users}}` WHERE user_as_ally IS NULL'.($online ? ' AND onlinetime > '.(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ''), true); |
|
131 | 131 | |
132 | 132 | return isset($result['user_count']) ? $result['user_count'] : 0; |
133 | 133 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | return doquery("SELECT u.*, COUNT(r.id) AS referral_count, SUM(r.dark_matter) AS referral_dm FROM {{users}} as u |
168 | 168 | LEFT JOIN {{referrals}} as r on r.id_partner = u.id |
169 | 169 | WHERE" . |
170 | - ($online ? " `onlinetime` >= " . (SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ' user_as_ally IS NULL') . |
|
170 | + ($online ? " `onlinetime` >= ".(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ' user_as_ally IS NULL'). |
|
171 | 171 | " GROUP BY u.id |
172 | 172 | ORDER BY user_as_ally, {$sort} ASC"); |
173 | 173 | } |