From 881bf08aee01d5e7d06dc0cc88c12a761fdcbcad Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 5 Mar 2019 01:45:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=80=ED=87=B4=20=ED=9B=84=20=EB=AA=85?= =?UTF-8?q?=EC=A0=84=20=EB=93=B1=EB=A1=9D=20=EC=8B=9C=20'=EC=9D=B4?= =?UTF-8?q?=EC=A0=84=20=EA=B0=92=EB=B3=B4=EB=8B=A4=20=EB=86=92=EC=95=84?= =?UTF-8?q?=EC=A7=84=20=EA=B2=BD=EC=9A=B0'=EC=97=90=EB=A7=8C=20=EA=B2=BD?= =?UTF-8?q?=EC=8B=A0=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index d41e1988..90c6230a 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -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); + } + } }