liu hace 2 años
padre
commit
5d54bd1d28

+ 2 - 2
mhotel/src/com/happy/action/AppBookingCommentAction.java

@@ -518,7 +518,7 @@ public class AppBookingCommentAction extends ActionSupport implements ServletReq
         }
 
 //        详情
-        CommentDetailsVo commentDetailsVo =bookingCommentService.commentDetails(bookingCommentId);
+        CommentDetailsVo commentDetailsVo =bookingCommentService.commentDetails(bookingCommentId,1);
         if (commentDetailsVo.getCommentTime()!=null) {
             commentDetailsVo.setCommentTime(DateUtil.parseDateToStr((Func.parseDate(commentDetailsVo.getCommentTime())), DateUtil.Time_Formatter_Day));
         }
@@ -587,7 +587,7 @@ public class AppBookingCommentAction extends ActionSupport implements ServletReq
         ArrayList<CommentDetailsVo> commentDetailsVos = new ArrayList<>();
         for (PersonageCommentVo personageCommentVo : pageList) {
             String bookingCommentId1 = personageCommentVo.getBookingCommentId();
-            CommentDetailsVo commentDetailsVo =bookingCommentService.commentDetails(bookingCommentId1);
+            CommentDetailsVo commentDetailsVo =bookingCommentService.commentDetails(bookingCommentId1,status);
             commentDetailsVo.setVo(personageCommentVo);
             commentDetailsVos.add(commentDetailsVo);
         }

+ 1 - 1
mhotel/src/com/happy/dao/BookingCommentDao.java

@@ -41,7 +41,7 @@ public interface BookingCommentDao {
 
     List<CommentVo> commentVoList(String bookingCommentId);
 
-    CommentDetailsVo commentDetails(String bookingCommentId);
+    CommentDetailsVo commentDetails(String bookingCommentId,Integer status);
 
     List<PersonageCommentVo> personageNotCommentPage(String usersId, int page, int rows);
 

+ 4 - 3
mhotel/src/com/happy/dao/impl/BookingCommentImplDao.java

@@ -336,7 +336,7 @@ public class BookingCommentImplDao implements BookingCommentDao {
     }
 
     @Override
-    public CommentDetailsVo commentDetails(String bookingCommentId) {
+    public CommentDetailsVo commentDetails(String bookingCommentId,Integer status) {
         String sql = "SELECT\n" +
                 "\tbc.id AS id,\n" +
                 "\tu.user_name AS userName,\n" +
@@ -361,9 +361,10 @@ public class BookingCommentImplDao implements BookingCommentDao {
                 "\tLEFT JOIN hotel_dict hd ON hd.id = b.hotel_township \n" +
                 "\tAND hd.`status` = 1\n" +
                 "\tLEFT JOIN ( SELECT comment_parent_id, count( 1 ) commentSum FROM booking_comment WHERE comment_parent_id IS NOT NULL  AND `status` = 1 GROUP BY comment_parent_id ) cc ON bc.id = cc.comment_parent_id\n" +
-                "\tWHERE bc.`status`=1 and bc.id= :bookingCommentId";
+                "\tWHERE bc.`status`=:status and bc.id= :bookingCommentId";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("bookingCommentId", bookingCommentId);
+        sps.addValue("status", status);
         List<CommentDetailsVo> list = null;
         try {
             list = namedParameterJdbcTemplate.query(sql, sps,
@@ -591,7 +592,7 @@ public class BookingCommentImplDao implements BookingCommentDao {
                     "\t count(1) \n" +
                     "FROM\n" +
                     "\t`booking` b\n" +
-                    "\tLEFT JOIN booking_comment bc on b.id=bc.booking_id AND bc.comment_parent_id IS NULL  AND bc.`status`=1\n" +
+                    "\tLEFT JOIN booking_comment bc on b.id=bc.booking_id AND bc.comment_parent_id IS NULL  AND bc.`status`!=0\n" +
                     "\t\n" +
                     "\tLEFT JOIN users u on u.id =b.create_userid  LEFT JOIN file_info fi on fi.link_id=b.house_id \n" +
                     "\t\n" +

+ 1 - 1
mhotel/src/com/happy/service/BookingCommentService.java

@@ -58,7 +58,7 @@ public interface BookingCommentService {
 
     int update(BookingComment bookingComment);
 
-    CommentDetailsVo commentDetails(String bookingId);
+    CommentDetailsVo commentDetails(String bookingId,Integer status);
 
     IPage<PersonageCommentVo> personageComment(int status, String usersId, int page, int rows);
 

+ 3 - 3
mhotel/src/com/happy/service/impl/BookingCommentImplService.java

@@ -213,9 +213,9 @@ public class BookingCommentImplService implements BookingCommentService {
     }
 
     @Override
-    public CommentDetailsVo commentDetails(String bookingId) {
-        CommentDetailsVo vo = bookingCommentDao.commentDetails(bookingId);
-        if (vo.getUrl()!=null) {
+    public CommentDetailsVo commentDetails(String bookingId, Integer status) {
+        CommentDetailsVo vo = bookingCommentDao.commentDetails(bookingId, status);
+        if (vo != null && vo.getUrl() != null) {
             List<String> dateTimeList = vo.getUrl();
             String s = dateTimeList.get(0);
             String[] split = s.split(",");