Browse Source

getDynamicsDetail接口新增dynamicsType

zc 2 months ago
parent
commit
6b7a0a9fef
1 changed files with 6 additions and 1 deletions
  1. 6 1
      alien-entity/src/main/resources/mapper/LifeUserDynamicsMapper.xml

+ 6 - 1
alien-entity/src/main/resources/mapper/LifeUserDynamicsMapper.xml

@@ -58,7 +58,12 @@
         select dyna1.*, COUNT(dyna1.id) AS fansCount from (
         select dyna.*,COUNT(lc.id) AS commentCount,  COUNT(lm.id) AS transferNum from (
         with dynamice as(
-        select id, title, phone_id phoneId, context, image_path, address,address_name,address_context, liulan_count, dianzan_count, type, created_time, substring_index(phone_id, '_', 1) userType, substring_index(phone_id, '_', -1) phone, draft , address_province, top_status, top_time, enable_status
+        select
+        CASE
+        WHEN image_path REGEXP '.mp4|.avi|.flv|.mkv|.rmvb|.wmv|.3gp|.mov' THEN 2
+        WHEN image_path REGEXP '.jpg|.jpeg|.png|.bmp|.webp|.gif|.svg' THEN 1
+        ELSE 0
+        END AS dynamicsType, id, title, phone_id phoneId, context, image_path, address,address_name,address_context, liulan_count, dianzan_count, type, created_time, substring_index(phone_id, '_', 1) userType, substring_index(phone_id, '_', -1) phone, draft , address_province, top_status, top_time, enable_status
         from life_user_dynamics
         where id = #{id} and delete_flag = 0 and draft = 0 order by created_time desc
         )