904118851 8 mesi fa
parent
commit
a47a178cae
2 ha cambiato i file con 14 aggiunte e 4 eliminazioni
  1. 7 2
      service/backmgr/no_filter_origin.lua
  2. 7 2
      service/backmgr/origin_data.lua

+ 7 - 2
service/backmgr/no_filter_origin.lua

@@ -12,7 +12,7 @@ function check_table_exists(table_name)
 end
 
 function M.search_no_filter_origin_data(msg_body)
-    local isok ,key =  tools.checkData({"video_id","date","page_size","page_number"},msg_body)
+    local isok ,key =  tools.checkData({"video_id","date","page_size","page_number","materialId"},msg_body)
     if not isok then
         return false,string.format("缺少字段: %s.", key)
     end
@@ -31,7 +31,12 @@ function M.search_no_filter_origin_data(msg_body)
         video_id_param =  " AND awemeId = "..msg_body.video_id
     end
 
-    local param = video_id_param
+    local materialId_param = ""
+    if msg_body.materialId~="" then
+        materialId_param =  string.format(" AND materialId = '%s' ",msg_body.materialId)
+    end
+
+    local param = video_id_param..materialId_param
     local up_down_param = " ORDER BY " .." likeCount DESC "
 
     local sql = "SELECT * FROM "..table_name.." WHERE 1=1 "..param..up_down_param..string.format(" LIMIT %d OFFSET %d ",page_size, offset)

+ 7 - 2
service/backmgr/origin_data.lua

@@ -15,7 +15,7 @@ end
 
 
 function M.search_origin_data(msg_body)
-    local isok ,key =  tools.checkData({"page_size","page_number","start_create_time","end_create_time","guajian_info","start_publish_time","end_publish_time"},msg_body)
+    local isok ,key =  tools.checkData({"page_size","page_number","start_create_time","end_create_time","guajian_info","start_publish_time","end_publish_time","materialId"},msg_body)
     if not isok then
         return false,string.format("缺少字段: %s.", key)
     end
@@ -39,7 +39,12 @@ function M.search_origin_data(msg_body)
         guajian_info_param =  string.format(" AND  ( guajian_link LIKE CONCAT( '%%%s%%')) ",msg_body.guajian_info)
     end
 
-    local param = date_param..create_date_param..guajian_info_param
+    local materialId_param = ""
+    if msg_body.materialId~="" then
+        materialId_param =  string.format(" AND materialId = '%s' ",msg_body.materialId)
+    end
+
+    local param = date_param..create_date_param..guajian_info_param..materialId_param
 
 
     local sql = "SELECT * FROM origin_data WHERE 1=1 "..param.."ORDER BY id DESC"..string.format(" LIMIT %d OFFSET %d ",page_size, offset)