소스 검색

最新后台代码

5 년 전
부모
커밋
ed254ec0e6

+ 3 - 3
minigame/src/com/hssx/controller/PrizeController.java

@@ -64,7 +64,7 @@ public class PrizeController {
 		prizeRecord.setVoucherId(user.getVoucherId());
 		prizeRecord.setNickName(user.getNickName());
 		UserPrizeCountExample uExp = new UserPrizeCountExample();
-		Integer luckDrawCount = UserPrizeCountMapper.selectCountByToday();
+		Integer luckDrawCount = UserPrizeCountMapper.selectCountByTodayByUid(userId);
 		HashMap<String, Object> map = new HashMap<String, Object>();
 		if (luckDrawCount == 0) {
 			// 直接抽奖
@@ -77,7 +77,7 @@ public class PrizeController {
 			map.put("prizeRecord", prizeRecord);
 			msg.data = map;
 		} else if (luckDrawCount == 1) {
-			int opportunityCount = prizeOpportunityMapper.selectCountByToday();
+			int opportunityCount = prizeOpportunityMapper.selectCountByToday(userId);
 			if (opportunityCount > 0) {
 				// 直接抽奖
 				count = getLuckDraw(prizeRecord, count);
@@ -209,7 +209,7 @@ public class PrizeController {
 	public void luckDrawAddCount(PrizeRecord prizeRecord, HttpServletResponse response)
 			throws Exception, KeyManagementException, NoSuchAlgorithmException, NoSuchProviderException, IOException {
 		HttpRespMsg msg = new HttpRespMsg();
-		int count = prizeOpportunityMapper.selectCountByToday();
+		int count = prizeOpportunityMapper.selectCountByToday(prizeRecord.getUid());
 		if (count == 0) {
 			PrizeOpportunity prizeOpportunity = new PrizeOpportunity();
 			prizeOpportunity.setIsShare(1);

+ 1 - 1
minigame/src/com/hssx/mapper/PrizeOpportunityMapper.java

@@ -74,5 +74,5 @@ public interface PrizeOpportunityMapper {
 	 */
 	int updateByPrimaryKey(PrizeOpportunity record);
 
-	int selectCountByToday();
+	int selectCountByToday(@Param("uid")Integer uid);
 }

+ 1 - 1
minigame/src/com/hssx/mapper/PrizeOpportunityMapper.xml

@@ -286,7 +286,7 @@
   
    <select id="selectCountByToday" resultType="java.lang.Integer">
   select count(id) from mini_prize_opportunity
-  WHERE TO_DAYS(indate) = TO_DAYS(NOW())
+  WHERE TO_DAYS(indate) = TO_DAYS(NOW()) and uid = #{uid}
   </select>
   
 </mapper>

+ 1 - 1
minigame/src/com/hssx/mapper/UserPrizeCountMapper.java

@@ -96,5 +96,5 @@ public interface UserPrizeCountMapper {
      */
     int updateByPrimaryKey(UserPrizeCount record);
     
-    int selectCountByToday();
+    int selectCountByTodayByUid(@Param("userId")Integer userId);
 }

+ 2 - 2
minigame/src/com/hssx/mapper/UserPrizeCountMapper.xml

@@ -252,8 +252,8 @@
     where id = #{id,jdbcType=INTEGER}
   </update>
   
-  <select id="selectCountByToday" resultType="java.lang.Integer">
+  <select id="selectCountByTodayByUid" resultType="java.lang.Integer">
   select count(id) from mini_user_prize_count
-  WHERE TO_DAYS(indate) = TO_DAYS(NOW())
+  WHERE user_id = #{userId} AND TO_DAYS(indate) = TO_DAYS(NOW()) 
   </select>
 </mapper>