QiFeng.ZWY.Bll/BllExt/WechatUserExtBll.cs
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Globalization;
using System.Text;
using QiFeng.LMSD.Bll.WxInterfaceFunc;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.WeChatInter;
using QiFeng.LMSD.Utility;
namespace QiFeng.LMSD.Bll.BllExt
{
public class WechatUserExtBll : BaseBll<WechatUserExtBll>
{
private readonly WxInterUserFunc _wxInterUserFuncObj = new WxInterUserFunc();
/// <summary>
/// 更新微信用户信息以及微信用户与公众号关联信息
/// </summary>
/// <param name="wechatUserExtInfo"></param>
/// <param name="wechatInfoId"></param>
/// <returns></returns>
public Result<int> UpdateWechatUserExtInfo(WechatUserExt wechatUserExtInfo, int wechatInfoId)
{
var originalWechatUserInfo = WechatUserBll.Instance.GetModel(wechatUserExtInfo.Id);
if (originalWechatUserInfo == null || originalWechatUserInfo.Id <= 0 ||
string.IsNullOrWhiteSpace(originalWechatUserInfo.Unionid))
{
return new Result<int>
{
Data = 0,
Message = "数据库不存在即将更新的用户数据",
Status = false
};
}
var resultUpdateWechatUser = WechatUserBll.Instance.UpdateWechatUser((WechatUser) wechatUserExtInfo);
if (!string.IsNullOrWhiteSpace(wechatUserExtInfo.OpenId))
{
var nRet = 0;
var wechatInfoUser = WechatInfoUserBll.Instance.GetModelByOpenId(wechatUserExtInfo.OpenId, wechatInfoId);
if (wechatInfoUser == null || wechatInfoUser.Id == 0)
{
var newWechatInfoUser = new WechatInfoUser
{
WechatInfoId = wechatUserExtInfo.WechatInfoId,
WechatUserId = wechatUserExtInfo.Id,
OpenId = wechatUserExtInfo.OpenId,
Subscribe = wechatUserExtInfo.Subscribe,
SubscribeTime = wechatUserExtInfo.SubscribeTime,
UnSubscribeTime = wechatUserExtInfo.UnSubscribeTime,
Remark = wechatUserExtInfo.Remark,
IsDelete = false
};
var nRetWechatInfoUser = WechatInfoUserBll.Instance.Add(newWechatInfoUser);
return new Result<int>
{
Data = nRetWechatInfoUser,
Message = nRetWechatInfoUser > 0 ? "保存成功" : "保存失败",
Status = nRetWechatInfoUser > 0
};
后面还有 238 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。