904118851 3 月之前
父節點
當前提交
336f0792e7
共有 1 個文件被更改,包括 35 次插入9 次删除
  1. 35 9
      service/backmgr/video_material.lua

+ 35 - 9
service/backmgr/video_material.lua

@@ -35,14 +35,15 @@ function M.set_artificial_status(msg_body)
         return false,string.format("缺少字段: %s.", key)
     end
 
+
     local idString = table.concat(msg_body.id_list, ",")
     local sql = string.format("SELECT * FROM video_material WHERE id IN (%s)",idString)
     local isok,res;
     res = mysqldbx.query(sql)
-
+    local current_time = os.date("%Y-%m-%d %H:%M:%S")
     for i = 1, #res, 1 do
         local id =   res[i].id
-        sql = string.format("UPDATE  video_material SET artificial_status = %d , exe_review_person_id = %d WHERE id =%d ",msg_body.artificial_status,msg_body.user_id,id)
+        sql = string.format("UPDATE  video_material SET opt_time = '%s' ,artificial_status = %d , exe_review_person_id = %d WHERE id =%d ",current_time,msg_body.artificial_status,msg_body.user_id,id)
         mysqldbx.query(sql)
     end
     
@@ -55,7 +56,16 @@ end
 --product_id 书id
 --sync_status 状态
 function M.search(msg_body)
-    local isok ,key =  tools.checkData({"publish_time","min_book_word","max_book_word","genre","end_time_date",
+    local isok ,key =  tools.checkData({
+    "start_opt_time",
+    "end_opt_time",
+    "start_yun_fabu_time",
+    "end_yun_fabu_time",
+    "exe_review_person_id",
+    "start_publish_time",
+    "end_publish_time",
+    "min_book_word","max_book_word","genre",
+    "end_time_date",
     "start_time_date",
     "sync_status",
     "product_id",
@@ -74,6 +84,27 @@ function M.search(msg_body)
     local page_number = msg_body.page_number
     local offset = (page_number - 1) * page_size
 
+
+    local yun_fabu_time_param = ""
+    if msg_body.start_yun_fabu_time~="" and msg_body.end_yun_fabu_time~="" then
+        yun_fabu_time_param = " AND DATE(yun_fabu_time) >= DATE(FROM_UNIXTIME(" .. (msg_body.start_yun_fabu_time / 1000) .. ")) AND DATE(yun_fabu_time) <= DATE(FROM_UNIXTIME(" .. (msg_body.end_yun_fabu_time / 1000) .. "))"
+    end
+
+    local publish_time_param = ""
+    if msg_body.start_publish_time~="" and msg_body.end_publish_time~="" then
+        publish_time_param = " AND DATE(publish_time) >= DATE(FROM_UNIXTIME(" .. (msg_body.start_publish_time / 1000) .. ")) AND DATE(publish_time) <= DATE(FROM_UNIXTIME(" .. (msg_body.end_publish_time / 1000) .. ")) "
+    end
+
+    local opt_time_param = ""
+    if msg_body.start_opt_time~="" and msg_body.end_opt_time~="" then
+        opt_time_param = " AND DATE(opt_time) >= DATE(FROM_UNIXTIME(" .. (msg_body.start_opt_time / 1000) .. ")) AND DATE(opt_time) <= DATE(FROM_UNIXTIME(" .. (msg_body.end_opt_time / 1000) .. "))"
+    end
+
+    local exe_review_person_id_param = ""
+    if msg_body.exe_review_person_id~="" then
+        exe_review_person_id_param = string.format(" AND exe_review_person_id = %d ",tonumber(msg_body.exe_review_person_id)) 
+    end
+
     local user_id_param = ""
     if msg_body.user_id~="" then
         user_id_param = string.format(" AND user_id = %d ",tonumber(msg_body.user_id)) 
@@ -126,11 +157,6 @@ function M.search(msg_body)
     end
 
 
-    local publish_time_param = ""
-    if msg_body.publish_time~=""  then
-        publish_time_param = string.format(" AND publish_time = '%s' ",msg_body.publish_time)
-    end
-
     local date_param = ""
     if msg_body.start_time_date~="" and msg_body.end_time_date~="" then
         date_param = " AND DATE(create_at) >= DATE(FROM_UNIXTIME(" .. (msg_body.start_time_date / 1000) .. ")) AND DATE(create_at) <= DATE(FROM_UNIXTIME(" .. (msg_body.end_time_date / 1000) .. "))"
@@ -275,7 +301,7 @@ function M.search(msg_body)
 
     local new_param = stat_cost_param..show_cnt_param..click_cnt_param..convert_cnt_param..cvr_param..ctr_param
     -----
-    local param = publish_time_param..word_param..genre_param..date_param..product_param..oce_material_param..status_param..tg_platform_param..sync_status_param..product_name_param..is_auto_param..material_id_param..signature_param..dy_id_1_param..artificial_status_param..machine_review_status_param..is_sexual_inducement_content_param..is_bad_value_view_param..user_id_param
+    local param = publish_time_param..yun_fabu_time_param..exe_review_person_id_param..opt_time_param..word_param..genre_param..date_param..product_param..oce_material_param..status_param..tg_platform_param..sync_status_param..product_name_param..is_auto_param..material_id_param..signature_param..dy_id_1_param..artificial_status_param..machine_review_status_param..is_sexual_inducement_content_param..is_bad_value_view_param..user_id_param
 
     local up_down_param = d_z_param..comment_param..forward_param..collect_param..new_param