|
@@ -103,13 +103,17 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
return new AppResultJson() { Status = "-1", Info = "此二维码已被绑定,请勿重复绑定" };
|
|
|
}
|
|
|
}
|
|
|
- query = maindb.MerchantQrCode.Add(new MerchantQrCode()
|
|
|
- {
|
|
|
- CreateDate = DateTime.Now, //绑定时间
|
|
|
- MerchantId = MerchantId, //商户
|
|
|
- SnNo = SnNo,
|
|
|
- }).Entity;
|
|
|
- maindb.SaveChanges();
|
|
|
+ Dictionary<string, object> fields = new Dictionary<string, object>();
|
|
|
+ fields.Add("MerchantId", MerchantId);
|
|
|
+ fields.Add("SnNo", SnNo);
|
|
|
+ new MerchantQrCodeService().Add(fields);
|
|
|
+ // query = maindb.MerchantQrCode.Add(new MerchantQrCode()
|
|
|
+ // {
|
|
|
+ // CreateDate = DateTime.Now, //绑定时间
|
|
|
+ // MerchantId = MerchantId, //商户
|
|
|
+ // SnNo = SnNo,
|
|
|
+ // }).Entity;
|
|
|
+ // maindb.SaveChanges();
|
|
|
string DataId = query.Id + "_0";
|
|
|
MachineForQrCode forQrCode = maindb.MachineForQrCode.FirstOrDefault(m => m.DataId == DataId);
|
|
|
if (forQrCode == null)
|
|
@@ -130,12 +134,19 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
forQrCode.MerchantId = MerchantId;
|
|
|
}
|
|
|
maindb.SaveChanges();
|
|
|
- pos.BuyUserId = merchant.UserId;
|
|
|
- pos.UserId = merchant.UserId;
|
|
|
- pos.BindingTime = DateTime.Now;
|
|
|
- pos.BindingState = 1;
|
|
|
- pos.BindMerchantId = MerchantId;
|
|
|
- maindb.SaveChanges();
|
|
|
+ fields = new Dictionary<string, object>();
|
|
|
+ fields.Add("BuyUserId", merchant.UserId);
|
|
|
+ fields.Add("UserId", merchant.UserId);
|
|
|
+ fields.Add("BindingTime", DateTime.Now);
|
|
|
+ fields.Add("BindingState", 1);
|
|
|
+ fields.Add("BindMerchantId", MerchantId);
|
|
|
+ new PosMachinesTwoService().Edit(fields, pos.Id);
|
|
|
+ // pos.BuyUserId = merchant.UserId;
|
|
|
+ // pos.UserId = merchant.UserId;
|
|
|
+ // pos.BindingTime = DateTime.Now;
|
|
|
+ // pos.BindingState = 1;
|
|
|
+ // pos.BindMerchantId = MerchantId;
|
|
|
+ // maindb.SaveChanges();
|
|
|
|
|
|
PublicFunction.BindUserMachineData(maindb, merchant.UserId, 0, 1, SnNo);
|
|
|
|