From 3575c016271e455cfaab964b98e3d4ef84ef75cb Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期三, 13 五月 2026 20:06:12 +0800
Subject: [PATCH] 597 时装特卖
---
Main/System/Store/StoreModel.cs | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/Main/System/Store/StoreModel.cs b/Main/System/Store/StoreModel.cs
index 32856e4..5d167b4 100644
--- a/Main/System/Store/StoreModel.cs
+++ b/Main/System/Store/StoreModel.cs
@@ -181,7 +181,36 @@
return datas;
}
+ /// <summary>
+ /// 鑾峰彇鍦ㄤ笂涓嬫灦鏃堕棿鑼冨洿鍐呯殑鍟嗗搧鍒楄〃
+ /// </summary>
+ public List<StoreData> GetTimeValidStoreDatas(StoreFunc type)
+ {
+ List<StoreData> allDatas = TryGetStoreDatas(type);
+ if (allDatas == null)
+ return null;
+ int curOpenDay = TimeUtility.OpenDay + 1;
+ List<StoreData> validDatas = new List<StoreData>();
+ for (int i = 0; i < allDatas.Count; i++)
+ {
+ StoreConfig cfg = allDatas[i].storeConfig;
+ // <=0 鎴� StartTime >= EndTime 瑙嗕负鏃犻檺鍒�
+ if (cfg.StartTime <= 0 || cfg.EndTime <= 0 || cfg.StartTime >= cfg.EndTime)
+ {
+ validDatas.Add(allDatas[i]);
+ continue;
+ }
+ // 鏈埌涓婃灦鏃堕棿
+ if (curOpenDay < cfg.StartTime)
+ continue;
+ // 宸茶繃涓嬫灦鏃堕棿
+ if (curOpenDay >= cfg.EndTime)
+ continue;
+ validDatas.Add(allDatas[i]);
+ }
+ return validDatas;
+ }
public StoreData GetStoreData(int shopId)
--
Gitblit v1.8.0