修改玩家迁移

master
ELF 5 years ago
parent 0a7096623b
commit 25fa79ea55

@ -92,7 +92,8 @@ class PromoteService {
$balanceCoinMode = isset($params['balance_coin_mode']) ? $params['balance_coin_mode'] : 0;
$type = isset($params['type']) ? $params['type'] : 0;
$shiftIds = isset($params['shift_ids']) && $params['shift_ids'] ? $params['shift_ids'] : [];
$createPromoteId = empty(session('promote_auth.pid')) ? 0 : session('promote_auth.pid');
$creatorId = isset($params['creator_id']) ? $params['creator_id'] : 0;
$creatorType = isset($params['creator_type']) ? $params['creator_type'] : 0;
if ($fromPromoteId == $toPromoteId) {
return [
@ -140,7 +141,8 @@ class PromoteService {
'order_time' => strtotime($orderTime),
'balance_coin_mode' => $balanceCoinMode,
'create_time' => time(),
'create_promote_id' => $createPromoteId,
'creator_id' => $creatorId,
'creator_type' => $creatorType,
'status' => 0,
'type' => $type,
'shift_ids' => json_encode($shiftIds)
@ -299,9 +301,18 @@ class PromoteService {
{
$toPromoteId = $task['to_promote_id'];
$fromPromoteId = $task['from_promote_id'];
$orderTime = $task['order_time'];
$shiftIds = json_decode($task['shift_ids'], true) ?? [];
$createPromote = M('promote', 'tab_')->where(['create_promote_id' => $task['create_promote_id']])->find();
$creator = null;
$opAccount = '';
if ($task['creator_type'] == 1) {
$creator = M('promote', 'tab_')->where(['id' => $task['creator_id']])->find();
$opAccount = $creator ? $creator['account'] : '';
} else {
$creator = M('ucenter_member', 'sys_')->where(['id' => $task['creator_id']])->find();
$opAccount = $creator ? $creator['username'] : '';
}
$toPromote = M('promote', 'tab_')->where(['id' => $toPromoteId])->find();
$fromPromote = M('promote', 'tab_')->where(['id' => $fromPromoteId])->find();
@ -334,9 +345,9 @@ class PromoteService {
'promote_account_to' => $toPromote['account'],
'remark' => '玩家迁移',
'create_time' => time(),
'op_id' => $createPromote ? $createPromote['id'] : 0,
'op_account' => $createPromote ? $createPromote['account'] : '',
'op_type' => 1,
'op_id' => $creator ? $creator['id'] : 0,
'op_account' => $opAccount,
'op_type' => $task['creator_type'],
'bind_type' => 1,
];
}
@ -370,9 +381,14 @@ class PromoteService {
M('user_play', 'tab_')->where($otherMap)->save($updateData);
M('user_play_info', 'tab_')->where($otherMap)->save($updateData);
M('spend', 'tab_')->where($otherMap)->where(['is_check' => ['in','1,2']])->save($updateData); // 只改未对账的数据
M('deposit', 'tab_')->where($otherMap)->save($updateData);
M('bind_spend', 'tab_')->where($otherMap)->save($updateData);
$orderMap1 = $otherMap;
$orderMap1['pay_time'] = ['egt', $orderTime];
M('spend', 'tab_')->where($orderMap1)->where(['is_check' => ['in','1,2']])->save($updateData); // 只改未对账的数据
M('bind_spend', 'tab_')->where($orderMap1)->save($updateData);
$orderMap2 = $otherMap;
$orderMap2['create_time'] = ['egt', $orderTime];
M('deposit', 'tab_')->where($orderMap2)->save($updateData);
$status = M('shift_task', 'sys_')->where('id=' . $task['id'])->save(['status' => 1, 'handle_time' => time()]);
if (!$status) {

Loading…
Cancel
Save