zoujiajian 3 jaren geleden
bovenliggende
commit
07abd231ad

+ 4 - 4
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -239,7 +239,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			if (user == null) throw BusinessRuntimeException.getGatewayApiCode(GatewayApiCode.CMS_TOKEN_VALID);
 			if (user.getIsBlack()) throw BusinessRuntimeException.getInstance("系统检测操作异常,请稍后再试");
 			//ChatGPT Plus账号限购校验
-			checkChatGPTPlusPurchaseLimit(user.getId(), goodsDon.getId(), sku.getId(), sku.getSpecVal());
+			checkChatGPTPlusPurchaseLimit(user.getId(), goodsDon.getId(), goodsDon.getTitle(), sku.getId(), sku.getSpecVal());
 			payOpenId = user.getOpenId();
 			if (goodsDon.getType() == 1) {
 				GroupsRelation relation = null;
@@ -2190,8 +2190,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 	/**
 	 * chatGPT Plus账号购买限购校验
 	 */
-	public void checkChatGPTPlusPurchaseLimit(Long userId, Long goodsId, Long skuId, String specVal) {
-		if (goodsId == 18) {
+	public void checkChatGPTPlusPurchaseLimit(Long userId, Long goodsId, String title, Long skuId, String specVal) {
+		if (goodsId == 18 || goodsId == 26) {
 			SysConfig sysConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
 					.eq(SysConfig::getSysKey, Constant.CHAT_GPT_PLUS_SKU_PURCHASE_LIMIT).last("limit 1"));
 			if (sysConfig != null) {
@@ -2217,7 +2217,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 										.gt(OrderDon::getCreatedTime, DateUtil.offsetDay(DateTime.now(), -days))
 										.notIn(OrderDon::getStatus, Constant.noOrderAllStatus));
 								if (count > time - 1)
-									throw BusinessRuntimeException.getInstance(String.format("%s天内只能购买%s %s规格账号", days, time, specVal.replaceAll(";", "")));
+									throw BusinessRuntimeException.getInstance(String.format("%s天内只能购买%s次%s %s规格账号", days, time, title, specVal.replaceAll(";", "")));
 								break;
 							}
 						}