|
@@ -252,7 +252,22 @@ namespace GxPress.Repository.Implement
|
|
|
/// <returns></returns>
|
|
|
public async Task<int> GetUserIntoGroupChatUserCountAsync(int userId)
|
|
|
{
|
|
|
- string sql = $"select count(1) from tede_group_chat_user where GroupChatId in(select GroupChatId from tede_group_chat_user where UserId={userId})";
|
|
|
+ string sql = $@"SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ tede_user
|
|
|
+ WHERE
|
|
|
+ Id IN (SELECT
|
|
|
+ UserId
|
|
|
+ FROM
|
|
|
+ tede_group_chat_user
|
|
|
+ WHERE
|
|
|
+ GroupChatId IN (SELECT
|
|
|
+ GroupChatId
|
|
|
+ FROM
|
|
|
+ tede_group_chat_user
|
|
|
+ WHERE
|
|
|
+ UserId ={userId}))";
|
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
|
var database = new Database(databaseType, _connectionString);
|
|
|
var connection = database.GetConnection();
|