getHasItfGameIds(); $map = ['verify_status' => 0, 'auto_verify' => 1]; if (count($gameIds) > 0) { $map['game_id'] = ['in', $gameIds]; } $batches = M('testing_resource_batch', 'tab_')->where($map)->select(); foreach ($batches as $batch) { try { $service->verify($batch); echo 'SUCCESS [' . $batch['id'] . ']审核成功' . PHP_EOL; } catch (\Exception $e) { echo 'ERROR [' . $batch['id'] . ']审核异常' . PHP_EOL; } } } public function provide() { $service = new TestingResourceService(); $gameIds = $service->getHasItfGameIds(); $map = ['verify_status' => 1, 'provide_status' => 0]; if (count($gameIds) > 0) { $map['game_id'] = ['in', $gameIds]; } $batches = M('testing_resource_batch', 'tab_')->where($map)->select(); foreach ($batches as $batch) { try { $service->provide($batch); echo 'SUCCESS [' . $batch['id'] . ']发放成功' . PHP_EOL; } catch (\Exception $e) { echo 'ERROR [' . $batch['id'] . ']发放异常' . PHP_EOL; } } } public function send() { // 229 // 231 $game = M('game', 'tab_')->field(['id', 'sdk_version'])->where(['id' => 231])->find(); // $gameResource1 = new GameResource($game); /* $resources = $gameResource1->getResources(1); return; */ /* $successCount = 0; for ($i = 0; $i < 10; $i ++) { $resources = $gameResource1->getResources(1); if (count($resources) > 0) { $successCount ++; } } var_dump($successCount); return; */ /* $role = [ 'role_id' => '6819493', 'user_account' => 'qh11102', 'sdk_version' => 1, ]; $order = [ 'ref_amount' => '10.00', 'ref_id' => '8', 'remark' => '测试', 'order_no' => date('YmdHis') . rand(1000, 9999) . '_1', ]; */ $role = [ 'role_id' => '9571794000008', 'server_id' => '8', 'sdk_version' => 1, ]; $order = [ 'ref_id' => '9000', 'remark' => '测试', 'order_no' => date('YmdHis') . rand(1000, 9999) . '_1', ]; /* $role = [ 'role_id' => '466500506', 'server_id' => '49000152', 'sdk_version' => 2, ]; $order = [ // 'ref_id' => '9000', 'ref_amount' => 6, 'order_no' => date('YmdHis') . rand(1000, 9999) . '_1', ]; */ $gameResource = new GameResource($game); // $result = $gameResource->getResources(); $result = $gameResource->apply($order, $role); var_dump($result); } }