1111
This commit is contained in:
@@ -68,5 +68,29 @@ public class GameBus
|
||||
return isok;
|
||||
}
|
||||
|
||||
public static async Task<bool> UpdateBag(string userId, int operate, dynamic Reward, string remark = "",
|
||||
long count = 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var item in Reward)
|
||||
{
|
||||
long num = Convert.ToInt64(item.count) * count;
|
||||
if (num <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
await UpdateBag(userId, operate, item.code, item.parameter, num, remark);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
9
Service/Application.Domain/Tool/Base/UbbTool.cs
Normal file
9
Service/Application.Domain/Tool/Base/UbbTool.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Application.Domain;
|
||||
|
||||
public class UbbTool
|
||||
{
|
||||
public static string HomeUbb(string no, string name)
|
||||
{
|
||||
return $"<a data-type='go' data-parms='/user/user?no={no}' href='javascript:void'>{name}</a>";
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ public class UserModelTool
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="addIcon"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<UserModel> GetUserView(string userId,bool addIcon=false)
|
||||
public static async Task<UserModel> GetUserView(string userId, bool addIcon = false)
|
||||
{
|
||||
UserModel result = new UserModel();
|
||||
if (userId == "0")
|
||||
@@ -19,10 +19,12 @@ public class UserModelTool
|
||||
result.headImg = "";
|
||||
result.area = 0;
|
||||
result.icon = "";
|
||||
result.lev = 999;
|
||||
}
|
||||
else
|
||||
{
|
||||
var userService = App.GetService<IUnitUserService>();
|
||||
var attrService = App.GetRequiredService<IUnitUserAttrService>();
|
||||
var userInfo = await userService.GetUserInfoByUserId(userId);
|
||||
if (userInfo != null)
|
||||
{
|
||||
@@ -32,12 +34,14 @@ public class UserModelTool
|
||||
result.headImg = userInfo.headImg;
|
||||
result.area = (int)userInfo.areaId;
|
||||
result.icon = "";
|
||||
if (addIcon)//获取图标信息
|
||||
if (addIcon) //获取图标信息
|
||||
{
|
||||
result.icon = "";
|
||||
}
|
||||
result.lev = await attrService.GetUserLev(userId);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user