connect('127.0.0.1', '6379'); // $redis->auth('uKliY6dhGYhWAwCW'); // $redis->connect('127.0.0.1', '6379'); while (true) { $res = Redis::rPop('payService'); if ($res) { $jsonToData = \GuzzleHttp\json_decode($res, true); $userID = $jsonToData['userID']; $payMoney = $jsonToData['payAmt']; $favorable_price = $jsonToData['favorable_price']; $Score = $jsonToData['Score']; $GiftsID = $jsonToData['GiftsID']; // 开始执行时间 $startTime = Helper::millisecond(); // 执行存储过程 -- 防刷机制 StoredProcedure::SetUserTabType($userID); //DB::connection('write')->select("SET NOCOUNT ON use QPAccountsDB exec GSP_GP_SetUserTabType12 $userID"); Log::info('GSP_GP_SetUserTabType12 执行时间:' . ((Helper::millisecond() - $startTime) / 1000)); # 单控标签 -- 执行存储过程 StoredProcedure::user_label($userID, 1, $payMoney); Log::info('CheckAccountsLabel 执行时间:' . ((Helper::millisecond() - $startTime) / 1000)); // 服务器通知 $url = config('transfer.stock')['url'] . 'notifyPay'; $data = [ 'userid' => $userID, 'getScore' => $favorable_price, 'score' => $Score, 'giftsid' => empty($GiftsID) ? 0 : $GiftsID ]; (new HttpCurl())->service($url, $data); Log::info('中转服 执行时间:' . ((Helper::millisecond() - $startTime) / 1000)); // AF 事件 $bool = (new AppflyerEvent())->event($userID, '', 'af_purchase_new', $payMoney); Log::info('AF 执行时间:' . ((Helper::millisecond() - $startTime) / 1000)); echo '李雪峰'; } sleep(3); } } }