Commit 8931b245 authored by 黄奎's avatar 黄奎

代码优化

parent fb6a5bb6
......@@ -8,7 +8,7 @@ namespace Mall.CacheManager.AppletWeChat
{
public class OrderPayReidsCache
{
static RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_OrderPayId);
static readonly RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_OrderPayId);
/// <summary>
/// 设置缓存
/// </summary>
......
......@@ -15,7 +15,7 @@ namespace Mall.CacheManager.User
/// </summary>
public class UserReidsCache
{
static RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
static readonly RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
/// <summary>
/// 设置缓存
......@@ -78,7 +78,7 @@ namespace Mall.CacheManager.User
/// <summary>
/// 商户信息仓储层对象
/// </summary>
private static Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
private static readonly Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
/// <summary>
/// 获取用户登录信息
......
......@@ -19,27 +19,27 @@ namespace Mall.Module.User
/// <summary>
/// 专题分类表仓储层对象
/// </summary>
private RB_Topic_TypeRepository topic_TypeRepository = new RB_Topic_TypeRepository();
private readonly RB_Topic_TypeRepository topic_TypeRepository = new RB_Topic_TypeRepository();
/// <summary>
/// 门店表仓储层对象
/// </summary>
private RB_StoresRepository storesRepository = new RB_StoresRepository();
private readonly RB_StoresRepository storesRepository = new RB_StoresRepository();
/// <summary>
/// 视频表仓储层对象
/// </summary>
private RB_VideoRepository videoRepository = new RB_VideoRepository();
private readonly RB_VideoRepository videoRepository = new RB_VideoRepository();
/// <summary>
/// 文章表仓储层对象
/// </summary>
private RB_ArticleRepository articleRepository = new RB_ArticleRepository();
private readonly RB_ArticleRepository articleRepository = new RB_ArticleRepository();
/// <summary>
/// 专题仓储层对象
/// </summary>
private RB_TopicRepository topicRepository = new RB_TopicRepository();
private readonly RB_TopicRepository topicRepository = new RB_TopicRepository();
#region 专题分类
......@@ -73,7 +73,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetTopicTypeModule(RB_Topic_Type_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -110,12 +110,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveTopicTypeModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Topic_Type_Extend.Status),1},
};
flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
bool flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
return flag;
}
......@@ -127,12 +126,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateTopicTypeStatusModule(object Id,int IsDisable)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Topic_Type_Extend.IsDisable),IsDisable},
};
flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
bool flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
return flag;
}
#endregion
......@@ -169,7 +167,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetTopicModule(RB_Topic_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -235,12 +233,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveTopicModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Topic_Extend.Status),1},
};
flag = topicRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Extend.Id), Id));
bool flag = topicRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Extend.Id), Id));
return flag;
}
#endregion
......@@ -277,7 +274,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetStoresModule(RB_Stores_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -322,12 +319,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveStoresModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Stores_Extend.Status),1},
};
flag = storesRepository.Update(fileds, new WhereHelper(nameof(RB_Stores_Extend.Id), Id));
bool flag = storesRepository.Update(fileds, new WhereHelper(nameof(RB_Stores_Extend.Id), Id));
return flag;
}
......@@ -364,7 +360,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetVideoModule(RB_Video_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -404,12 +400,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveVideoModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Video_Extend.Status),1},
};
flag = videoRepository.Update(fileds, new WhereHelper(nameof(RB_Video_Extend.Id), Id));
bool flag = videoRepository.Update(fileds, new WhereHelper(nameof(RB_Video_Extend.Id), Id));
return flag;
}
#endregion
......@@ -446,7 +441,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetArticleModule(RB_Article_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -484,12 +479,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveArticleModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Article_Extend.Status),1},
};
flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
bool flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
return flag;
}
......@@ -501,12 +495,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateArticleIsDisableModule(object Id,int IsDisable)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Article_Extend.IsDisable),IsDisable},
};
flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
bool flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
return flag;
}
#endregion
......
......@@ -98,7 +98,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetRoleModule(RB_Role_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.RoleId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -135,12 +135,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveRoleModule(object RoleId)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Role_Extend.Status),1},
};
flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Role_Extend.RoleId), RoleId));
bool flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Role_Extend.RoleId), RoleId));
return flag;
}
......@@ -178,7 +177,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetEmployeeModule(RB_Employee_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.EmpId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -205,12 +204,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetEmployeePwdModule(RB_Employee_Extend extModel)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Employee_Extend.EmpPwd),extModel.EmpPwd},
};
flag = employeeRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), extModel.EmpId));
bool flag = employeeRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), extModel.EmpId));
return flag;
}
......@@ -231,12 +229,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveEmployeeModule(object EmpId)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Employee_Extend.Status),1},
};
flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId));
bool flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId));
return flag;
}
......@@ -267,12 +264,12 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetEmpConfigModule(RB_Emp_Config_Extend extModel)
{
bool flag = false;
var defaultModel = GetEmpConfigListModule(new RB_Emp_Config_Extend() { MallBaseId = extModel.MallBaseId, TenantId = extModel.TenantId });
if (defaultModel != null && defaultModel.ConfigId>0)
{
extModel.ConfigId = defaultModel.ConfigId;
}
bool flag;
if (extModel.ConfigId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -24,9 +24,9 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetGroupBuyConfigModule(RB_GroupBuyConfig_Extend extModel)
{
bool flag = false;
var oldEntity = GetGroupBuyConfigModule(extModel);
extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0;
bool flag;
if (extModel.GroupByConfigId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -63,9 +63,9 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetGroupBuyConfigMessageModule(RB_GroupBuyConfig_Extend extModel)
{
bool flag = false;
var oldEntity = GetGroupBuyConfigModule(extModel);
extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0;
bool flag;
if (extModel.GroupByConfigId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -48,7 +48,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMenuModule(RB_Menu_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.MenuId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -80,12 +80,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMenuModule(object MenuId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Menu_Extend.Status),Status},
};
flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), MenuId));
bool flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), MenuId));
return flag;
}
......
......@@ -25,17 +25,17 @@ namespace Mall.Module.User
/// <summary>
/// 商户仓储层对象
/// </summary>
private Mall.Repository.User.RB_MiniProgramRepository programRepository = new Repository.User.RB_MiniProgramRepository();
private readonly RB_MiniProgramRepository programRepository = new RB_MiniProgramRepository();
/// <summary>
/// 会员订阅消息仓储层对象
/// </summary>
private Repository.User.RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
private readonly RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
/// <summary>
/// 会员仓储层对象
/// </summary>
private Repository.User.RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
private readonly RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
......
......@@ -15,7 +15,7 @@ namespace Mall.Module.User
/// <summary>
/// 导航图标仓储层对象
/// </summary>
private Mall.Repository.User.RB_MiniProgram_NaviconRepository naviconRepository = new Repository.User.RB_MiniProgram_NaviconRepository();
private readonly Repository.User.RB_MiniProgram_NaviconRepository naviconRepository = new Repository.User.RB_MiniProgram_NaviconRepository();
/// <summary>
/// 根据查询条件获取小程序导航图标列表
......@@ -48,8 +48,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramNaviconModule(RB_MiniProgram_Navicon_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.NavIconId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -78,13 +77,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniProgramNaviconModule(object NavIconId)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Navicon_Extend.NavIconStatus),1},
};
flag = naviconRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Navicon_Extend.NavIconId), NavIconId));
bool flag = naviconRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Navicon_Extend.NavIconId), NavIconId));
return flag;
}
......
......@@ -60,7 +60,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgram_Page_Module(RB_MiniProgram_Page_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -248,12 +248,12 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniprogram_PageManage_Module(RB_Miniprogram_PageManage_Extend extModel)
{
bool flag = false;
if (extModel.IsParameter == 0)
{
extModel.ParameterValue = "";
extModel.TipText = "";
}
bool flag;
if (extModel.PageId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -286,12 +286,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniprogram_PageManage_Module(object PageId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Miniprogram_PageManage_Extend.Status),Status},
};
flag = miniprogram_PageManageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_PageManage_Extend.PageId), PageId));
bool flag = miniprogram_PageManageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_PageManage_Extend.PageId), PageId));
return flag;
}
......
......@@ -16,13 +16,13 @@ namespace Mall.Module.User
/// <summary>
/// 分销海报仓储层对象
/// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
private readonly RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary>
/// 商品分销仓储层对象
/// </summary>
private RB_MiniProgram_GoodPosterRepository goodPosterRepository = new RB_MiniProgram_GoodPosterRepository();
private readonly RB_MiniProgram_GoodPosterRepository goodPosterRepository = new RB_MiniProgram_GoodPosterRepository();
/// <summary>
/// 根据查询条件获取分销海报实体
......@@ -41,7 +41,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetFenXiaoPosterModule(RB_MiniProgram_FenXiaoPoster_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -90,7 +90,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetGoodPosterModule(RB_MiniProgram_GoodPoster_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -90,7 +90,7 @@ namespace Mall.Module.User
/// <summary>
/// 财务单据规则
/// </summary>
private static RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
private static readonly RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
/// <summary>
/// 可简化
......@@ -215,10 +215,9 @@ namespace Mall.Module.User
/// </summary>
/// <param name="smallShopsId"></param>
/// <param name="commission"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <param name="empId"></param>
/// <returns></returns>
public bool SetSmallShopsCommission(int smallShopsId, decimal commission, int tenantId, int mallBaseId, int empId)
public bool SetSmallShopsCommission(int smallShopsId, decimal commission,int empId)
{
var model = smallShops_InfoRepository.GetEntity(smallShopsId);
if (model == null) { return false; }
......
......@@ -16,9 +16,9 @@ namespace Mall.Module.User
{
public class SupplierModule
{
private RB_SupplierRepository supplierRepository = new RB_SupplierRepository();
private RB_SupplierCommissionRepository supplierCommissionRepository = new RB_SupplierCommissionRepository();
private RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository();
private readonly RB_SupplierRepository supplierRepository = new RB_SupplierRepository();
private readonly RB_SupplierCommissionRepository supplierCommissionRepository = new RB_SupplierCommissionRepository();
private readonly RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository();
/// <summary>
/// 分页列表
......@@ -216,7 +216,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveSupplier(int ID, int BankAccountId)
{
bool flag = false;
bool flag;
try
{
IDictionary<string, object> fileds = new Dictionary<string, object>()
......
......@@ -15,7 +15,7 @@ namespace Mall.Module.User
/// <summary>
/// 商户仓储层对象
/// </summary>
private Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
private readonly Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
/// <summary>
......@@ -75,10 +75,9 @@ namespace Mall.Module.User
{
extModel.Account = extModel.Account.Trim();
extModel.Password= Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV);
bool flag = false;
int NewId = tenantRepository.Insert(extModel);
extModel.TenantId = NewId;
flag = NewId > 0;
bool flag = NewId > 0;
return flag;
}
......@@ -129,13 +128,12 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateTenantPwdModule(RB_Tenant_Extend extModel)
{
bool flag = false;
extModel.Password = Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Tenant_Extend.Password),extModel.Password},
};
flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.MobilePhone), extModel.MobilePhone.Trim()));
bool flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.MobilePhone), extModel.MobilePhone.Trim()));
return flag;
}
......@@ -162,12 +160,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetTenantStatusModule(object TenantId, int AccountStatus)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Tenant_Extend.AccountStatus),AccountStatus},
};
flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.TenantId), TenantId));
bool flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.TenantId), TenantId));
return flag;
}
}
......
......@@ -131,40 +131,40 @@ namespace Mall.Module.User
/// <summary>
/// 财务单据规则
/// </summary>
private static RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
private static readonly RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
/// <summary>
/// 用户优惠券
/// </summary>
private RB_Member_CouponRepository memberCouponRepository = new RB_Member_CouponRepository();
private readonly RB_Member_CouponRepository memberCouponRepository = new RB_Member_CouponRepository();
/// <summary>
/// 分销海报仓储层对象
/// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
private readonly RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary>
/// 会员购买仓储层
/// </summary>
private RB_Member_BuyRepository memberBuyRepository = new RB_Member_BuyRepository();
private readonly RB_Member_BuyRepository memberBuyRepository = new RB_Member_BuyRepository();
/// <summary>
/// 粉象返佣等级
/// </summary>
private RB_Distributor_FXGradeRepository distributor_FXGradeRepository = new RB_Distributor_FXGradeRepository();
private readonly RB_Distributor_FXGradeRepository distributor_FXGradeRepository = new RB_Distributor_FXGradeRepository();
/// <summary>
/// vip购买返佣
/// </summary>
private RB_VipBuy_CommissionRepository vipBuy_CommissionRepository = new RB_VipBuy_CommissionRepository();
private readonly RB_VipBuy_CommissionRepository vipBuy_CommissionRepository = new RB_VipBuy_CommissionRepository();
/// <summary>
/// vip购买
/// </summary>
private RB_Vip_BuyRepository vip_BuyRepository = new RB_Vip_BuyRepository();
private readonly RB_Vip_BuyRepository vip_BuyRepository = new RB_Vip_BuyRepository();
/// <summary>
/// 粉象返佣金额
/// </summary>
private RB_Distributor_FXCommissionRepository distributor_FXCommissionRepository = new RB_Distributor_FXCommissionRepository();
private readonly RB_Distributor_FXCommissionRepository distributor_FXCommissionRepository = new RB_Distributor_FXCommissionRepository();
/// <summary>
/// 分销商日志
/// </summary>
private RB_Distributor_LogRepository distributor_LogRepository = new RB_Distributor_LogRepository();
private readonly RB_Distributor_LogRepository distributor_LogRepository = new RB_Distributor_LogRepository();
/// <summary>
/// 推荐供应商返佣账单
/// </summary>
......@@ -262,8 +262,7 @@ namespace Mall.Module.User
/// <returns></returns>
public int AddMemberUserInfo(RB_Member_User_Extend demodel)
{
int result = 0;
result = member_UserRepository.Insert(demodel);
int result = member_UserRepository.Insert(demodel);
//result = member_UserRepository.SetMemberUserRepository(demodel);
return result;
}
......@@ -1585,8 +1584,10 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetDistributorInfoForFX(int FXGradeId, int UserId, int TenantId, int MallBaseId)
{
var demodel = new RB_Distributor_Info_Extend();
demodel.UserId = UserId;
var demodel = new RB_Distributor_Info_Extend
{
UserId = UserId
};
demodel.TotalCommission ??= 0;
demodel.CommissionWithdrawal ??= 0;
demodel.Name ??= "";
......@@ -5332,11 +5333,13 @@ namespace Mall.Module.User
{
return ApiResult.Failed("未查询到普通会员等级");
}
List<string> TitleList = new List<string>();
TitleList.Add("等级名称");
TitleList.Add("级别标准");
TitleList.Add(pModel.GradeName);
TitleList.Add("间接普会");
List<string> TitleList = new List<string>
{
"等级名称",
"级别标准",
pModel.GradeName,
"间接普会"
};
foreach (var item in list)
{
if (item.Id != pModel.Id)
......@@ -5347,9 +5350,11 @@ namespace Mall.Module.User
List<object> ContenList = new List<object>();
foreach (var item in list)
{
List<string> itemList = new List<string>();
itemList.Add(item.GradeName);
itemList.Add((item.CommissionRatio ?? 0).ToString() + "%");
List<string> itemList = new List<string>
{
item.GradeName,
(item.CommissionRatio ?? 0).ToString() + "%"
};
foreach (var qitem in list)
{
if (qitem.Id == pModel.Id)
......@@ -6192,7 +6197,6 @@ namespace Mall.Module.User
/// <returns></returns>
public bool UpdateMemberBuy(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, decimal Money, DateTime Time_End)
{
bool flag = false;
var umodel = member_UserRepository.GetEntity(UserId);
if (umodel == null)
{
......@@ -6214,6 +6218,7 @@ namespace Mall.Module.User
}
var trans = memberBuyRepository.DbTransaction;
bool flag;
try
{
......
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