|
@@ -117,6 +117,16 @@ class MailController extends Controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$params['type'] = 2;
|
|
$params['type'] = 2;
|
|
|
|
|
+ $game_ids = [];
|
|
|
|
|
+ if ($params['type'] == 2) {
|
|
|
|
|
+ $game_id_string = str_replace([',', ';', ';'], ',', $params['game_id'] ?? '');
|
|
|
|
|
+ $game_ids = preg_split('/\s*,\s*/', trim($game_id_string), -1, PREG_SPLIT_NO_EMPTY);
|
|
|
|
|
+ $game_ids = array_values(array_unique(array_map('trim', $game_ids)));
|
|
|
|
|
+
|
|
|
|
|
+ if (empty($game_ids)) {
|
|
|
|
|
+ return $this->json(500, '私人邮件缺少发件人');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$type = 0;
|
|
$type = 0;
|
|
|
$amount = 0;
|
|
$amount = 0;
|
|
@@ -150,6 +160,9 @@ class MailController extends Controller
|
|
|
if ($lottery_amount < $value['number']) {
|
|
if ($lottery_amount < $value['number']) {
|
|
|
return $this->json(500, '彩金额度不足');
|
|
return $this->json(500, '彩金额度不足');
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($params['type'] == 2 && $value['id'] === "30000" && $lottery_amount < $value['number'] * count($game_ids)) {
|
|
|
|
|
+ return $this->json(500, '彩金额度不足');
|
|
|
|
|
+ }
|
|
|
$change_score = $value['number'];
|
|
$change_score = $value['number'];
|
|
|
|
|
|
|
|
$value['number'] = $value['number'] * 100;
|
|
$value['number'] = $value['number'] * 100;
|
|
@@ -165,20 +178,27 @@ class MailController extends Controller
|
|
|
|
|
|
|
|
//个人公告
|
|
//个人公告
|
|
|
if ($params['type'] == 2) {
|
|
if ($params['type'] == 2) {
|
|
|
- $uids = [];
|
|
|
|
|
- if(strstr($params['game_id'],';')){
|
|
|
|
|
- $uids = explode(';',$params['game_id']);
|
|
|
|
|
- }else{
|
|
|
|
|
- $uids = [trim($params['game_id'])];
|
|
|
|
|
|
|
+ $user_info_list = DB::connection('write')->table('QPAccountsDB.dbo.AccountsInfo')
|
|
|
|
|
+ ->whereIn('GameID', $game_ids)
|
|
|
|
|
+ ->select('UserID','Channel','GameID')
|
|
|
|
|
+ ->get();
|
|
|
|
|
+ $user_info_map = [];
|
|
|
|
|
+ foreach ($user_info_list as $item) {
|
|
|
|
|
+ $user_info_map[(string)$item->GameID] = $item;
|
|
|
}
|
|
}
|
|
|
- foreach ($uids as $game_id){
|
|
|
|
|
- $UserInfo = DB::connection('write')->table('QPAccountsDB.dbo.AccountsInfo')->where('GameID', $game_id)
|
|
|
|
|
- ->select('UserID','Channel')
|
|
|
|
|
- ->first();
|
|
|
|
|
|
|
|
|
|
- if (!$UserInfo) {
|
|
|
|
|
- return $this->json(500, '未查询到该用户');
|
|
|
|
|
|
|
+ $missing_game_ids = [];
|
|
|
|
|
+ foreach ($game_ids as $game_id) {
|
|
|
|
|
+ if (!isset($user_info_map[(string)$game_id])) {
|
|
|
|
|
+ $missing_game_ids[] = $game_id;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!empty($missing_game_ids)) {
|
|
|
|
|
+ return $this->json(500, '未查询到该用户:' . implode(',', $missing_game_ids));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ foreach ($game_ids as $game_id){
|
|
|
|
|
+ $UserInfo = $user_info_map[(string)$game_id];
|
|
|
$user_id = $UserInfo->UserID;
|
|
$user_id = $UserInfo->UserID;
|
|
|
$Channel = $UserInfo->Channel;
|
|
$Channel = $UserInfo->Channel;
|
|
|
$data = [
|
|
$data = [
|