은퇴 후 명전 등록 시 '이전 값보다 높아진 경우'에만 경신하도록 수정

This commit is contained in:
2019-03-05 01:45:03 +09:00
parent 297767a42b
commit 881bf08aee
+15 -4
View File
@@ -2188,7 +2188,7 @@ function CheckHall($no) {
];
$jsonAux = Json::encode($aux);
$db->insertUpdate('ng_hall', [
$db->insertIgnore('ng_hall', [
'server_id'=>UniqueConst::$serverID,
'scenario'=>$scenarioIdx,
'general_no'=>$no,
@@ -2196,10 +2196,21 @@ function CheckHall($no) {
'value'=>$general[$typeName]??0,
'owner'=>$general['owner']??null,
'aux'=>$jsonAux
],[
'value'=>$general[$typeName]??0,
'aux'=>$jsonAux
]);
if($db->affectedRows() == 0){
$db->update('ng_hall', [
'value'=>$general[$typeName]??0,
'aux'=>$jsonAux
],
'server_id = %s AND scenario = %i AND general_no = %i AND type = %i AND value < %?',
UniqueConst::$serverID,
$scenarioIdx,
$no,
$idx,
$general[$typeName]??0);
}
}
}