hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include_once "/Common/Logging.php";
include_once "/db/DBOper.php";
 
\Logging\CreateLogging("payorderupd.php");
 
$channel = "tqxbqy";
$find = array("Channel" => $channel);
\DBOper\Find("PayOrder", $find, $orderArray, array("OrderAmount" => 1, "OriginalAmount" => 1, "OrderID" => 1, "State" => 1));
 
$totalCount = count($orderArray);
\Logging\LogInfo("totalCount:" . $totalCount);
echo date("Y-m-d h:m:s") . "<br/>";
echo "totalCount:" . $totalCount . "<br/>";
$okCount = 0;
$amountTotal = 0;
$amountTotalFail = 0;
foreach ($orderArray as $info) {
    $OrderID = $info["OrderID"];
    $State = $info["State"];
    $OrderAmount = floatval($info["OrderAmount"]);
    $OriginalAmount = floatval($info["OriginalAmount"]);
    if (\DBOper\Update(
        "PayOrder",
        array("OrderID" => $OrderID),
        array("OrderAmount" => $OrderAmount, "OriginalAmount" => $OriginalAmount)
    )) {
        \Logging\LogInfo("OrderID:" . $OrderID);
        $okCount += 1;
        if ($State == 1) {
            $amountTotal += $OrderAmount;
        } else {
            $amountTotalFail += $OrderAmount;
        }
    }
}
\Logging\LogInfo("okCount:" . $okCount);
\Logging\LogInfo("amountTotal:" . $amountTotal);
\Logging\LogInfo("amountTotalFail:" . $amountTotalFail);
echo "okCount:" . $okCount . "<br/>";
echo "amountTotal:" . $amountTotal . "<br/>";
echo "amountTotalFail:" . $amountTotalFail . "<br/>";