Commit 8f5f353a authored by Jack'lul's avatar Jack'lul

Fix username grabbing for groups

parent 202d3946
......@@ -90,10 +90,10 @@ class WhoisCommand extends AdminCommand
if (is_numeric($text)) {
$results = DB::selectChats(
true, //Select groups (group chat)
true, //Select supergroups (super group chat)
true, //Select groups
true, //Select super groups
true, //Select channels
true, //Select users (single chat)
true, //Select users
null, //'yyyy-mm-dd hh:mm:ss' date range from
null, //'yyyy-mm-dd hh:mm:ss' date range to
$user_id //Specific chat_id to select
......@@ -104,10 +104,10 @@ class WhoisCommand extends AdminCommand
}
} else {
$results = DB::selectChats(
true, //Select groups (group chat)
true, //Select supergroups (super group chat)
true, //Select groups
true, //Select super groups
true, //Select channels
true, //Select users (single chat)
true, //Select users
null, //'yyyy-mm-dd hh:mm:ss' date range from
null, //'yyyy-mm-dd hh:mm:ss' date range to
null, //Specific chat_id to select
......@@ -120,8 +120,9 @@ class WhoisCommand extends AdminCommand
}
if (is_array($result)) {
$result['id'] = $result['chat_id'];
$chat = new Chat($result);
$result['id'] = $result['chat_id'];
$result['username'] = $result['chat_username'];
$chat = new Chat($result);
$user_id = $result['id'];
$created_at = $result['chat_created_at'];
......
......@@ -1015,6 +1015,7 @@ class DB
$query = '
SELECT * ,
' . TB_CHAT . '.`id` AS `chat_id`,
' . TB_CHAT . '.`username` AS `chat_username`,
' . TB_CHAT . '.`created_at` AS `chat_created_at`,
' . TB_CHAT . '.`updated_at` AS `chat_updated_at`
';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment