전투 추가 구현

This commit is contained in:
2018-08-18 10:53:04 +09:00
parent 8fbbd15dbe
commit ce8ab00a37
6 changed files with 65 additions and 25 deletions
+14
View File
@@ -51,4 +51,18 @@ class WarUnitCity extends WarUnit{
return true;
}
function applyDB($db):bool{
$updateVals = [];
foreach(array_keys($this->updatedVar) as $key){
$updateVals[$key] = $this->raw[$key];
}
if(!$updateVals){
return false;
}
$db->update('city', $updateVals, 'city=%i', $this->raw['city']);
return $db->affectedRows() > 0;
}
}