PhoneNum ?: ''; $query = DB::table(TableName::QPTreasureDB() . 'GamePhoneVerityCode') ->where('PhoneNum', '1'.$PhoneNum) ->select('PhoneNum', 'Code') ->first(); $BindDate = DB::table(TableName::QPAccountsDB() . 'AccountPhone') ->where('PhoneNum', $PhoneNum) ->value('BindDate'); return view('admin.code.query', compact('query', 'PhoneNum', 'BindDate')); } // 绑定手机号 -- 手动 public function bind_phone(Request $request, $UserID) { if ($request->isMethod('post')) { $post = $request->post(); $Channel = DB::connection('write')->table(TableName::QPAccountsDB() . 'AccountsInfo') ->where('UserID', $UserID)->select('Channel')->first()->Channel; $IsUserBindPhone = DB::table(TableName::QPAccountsDB() . 'AccountPhone') ->where('UserID', $UserID) ->first(); if ($IsUserBindPhone) { return apiReturnFail('用户已绑定'); } DB::table(TableName::QPAccountsDB() . 'AccountPhone') ->insert([ 'PhoneNum' => env('COUNTRY_CODE','1').$post['PhoneNum'], 'BindDate' => now(), 'LogonPass' => $post['LogonPass'], 'UserID' => $UserID, 'Channel' => $Channel, ]); GlobalUserInfo::where('UserID', $UserID)->update([ 'Phone' => env('COUNTRY_CODE','1').$post['PhoneNum'], 'RegisterLocation' => env('COUNTRY_CODE','1')]); return apiReturnSuc(); } else { return view('admin.code.bind_phone', compact('UserID')); } } }