You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.9 KiB
PHP
72 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* 定时自动完成
|
|
*/
|
|
namespace Admin\Controller;
|
|
use Admin\Model\SpendModel;
|
|
use Think\Think;
|
|
use Base\Tool\Printer;
|
|
use Base\Tool\TaskClient;
|
|
use Base\Service\TestingResourceService;
|
|
use GuzzleHttp\Client;
|
|
use think\Db;
|
|
use Base\Tool\GameResource;
|
|
|
|
class GameApiController extends Think {
|
|
|
|
protected function _initialize()
|
|
{
|
|
C(api('Config/lists'));
|
|
}
|
|
|
|
public function verify()
|
|
{
|
|
$service = new TestingResourceService();
|
|
|
|
$gameIds = $service->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) {
|
|
$service->verify($batch);
|
|
}
|
|
}
|
|
|
|
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) {
|
|
$service->provide($batch);
|
|
}
|
|
}
|
|
|
|
public function send()
|
|
{
|
|
$game = M('game', 'tab_')->field(['id', 'sdk_version'])->where(['id' => 232])->find();
|
|
$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',
|
|
];
|
|
$gameResource = new GameResource($game);
|
|
$result = $gameResource->getResources();
|
|
var_dump($result);
|
|
}
|
|
}
|