From 59e5195763ed490b491ad5fb9a2e39cfde7d5f1f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 26 十一月 2024 11:00:06 +0800
Subject: [PATCH] 10317 【英文】【越南】【BT】【砍树】仙盟传功支持离线
---
Tool/WebCenter/CouponCode/webapp.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/Tool/WebCenter/CouponCode/webapp.py b/Tool/WebCenter/CouponCode/webapp.py
index ae9894f..c827426 100644
--- a/Tool/WebCenter/CouponCode/webapp.py
+++ b/Tool/WebCenter/CouponCode/webapp.py
@@ -314,17 +314,22 @@
mylog.debug("time pass")
return SendGm(ErrCode_Invalid, gmresult, pushurl)[1]
+ maxUseCount = 0 # -1-鏃犻檺锛�0鎴�1-榛樿1娆★紱 >1-闄愬埗娆℃暟锛� 娌℃湁閰嶇疆鐨勯粯璁�0鍗抽粯璁�1娆�
prefix = "" # 鍥哄畾鍓嶇紑
MailJson = GetMailJson(agentName)
if couponType in MailJson:
mailInfo = MailJson[couponType]
prefix = mailInfo.get("Prefix", "")
+ maxUseCount = CommFunc.ToIntDef(mailInfo.get("MaxUseCount", 0))
elif ConfigIO.HasSection(couponType):
if ConfigIO.HasOption(couponType, "Prefix"):
prefix = ConfigIO.GetValue(couponType, "Prefix")
+ maxUseCount = ConfigIO.GetInt(couponType, "MaxUseCount")
# h 寮�澶寸殑鍗$被鍨嬪彲閲嶅浣跨敤
- if not codeStr.startswith(prefix + 'h'):
+ #if not codeStr.startswith(prefix + 'h'):
+ #淇敼涓烘寜閰嶇疆鏈�澶ф鏁板垽鏂嵆鍙�
+ if maxUseCount in [0, 1]:
#鍐嶆煡涓�娆℃槸鍚︾敤杩囨鎵规鐨勫叾浠栧崱,
result, data3 = dbController.find_one(CouponDB.CouponCodeColName + "_" + agentName, \
{"coupontype":data["coupontype"], "accid":accid})
@@ -334,6 +339,13 @@
gmresult['code'] = codeStr
mylog.debug("use again")
return SendGm(ErrCode_TypeUsed, gmresult, pushurl)[1]
+ elif maxUseCount > 1:
+ result, resultList = dbController.find(CouponDB.CouponCodeColName + "_" + agentName, {"coupontype":data["coupontype"], "accid":accid}, {"code":1})
+ if not result or len(resultList) >= maxUseCount:
+ gmresult['coupontype'] = data["coupontype"]
+ gmresult['code'] = codeStr
+ mylog.debug("use maxUseCount limit. %s" % maxUseCount)
+ return SendGm(ErrCode_TypeUsed, gmresult, pushurl)[1]
data['status'] = 1
data['accid'] = accid
--
Gitblit v1.8.0