|
@@ -96,6 +96,7 @@ public class VirtualApplyHelper
|
|
|
int SnIdNum = pos.Id;
|
|
|
DateTime RecycEndDate = DateTime.Now.AddDays(360);
|
|
|
int LeaderUserId = 0;
|
|
|
+ int BigPosCouponKind = 0;
|
|
|
if (SourceSnNos.Count > SnIndex)
|
|
|
{
|
|
|
string SourceSnNo = SourceSnNos[SnIndex];
|
|
@@ -105,11 +106,18 @@ public class VirtualApplyHelper
|
|
|
PosMachinesTwo spos = maindb.PosMachinesTwo.FirstOrDefault(m => m.Id == forSnNo.SnId) ?? new PosMachinesTwo();
|
|
|
RecycEndDate = spos.RecycEndDate == null ? RecycEndDate = DateTime.Now.AddDays(360) : spos.RecycEndDate.Value;
|
|
|
LeaderUserId = spos.LeaderUserId;
|
|
|
+ BigPosCouponKind = spos.OpId;
|
|
|
+ if(BigPosCouponKind == 0)
|
|
|
+ {
|
|
|
+ KqProducts brand = maindb.KqProducts.FirstOrDefault(m => m.Id == spos.BrandId) ?? new KqProducts();
|
|
|
+ BigPosCouponKind = brand.Kind;
|
|
|
+ }
|
|
|
}
|
|
|
else if (ApplyType > 1)
|
|
|
{
|
|
|
PosCoupons coupon = maindb.PosCoupons.FirstOrDefault(m => m.ExchangeCode == SourceSnNo) ?? new PosCoupons();
|
|
|
LeaderUserId = coupon.LeaderUserId;
|
|
|
+ BigPosCouponKind = coupon.QueryCount;
|
|
|
if (coupon.OpId > 0)
|
|
|
{
|
|
|
if (couponIds.ContainsKey(coupon.OpId))
|
|
@@ -205,6 +213,7 @@ public class VirtualApplyHelper
|
|
|
pos.RecycEndDate = RecycEndDate; // 循环结束时间
|
|
|
pos.PosSnType = order.QueryCount;
|
|
|
pos.LeaderUserId = LeaderUserId;
|
|
|
+ pos.OpId = BigPosCouponKind;
|
|
|
|
|
|
maindb.SaveChanges();
|
|
|
SnIndex += 1;
|