提交 bb9dd46e authored 作者: wudepeng's avatar wudepeng

full activity

上级 c06b69ae
...@@ -333,9 +333,9 @@ public class TbCfOrder { ...@@ -333,9 +333,9 @@ public class TbCfOrder {
* 活动模块:活动类型 1:满减 2:满折 3:满件打折(type) * 活动模块:活动类型 1:满减 2:满折 3:满件打折(type)
* 使用类型 1:全场 2:分类商品 3:特定商品(use_type) * 使用类型 1:全场 2:分类商品 3:特定商品(use_type)
*/ */
boolean act1 = activityRepository.existsByUseType(1); boolean fullAct = activityRepository.existsByUseType(1);
if (act1) { if (fullAct) {
Optional<Activity> allAct = activityRepository.findFirstByUseType(1); Optional<Activity> allAct = activityRepository.findFirstByUseTypeOrderByCreateTimeDesc(1);
if (allAct.isPresent()) { if (allAct.isPresent()) {
Activity activity = allAct.get(); Activity activity = allAct.get();
String type = String.valueOf(activity.getType()); String type = String.valueOf(activity.getType());
......
...@@ -22,5 +22,5 @@ public interface ActivityRepository extends JpaRepository<Activity,String> { ...@@ -22,5 +22,5 @@ public interface ActivityRepository extends JpaRepository<Activity,String> {
boolean existsByUseType(Integer useType); boolean existsByUseType(Integer useType);
Optional<Activity> findFirstByUseType(Integer useType); Optional<Activity> findFirstByUseTypeOrderByCreateTimeDesc(Integer useType);
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论