where(['verify_status' => 0])->select(); foreach ($batches as $batch) { $service->verify($batch); } } public function provide() { $service = new TestingResourceService(); $batches = M('testing_resource_batch', 'tab_')->where(['verify_status' => 1, 'provide_status' => 0])->select(); foreach ($batches as $batch) { $service->provide($batch); } } public function send() { $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', ]; $service = new TestingResourceService(); $result = $service->provideFromGameCat($order, $role); var_dump($result); } }