supernova-ws /
SuperNova
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Created by Gorlum 21.03.2018 13:27 |
||
| 4 | */ |
||
| 5 | |||
| 6 | namespace Fleet; |
||
| 7 | |||
| 8 | use SN; |
||
| 9 | |||
| 10 | class FleetStatic { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param array $planetIds |
||
| 14 | * @param int $time |
||
| 15 | * |
||
| 16 | * @return \mysqli_result|false |
||
| 17 | */ |
||
| 18 | public static function dbFleetsOnHoldOnPlanetsByIds($planetIds, $time = SN_TIME_NOW) { |
||
| 19 | return SN::$db->doquery( |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 20 | "SELECT `{{fleets}}`.* |
||
| 21 | FROM `{{fleets}}` |
||
| 22 | LEFT JOIN `{{users}}` ON id = fleet_owner |
||
| 23 | WHERE |
||
| 24 | fleet_end_planet_id IN (" . implode(',', $planetIds) . ") |
||
| 25 | AND fleet_mess = 0 |
||
| 26 | AND fleet_start_time <= " . $time . " |
||
| 27 | AND fleet_end_stay >= " . $time . " |
||
| 28 | FOR UPDATE" |
||
| 29 | ); |
||
| 30 | |||
| 31 | } |
||
| 32 | } |