|
|
|
@ -330,12 +330,20 @@ class PromoteService {
|
|
|
|
|
|
|
|
|
|
$map = [];
|
|
|
|
|
$map['promote_id'] = $fromPromote['id'];
|
|
|
|
|
$spendMap = $map;
|
|
|
|
|
if (count($shiftIds) > 0) {
|
|
|
|
|
$map['id'] = ['in', $shiftIds];
|
|
|
|
|
$spendMap['user_id'] = $map['id'] = ['in', $shiftIds];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$users = M('user', 'tab_')->field(['id', 'account', 'nickname'])->where($map)->select();
|
|
|
|
|
|
|
|
|
|
$spendMap['pay_time'] = ['egt', $orderTime];
|
|
|
|
|
$payAmountRows = M('spend', 'tab_')
|
|
|
|
|
->field(['user_id', 'sum(pay_amount) payAmount'])
|
|
|
|
|
->where($spendMap)
|
|
|
|
|
->select();
|
|
|
|
|
$payAmountRows = index_by_column('user_id', $payAmountRows);
|
|
|
|
|
|
|
|
|
|
$mends = [];
|
|
|
|
|
foreach ($users as $item) {
|
|
|
|
|
$mends[] = [
|
|
|
|
@ -349,6 +357,7 @@ class PromoteService {
|
|
|
|
|
'remark' => $remark == '' ? ($task['creator_type'] == 0 ? '后台补链' : '玩家迁移') : $remark,
|
|
|
|
|
'order_time' => $orderTime,
|
|
|
|
|
'create_time' => time(),
|
|
|
|
|
'pay_amount' => isset($payAmountRows[$item['id']]) ? $payAmountRows[$item['id']]['payAmount'] : 0,
|
|
|
|
|
'op_id' => $creator ? $creator['id'] : 0,
|
|
|
|
|
'op_account' => $opAccount,
|
|
|
|
|
'op_type' => $task['creator_type'],
|
|
|
|
|