Browse Source

add:video页面支持显示评论

tujidelv 3 years ago
parent
commit
19ff704b61

+ 1 - 0
src/main/java/top/lvzhiqiang/entity/VideoInfo.java

@@ -97,4 +97,5 @@ public class VideoInfo implements Serializable {
     private LocalDateTime modifyTime;
 
     private String score;
+    private String comment;
 }

+ 2 - 2
src/main/java/top/lvzhiqiang/mapper/VideoInfoPoolMapper.java

@@ -50,7 +50,7 @@ public interface VideoInfoPoolMapper {
     /**
      * 根据条件查询
      */
-    @Select("select '待审查' name union select '审查已通过' name union select '审查未通过' name")
+    @Select("select '待审查' name union select '审查中' name union select '审查已通过' name union select '审查未通过' name")
     List<VideoGenres> findGenres();
 
     @Select("SELECT M.cast name " +
@@ -62,7 +62,7 @@ public interface VideoInfoPoolMapper {
             "         WHERE genres != ''" +
             "     ) M " +
             "GROUP BY M.cast " +
-            "HAVING COUNT(M.cast) > 3")
+            "ORDER BY COUNT(M.cast) DESC LIMIT 30")
     List<VideoCast> findCast();
 
     List<VideoInfo> getVideoInfoPoolList(Map<String, Object> params);

+ 1 - 1
src/main/resources/mapper/VideoInfoMapper.xml

@@ -6,7 +6,7 @@
 <mapper namespace="top.lvzhiqiang.mapper.VideoInfoMapper">
 
     <select id="getVideoInfoList" resultType="top.lvzhiqiang.entity.VideoInfo">
-        select vi.*, IFNULL(vio.score, 0) AS score
+        select vi.*, IFNULL(vio.score, 0) AS score, IFNULL(vio.comment, '暂无评论') AS comment
         from video_info vi
         left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1
         where vi.delete_flag = 1

+ 7 - 3
src/main/resources/mapper/VideoInfoPoolMapper.xml

@@ -6,8 +6,9 @@
 <mapper namespace="top.lvzhiqiang.mapper.VideoInfoPoolMapper">
 
     <select id="getVideoInfoPoolList" resultType="top.lvzhiqiang.entity.VideoInfo">
-        select vi.id,vi.name,vi.identification_code,vi.issue_date,vi.modify_time,vi.type,vi.img_url,vi.genres AS main_who,vi.cast As score
+        select vi.id,vi.name,vi.identification_code,vi.issue_date,vi.modify_time,vi.type,vi.img_url,vi.cast AS main_who,IFNULL(vio.score, 0) AS score, IFNULL(vio.comment, '暂无评论') AS comment
         from video_info_pool vi
+        left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1
         where vi.delete_flag = 1
         <if test="keyword != null and keyword != ''">
             and (vi.name like #{keyword} or vi.identification_code like #{keyword})
@@ -18,12 +19,15 @@
                 <when test="genres == '待审查'">
                     vi.type = 1
                 </when>
-                <when test="genres == '审查已通过'">
+                <when test="genres == '审查'">
                     vi.type = 2
                 </when>
-                <when test="genres == '审查通过'">
+                <when test="genres == '审查通过'">
                     vi.type = 3
                 </when>
+                <when test="genres == '审查未通过'">
+                    vi.type = 4
+                </when>
                 <otherwise></otherwise>
             </choose>
         </if>

+ 1 - 1
src/main/resources/static/js/my-video.js

@@ -113,7 +113,7 @@ function search(pageNo, startFlag) {
                         "               <span class=\"tag identificationCode\" style=\"background-color: #FB7299;\">" + videoInfo.identificationCode + "</span>" +
                         "               <span class=\"tag\" style=\"background-color: #00C0FF;\">" + date + "</span>" +
                         "           </span>" +
-                        "           <span class=\"pic-text text-right\">" + videoInfo.score + "</span>" +
+                        "           <span class=\"pic-text text-right\" title='" + videoInfo.comment + "'>" + videoInfo.score + "</span>" +
                         "       </a>" +
                         "       <div class=\"myui-vodlist__detail\">" +
                         "           <h4 class=\"bigpreview title text-overflow\" imgUrl='" + videoInfo.imgUrl + "' ><a title=\" " + videoInfo.name + " \">" + videoInfo.name + "</a></h4>" +