getJsonData(); if (!empty($arrJson)) { foreach ($arrJson as $k => &$item) { $item['agent_uid'] = ''; $item['is_deduction'] = 0; if (!empty($item['share_code']) && empty($item['invite_uid'])) { // 兼容一下,置顶定义混乱了, share_code, invite_uid. $item['invite_uid'] = $item['share_code']; } if (!empty($item['channel_uid'])) { $channelInfo = ChannelModel::where(['uid' => $item['channel_uid'], 'mom_app_uid' => $item['mom_app_uid']])->first(['agent_uid']); if (empty($channelInfo)) { logger('新增充值查不到渠道的报错日志:' . json_encode($item, true)); continue; } $item['agent_uid'] = $channelInfo->agent_uid; $orderInt = PayLogsModel::query()->where(['order_sn' => $item['order_sn'], 'pay_status' => 1, 'order_status' => 1])->count(); if (empty($orderInt)) { // 扣量计算 $item = $service->oneRandDeduction($item); } } $arrJson[$k] = $item; } $service->inc($arrJson); } return new SuccessCommonResponse(); } }