|
@@ -158,18 +158,12 @@ namespace MySystem
|
|
|
bool BackStatus = false;
|
|
|
|
|
|
//拆单算法
|
|
|
- MerchantParamSet splitMerchant = db.MerchantParamSet.FirstOrDefault(m => m.Id == suborder.MerchantId);
|
|
|
- int CheckTime = SplitOrder(suborder.PayMoney,subset.MinPayMoney, splitMerchant.QueryCount);
|
|
|
+ int CheckTime = SplitOrder(suborder.PayMoney,subset.MinPayMoney);
|
|
|
if(CheckTime > 0)
|
|
|
{
|
|
|
GetMoney = GetMoney * CheckTime;
|
|
|
- splitMerchant.QueryCount += 1;
|
|
|
- db.SaveChanges();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- splitMerchant.QueryCount = 0;
|
|
|
db.SaveChanges();
|
|
|
+ CurDiviPersons -= CheckTime - 1;
|
|
|
}
|
|
|
|
|
|
decimal RefundAmount = GetMoney * 100;
|
|
@@ -286,16 +280,11 @@ namespace MySystem
|
|
|
}
|
|
|
|
|
|
//拆单算法
|
|
|
- private int SplitOrder(decimal OrderAmt, decimal MinMoney, int OrderNum)
|
|
|
+ private int SplitOrder(decimal OrderAmt, decimal MinMoney)
|
|
|
{
|
|
|
- int Times = 0;
|
|
|
- OrderNum += 1;
|
|
|
- if(OrderAmt >= MinMoney + 1.01M * MinMoney * (OrderNum - 1))
|
|
|
- {
|
|
|
- decimal percenter = OrderAmt/MinMoney;
|
|
|
- Times = int.Parse(percenter.ToString().Split('.')[0]);
|
|
|
- if(Times < 1) Times = 1;
|
|
|
- }
|
|
|
+ decimal percenter = OrderAmt/MinMoney;
|
|
|
+ int Times = int.Parse(percenter.ToString().Split('.')[0]);
|
|
|
+ if(Times < 1) Times = 1;
|
|
|
return Times;
|
|
|
}
|
|
|
#endregion
|