kk пре 2 месеци
родитељ
комит
1f975c27ee

+ 6 - 2
game-business/src/main/java/com/game/business/controller/AppGameBettingController.java

@@ -239,8 +239,12 @@ public class AppGameBettingController extends BaseController{
     @Anonymous
     @PostMapping(value = "/count")
     @ApiOperation(value = "游戏输赢统计(首页)", notes = "游戏输赢统计(首页)")
-    public HttpRet<AppGameBettingCountVO> getCount(@RequestParam(name = "strDate") String strDate, @RequestParam(name = "userId") Long userId)
+    public HttpRet<AppGameBettingCountVO> getCount(@RequestParam(name = "strDate") String strDate, @RequestParam(name = "userId") Long userId, @RequestParam(name = "bettingType") Integer bettingType)
     {
+
+        if(bettingType == null){
+            bettingType = 0;
+        }
         AppGameBettingCountVO appGameBettingCountDTO = new AppGameBettingCountVO();
         List<AppGame> gameList = appGameService.selectAppGameList(new AppGame());
 
@@ -248,7 +252,7 @@ public class AppGameBettingController extends BaseController{
             return HttpRet.success("查询成功",appGameBettingCountDTO);
         }
 
-        List<AppGameBettingDetailsCountVO> countList = appGameBettingService.getCount(strDate, userId);
+        List<AppGameBettingDetailsCountVO> countList = appGameBettingService.getCount(strDate, userId, bettingType);
         if(countList == null){
             countList = new ArrayList<>();
         }

+ 1 - 1
game-business/src/main/java/com/game/business/mapper/AppGameBettingMapper.java

@@ -10,5 +10,5 @@ import java.util.List;
 
 public interface AppGameBettingMapper extends BaseMapper<AppGameBetting> {
 
-    List<AppGameBettingDetailsCountVO> getCount(@Param(value = "strDate") String strDate, @Param(value = "userId") Long userId);
+    List<AppGameBettingDetailsCountVO> getCount(@Param(value = "strDate") String strDate, @Param(value = "userId") Long userId,  @Param(value = "bettingType") Integer bettingType);
 }

+ 1 - 1
game-business/src/main/java/com/game/business/service/IAppGameBettingService.java

@@ -14,7 +14,7 @@ public interface IAppGameBettingService extends IService<AppGameBetting> {
 
     boolean save(AppGameBetting appGameBetting);
 
-    List<AppGameBettingDetailsCountVO> getCount(String strDate, Long userId);
+    List<AppGameBettingDetailsCountVO> getCount(String strDate, Long userId, Integer bettingType);
 
     List<AppGameBetting> selectListByGameId(Long gameId, Long userId, Integer isWinning, String strDate);
 

+ 2 - 2
game-business/src/main/java/com/game/business/service/impl/AppGameBettingServiceImpl.java

@@ -43,8 +43,8 @@ public class AppGameBettingServiceImpl extends ServiceImpl<AppGameBettingMapper,
     }
 
     @Override
-    public List<AppGameBettingDetailsCountVO> getCount(String strDate, Long userId) {
-        return appGameBettingMapper.getCount(strDate, userId);
+    public List<AppGameBettingDetailsCountVO> getCount(String strDate, Long userId, Integer bettingType) {
+        return appGameBettingMapper.getCount(strDate, userId, bettingType);
     }
 
     @Override

+ 1 - 0
game-business/src/main/resources/mapper/business/AppGameBettingMapper.xml

@@ -12,6 +12,7 @@
         sum(case when is_winning = 1 then (betting_amount * betting_multiple) else 0.00 end) as winAmount,
         sum(case when is_winning = 2 then (betting_amount) else 0.00 end) as loseAmount
         from app_game_betting  where date_format(create_time, '%Y-%m-%d') = #{strDate} and user_id = #{userId}
+        and betting_type = #{bettingType}
         group by game_id
     </select>
 </mapper>