vali 6 jaren geleden
bovenliggende
commit
dda15e1b20
1 gewijzigde bestanden met toevoegingen van 23 en 1 verwijderingen
  1. 23 1
      datainf/logic/HttpServerOnlySet.php

+ 23 - 1
datainf/logic/HttpServerOnlySet.php

@@ -32,7 +32,6 @@ class HttpServerOnlySet
     private $TaskSqlQueue;
     private $userMoneyTotal = [];
 
-
     public function __construct($config)
     {
         $this->httpserver = new \swoole\http\server($config['host'], $config['port']);
@@ -353,8 +352,16 @@ class HttpServerOnlySet
             $oddsResult[0]['winOrLose'] = $v->result;
             $oddsResult[0]['odds'] = $v->odds;
             $getReturnMoney = $settlementBase->stringOdds($oddsResult);
+
+            if ($v->result == 2) {
+                //返水钱扣掉
+                $pv = $this->gethuishuilv();
+                $getReturnMoney['returnMoney'] = 1 - $pv;
+            }
             $returnMoney += $getReturnMoney['returnMoney'] * $v->bet_money;
+
         }
+
         $returnMoney = sprintf("%.2f", substr(sprintf("%.3f", $returnMoney), 0, -1));
         // 判断盈亏  1 赢  2 输  3 平
         $game_status = $returnMoney > $simplexData->money ? 1 : ($returnMoney == $simplexData->money ? 3 : 2);
@@ -605,6 +612,21 @@ class HttpServerOnlySet
         return true;
     }
 
+    private function gethuishuilv()
+    {
+        $key = "HUISHUILV";
+        $rv = $this->getRedis()->get($key);
+        if ($rv) {
+            return floatval($rv);
+        }
+        $rv = DB::table('setinfo')->where('identity', '1000')->first();
+        if ($rv) {
+            $pl = floatval(trim($rv->infocontent));
+            $this->getRedis()->setex($key, 300, $pl);
+            return $pl;
+        }
+        return 0;
+    }
 
     private function sqltoRedisqueue()
     {