ssvfdn 3 ヶ月 前
コミット
917354c7f9
1 ファイル変更9 行追加2 行削除
  1. 9 2
      app/controller/PlayerControl.php

+ 9 - 2
app/controller/PlayerControl.php

@@ -44,12 +44,19 @@ class PlayerControl extends BaseController
         $game_ids = explode(",", $game_ids);
 
         $unameList = [];
+        $emptyUnameList = [];
         foreach ($account_ids as $account_id) {
             $account_id = trim($account_id);
-            if(!empty($account_id)) {
+            if(!empty($account_id) && is_int($account_id)) {
                 $unameList[] = $account_id;
+            }else {
+                $emptyUnameList[] = $account_id;
             }
         }
+        if(!empty($emptyUnameList)) {
+            return json_error([], '不存在玩家:' . implode(",", $emptyUnameList));
+        }
+
         $gameList = [];
         foreach ($game_ids as $game_id) {
             $game_id = trim($game_id);
@@ -79,8 +86,8 @@ class PlayerControl extends BaseController
         $merchantsUserList = MerchantsUserModel::getPlayerListByIds($userInfo['merchant_id'], [
             ['uname', 'in', $unameList]
         ]);
-        $merchantsUserList = array_column($merchantsUserList, null, 'uname');
 
+        $merchantsUserList = array_column($merchantsUserList, null, 'uname');
 
         $merchantsUserIds = array_column($merchantsUserList, 'user_id');
         $userBalanceList = CommonMerchantUserAndBalance::getMerchantUserBalance($merchantsUserIds);