Explorar el Código

修改广告优惠券页面展示接口

liu hace 2 años
padre
commit
cdd5f5547b
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      mhotel/src/com/happy/dao/impl/HotelCouponImplDao.java

+ 2 - 2
mhotel/src/com/happy/dao/impl/HotelCouponImplDao.java

@@ -313,7 +313,7 @@ public class HotelCouponImplDao implements HotelCouponDao {
         String sql = "select " +
         String sql = "select " +
                 "id,hotelIds,name,type,rebate_price,deduction_price,max_deduction,grant_number,limit_number,grant_start_date,grant_end_date," +
                 "id,hotelIds,name,type,rebate_price,deduction_price,max_deduction,grant_number,limit_number,grant_start_date,grant_end_date," +
                 "meet_price,effective_start_date,effective_end_date,effective_type,effective_day,effective_lose_day,create_id,create_date,modify_date,status,remainder_number,reversed_number" +
                 "meet_price,effective_start_date,effective_end_date,effective_type,effective_day,effective_lose_day,create_id,create_date,modify_date,status,remainder_number,reversed_number" +
-                " from hotel_coupon where  status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( )" + sqlx + " ORDER BY create_date DESC limit :start , :rows ";
+                " from hotel_coupon where  status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( ) and CURDATE( ) >= DATE_FORMAT( grant_start_date, '%Y-%m-%d' )" + sqlx + " ORDER BY create_date DESC limit :start , :rows ";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("start", start);
         sps.addValue("start", start);
         sps.addValue("rows", rows);
         sps.addValue("rows", rows);
@@ -326,7 +326,7 @@ public class HotelCouponImplDao implements HotelCouponDao {
     @Override
     @Override
     public int advertisingCouponPageTotal(String sqlx) {
     public int advertisingCouponPageTotal(String sqlx) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
-        String sql = "SELECT count(*) FROM `hotel_coupon` where  status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( ) " + sqlx;
+        String sql = "SELECT count(*) FROM `hotel_coupon` where  status = 1 and DATE_FORMAT( grant_end_date, '%Y-%m-%d' ) >= CURDATE( ) and CURDATE( ) >= DATE_FORMAT( grant_start_date, '%Y-%m-%d' ) " + sqlx;
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         return namedParameterJdbcTemplate.queryForInt(sql, sps);
         return namedParameterJdbcTemplate.queryForInt(sql, sps);
     }
     }