vali пре 6 година
родитељ
комит
cabd294b5c
1 измењених фајлова са 14 додато и 5 уклоњено
  1. 14 5
      app/Logic/WinfailLogic.php

+ 14 - 5
app/Logic/WinfailLogic.php

@@ -328,10 +328,6 @@ class WinfailLogic
             }
         }
 
-        $game_code = $orderInfo->game_code;
-        $match_id = $orderInfo->match_id;
-        $order_id = $orderInfo->order_id;
-
         $winorfalsedef = ['result' => 2, 'matchResult' => 'noRuleOrError'];
         foreach ($matchArray as $matchModel) {
             if ($bet_type == 2) {
@@ -369,13 +365,26 @@ class WinfailLogic
 
             $win = intval($winorfalse['result']);
             $rwin = ($win == 1) ? 1 : ($win == -1 ? 2 : 3);
+
+            if ($bet_type == 2) {
+                $rwinarr[] = $rwin;
+            }
+
             $matword = $winorfalse['matchResult'];
 
             DB::update('update money_buy_match  set "result"=?,matchresult=? where match_id=? and game_code=? and id=?', [$win, $matword, $match_id, $game_code, $mid]);
         }
+
         if ($bet_type == 1) {
-            DB::update("update money_buy_simplex  set game_status=$rwin  where  order_id='$order_id' and   game_code='$game_code' and  match_id='$match_id'  ");
+            DB::update("update money_buy_simplex  set game_status=$rwin  where  order_id='$order_id' ");
         } else {
+            $rwin = 2;
+            foreach ($rwinarr as $nwin) {
+                if ($nwin == -1) {
+                    $rwin = -1;
+                    break;
+                }
+            }
             DB::update("update money_buy_str  set game_status=$rwin  where  order_id='$order_id'  ");
         }