vali 6 лет назад
Родитель
Сommit
2986f901d2

+ 10 - 4
datainf/logic/HttpServerOnlySet.php

@@ -220,14 +220,20 @@ class HttpServerOnlySet
         $bet_type = $this->GP('bettype');
         $nowArray = $this->PDatas['settlement_middle_detail_array'][$bet_type];
 
+        $ids = [];
         foreach ($nowArray as $order => $val) {
             $money = abs(floatval($val->money));
-            $acc = $val->account_identity;
-            $sql = "update account_detailed  set  cash=cash-$money where identity='$acc' ";
-            $this->PushSqlToArray($sql);
-            $ids[] = $order;
+            if (100 * $money > 1) {
+                $acc = $val->account_identity;
+                $sql = "update account_detailed  set  cash=cash-$money where identity='$acc' ";
+                $this->PushSqlToArray($sql);
+                $ids[] = $order;
+            }
         }
 
+        if (count($ids) <= 0) {
+            return true;
+        }
         $ids_array = array_map(function ($i) {
             return "'$i'";
         }, $ids);

+ 3 - 3
datainf/logic/HttpServerRedisToSql.php

@@ -94,7 +94,7 @@ class HttpServerRedisToSql
             $this->httpserver->account->add();
 
             $batchsql = [];
-            $max = 5000;
+            $max = 100;
 
             for ($i = 0; $i < $max; $i++) {
                 $now = $redis->rpop(self::SQLKEY);
@@ -112,11 +112,11 @@ class HttpServerRedisToSql
                 try {
                     $erowcount = $pdo->exec($sqlstr);
                 } catch (\Exception $e) {
-                    echo "发生异常:" . $e->getCode() . ' ---- ' . print_r($e->getMessage(),true) . "\n";
+                    echo "发生异常:" . $e->getCode() . ' ---- ' . print_r($e->getMessage(), true) . "\n";
                 }
 
                 if (!$erowcount) {
-                    echo "\n发生错误:" . $pdo->errorCode() . ' ---- ' . $pdo->errorInfo() . "\n";
+                    echo "\n发生错误:" . $pdo->errorCode() . ' ---- ' . print_r($pdo->errorInfo(), true) . "\n";
                     echo "错误sql: " . $sqlstr . "\n\n";
                 } else {
                     echo "成功运行:" . count($batchsql) . " 条!\n";

+ 1 - 1
datainf/logic/HttpServerSettelement.php

@@ -224,7 +224,7 @@ class HttpServerSettelement
 
             //分页处理数据
             $PageOrder_ids_1 = array_chunk($order_ids, 100);
-            $tcount = ceil(count($order_ids) / 500);
+            $tcount = ceil(count($order_ids) / 100);
             $i = 1;
             unset($order_ids);