|
|
@@ -3703,8 +3703,21 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
if (posInfo.BindingState == 0)
|
|
|
{
|
|
|
- posInfo.BuyUserId = tUserId.Id;
|
|
|
- posInfo.UserId = tUserId.Id;
|
|
|
+ if (posInfo.UserId == 0 || posInfo.BuyUserId == posInfo.UserId)
|
|
|
+ {
|
|
|
+ posInfo.BuyUserId = tUserId.Id;
|
|
|
+ posInfo.UserId = tUserId.Id;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ posInfo.BuyUserId = tUserId.Id;
|
|
|
+ }
|
|
|
+ var fUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == fUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
|
|
|
+ var tUserPos = db.UserMachineData.FirstOrDefault(m => m.IdBrand == tUserId.Id + "_" + posInfo.BrandId) ?? new UserMachineData();
|
|
|
+ fUserPos.TotalMachineCount -= 1;
|
|
|
+ fUserPos.UnBindCount -= 1;
|
|
|
+ tUserPos.TotalMachineCount += 1;
|
|
|
+ tUserPos.UnBindCount += 1;
|
|
|
db.SaveChanges();
|
|
|
function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "划拨创客机具");
|
|
|
}
|