전투 추가 구현

This commit is contained in:
Hide_D committed 2018-08-18 10:53:04 +09:00
1 parent 8fbbd15dbe
commit ce8ab00a37
6 files changed
+65 -25

No files matched your search

+16
View File
@@ -299,5 +299,21 @@ class WarUnitGeneral extends WarUnit{
return true;
}
/**
* @param \MeekroDB $db
*/
function applyDB($db):bool{
$updateVals = [];
foreach(array_keys($this->updatedVar) as $key){
$updateVals[$key] = $this->raw[$key];
}
if(!$updateVals){
return false;
}
$db->update('general', $updateVals, 'no=%i', $this->raw['no']);
return $db->affectedRows() > 0;
}
}