objDb->getAll($sql); $c = count($redpacks); $sc = 0; foreach ($redpacks as $redpack) { $trxId = $redpack['transfer_trx_id']; $redpackId = $redpack['id']; $i = 0; do { sleep($i * 0.1); $json = Eos::returnRedpack($redpackId, $trxId, $redpack['sender'], $redpack['net_id']); $ret = json_decode($json, true); $i += 1; } while ($i < 3 && !$ret['transaction_id']); if ($ret['transaction_id']) { $sc += 1; Eos::log("redpack:{$log['id']} return success"); } else { Eos::log("redpack:{$log['id']} return error"); } } $ct = microtime(true) - $st; Eos::log("处理{$c}记录,成功{$sc},耗时{$ct}");