|
|
@ -77,9 +77,10 @@ class TestingResourceController extends BaseController
|
|
|
|
$users = [];
|
|
|
|
$users = [];
|
|
|
|
$bindings = [];
|
|
|
|
$bindings = [];
|
|
|
|
$bindingRoles = [];
|
|
|
|
$bindingRoles = [];
|
|
|
|
|
|
|
|
$applyRecords = [];
|
|
|
|
if (count($roles) > 0) {
|
|
|
|
if (count($roles) > 0) {
|
|
|
|
$users = M('user', 'tab_')->field(['id', 'phone'])->where(['id' => ['in', $userIds]])->select();
|
|
|
|
$users = M('user', 'tab_')->field(['id', 'phone', 'lock_status'])->where(['id' => ['in', $userIds]])->select();
|
|
|
|
$uesrs = index_by_column('id', $users);
|
|
|
|
$users = index_by_column('id', $users);
|
|
|
|
$bindingRows = M('testing_binding', 'tab_')->where(['_string' => implode(' or ', $bindingOrWhere)])->select();
|
|
|
|
$bindingRows = M('testing_binding', 'tab_')->where(['_string' => implode(' or ', $bindingOrWhere)])->select();
|
|
|
|
$bindingRoleIds = [];
|
|
|
|
$bindingRoleIds = [];
|
|
|
|
foreach ($bindingRows as $bindingRow) {
|
|
|
|
foreach ($bindingRows as $bindingRow) {
|
|
|
@ -93,6 +94,56 @@ class TestingResourceController extends BaseController
|
|
|
|
->select();
|
|
|
|
->select();
|
|
|
|
$bindingRoles = index_by_column('game_role_id', $bindingRoles);
|
|
|
|
$bindingRoles = index_by_column('game_role_id', $bindingRoles);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$verifyItems = M('testing_resource_batch', 'tab_')
|
|
|
|
|
|
|
|
->field('sum(apply_amount) amount, game_id, role_id')
|
|
|
|
|
|
|
|
->where([
|
|
|
|
|
|
|
|
'verify_status' => 0,
|
|
|
|
|
|
|
|
'_string' => implode(' or ', $bindingOrWhere)
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
->group('game_id,role_id')->select();
|
|
|
|
|
|
|
|
$verifyRecords = [];
|
|
|
|
|
|
|
|
foreach ($verifyItems as $item) {
|
|
|
|
|
|
|
|
$verifyRecords[$this->getGameRoleId($item['game_id'], $item['role_id'])] = $item['amount'] ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$provideItems = M('testing_resource_batch', 'tab_')
|
|
|
|
|
|
|
|
->field('sum(provide_amount) amount, game_id, role_id')
|
|
|
|
|
|
|
|
->where([
|
|
|
|
|
|
|
|
'verify_status' => 1,
|
|
|
|
|
|
|
|
'_string' => implode(' or ', $bindingOrWhere)
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
->group('game_id,role_id')->select();
|
|
|
|
|
|
|
|
$provideRecords = [];
|
|
|
|
|
|
|
|
foreach ($provideItems as $item) {
|
|
|
|
|
|
|
|
$provideRecords[$this->getGameRoleId($item['game_id'], $item['role_id'])] = $item['amount'] ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$todayProvideItems = M('testing_resource_batch', 'tab_')
|
|
|
|
|
|
|
|
->field('sum(provide_amount) amount, game_id, role_id')
|
|
|
|
|
|
|
|
->where([
|
|
|
|
|
|
|
|
'verify_status' => 1,
|
|
|
|
|
|
|
|
'_string' => implode(' or ', $bindingOrWhere),
|
|
|
|
|
|
|
|
'provide_time' => ['egt', strtotime(date('Y-m-d 00:00:00'))],
|
|
|
|
|
|
|
|
'provide_time' => ['elt', strtotime(date('Y-m-d 23:59:59'))],
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
->group('game_id,role_id')->select();
|
|
|
|
|
|
|
|
$todayProvideRecords = [];
|
|
|
|
|
|
|
|
foreach ($todayProvideItems as $item) {
|
|
|
|
|
|
|
|
$todayProvideRecords[$this->getGameRoleId($item['game_id'], $item['role_id'])] = $item['amount'] ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$applyItems = M('testing_resource_batch', 'tab_')
|
|
|
|
|
|
|
|
->field('sum(apply_amount) amount, game_id, role_id')
|
|
|
|
|
|
|
|
->where([
|
|
|
|
|
|
|
|
'_string' => implode(' or ', $bindingOrWhere),
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
->group('game_id,role_id')->select();
|
|
|
|
|
|
|
|
$applyRecords = [];
|
|
|
|
|
|
|
|
foreach ($applyItems as $item) {
|
|
|
|
|
|
|
|
$applyRecords[$this->getGameRoleId($item['game_id'], $item['role_id'])] = $item['amount'] ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$spendItems = [];
|
|
|
|
$spendItems = [];
|
|
|
|
if (count($bindingRoles) > 0) {
|
|
|
|
if (count($bindingRoles) > 0) {
|
|
|
@ -132,11 +183,11 @@ class TestingResourceController extends BaseController
|
|
|
|
'base_quota' => $binding ? $binding['base_quota'] : 0,
|
|
|
|
'base_quota' => $binding ? $binding['base_quota'] : 0,
|
|
|
|
'other_quota' => $binding ? $binding['other_quota'] : 0,
|
|
|
|
'other_quota' => $binding ? $binding['other_quota'] : 0,
|
|
|
|
'quota' => $bindingRole && isset($spendItems[$bindingRole['game_role_id']]) ? $spendItems[$bindingRole['game_role_id']] : 0,
|
|
|
|
'quota' => $bindingRole && isset($spendItems[$bindingRole['game_role_id']]) ? $spendItems[$bindingRole['game_role_id']] : 0,
|
|
|
|
'verify_amount' => 0,
|
|
|
|
'verify_amount' => $verifyRecords[$role['game_role_id']] ?? 0,
|
|
|
|
'provide_amount' => 0,
|
|
|
|
'provide_amount' => $provideRecords[$role['game_role_id']] ?? 0,
|
|
|
|
'today_amount' => 0,
|
|
|
|
'today_amount' => $todayProvideRecords[$role['game_role_id']] ?? 0,
|
|
|
|
'apply_amount' => 0,
|
|
|
|
'apply_amount' => $applyRecords[$role['game_role_id']] ?? 0,
|
|
|
|
'status' => '可用',
|
|
|
|
'status' => $user && $user['lock_status'] == 1 ? '正常' : '锁定',
|
|
|
|
'create_time' => date('Y-m-d H:i:s', $role['create_time'])
|
|
|
|
'create_time' => date('Y-m-d H:i:s', $role['create_time'])
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -469,7 +520,7 @@ class TestingResourceController extends BaseController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$bindingRole = M('user_play_info', 'tab_')
|
|
|
|
$bindingRole = M('user_play_info', 'tab_')
|
|
|
|
->field(['id', 'role_id', 'user_id', 'promote_id'])
|
|
|
|
->field(['id', 'role_id', 'user_id', 'promote_id', 'game_id'])
|
|
|
|
->where(['game_id' => $gameId, 'role_id' => $binding['bind_role_id']])
|
|
|
|
->where(['game_id' => $gameId, 'role_id' => $binding['bind_role_id']])
|
|
|
|
->find();
|
|
|
|
->find();
|
|
|
|
if (is_null($bindingRole)) {
|
|
|
|
if (is_null($bindingRole)) {
|
|
|
|