|
@@ -6,7 +6,7 @@ local skynet = require "skynet"
|
|
|
local cjson = require "cjson"
|
|
|
|
|
|
function M.search_filter_data(msg_body)
|
|
|
- local isok ,key = tools.checkData({"video_id","tg_platform_id","page_size","page_number",
|
|
|
+ local isok ,key = tools.checkData({"material_sync_status","video_id","tg_platform_id","page_size","page_number",
|
|
|
"d_z","comment","collect","forward","product_id","source","start_publish_time","end_publish_time","start_create_time","end_create_time"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
@@ -15,6 +15,13 @@ function M.search_filter_data(msg_body)
|
|
|
local page_number = msg_body.page_number
|
|
|
local offset = (page_number - 1) * page_size
|
|
|
|
|
|
+
|
|
|
+ local material_sync_status_param = ""
|
|
|
+ if msg_body.material_sync_status~="" then
|
|
|
+ material_sync_status_param = " AND material_sync_status = ".. msg_body.material_sync_status
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
local tg_platform_id_param = ""
|
|
|
if msg_body.tg_platform_id~="" then
|
|
|
tg_platform_id_param = " AND tg_platform_id = "..msg_body.tg_platform_id.." "
|
|
@@ -84,7 +91,7 @@ function M.search_filter_data(msg_body)
|
|
|
end
|
|
|
|
|
|
|
|
|
- local param = tg_platform_id_param..date_param..create_date_param..product_param..source_param..video_id_param
|
|
|
+ local param = tg_platform_id_param..date_param..create_date_param..product_param..source_param..video_id_param..material_sync_status_param
|
|
|
|
|
|
local up_down_param = d_z_param..comment_param..forward_param..collect_param
|
|
|
|
|
@@ -92,7 +99,7 @@ function M.search_filter_data(msg_body)
|
|
|
up_down_param = " ORDER BY " ..up_down_param
|
|
|
end
|
|
|
|
|
|
- local sql = "SELECT * FROM filter_data WHERE status!=2 "..param..up_down_param.."ORDER BY id DESC"..string.format(" LIMIT %d OFFSET %d ",page_size, offset)
|
|
|
+ local sql = "SELECT * FROM filter_data WHERE status!=2 "..param..up_down_param.." ORDER BY id DESC"..string.format(" LIMIT %d OFFSET %d ",page_size, offset)
|
|
|
|
|
|
local res = mysqldbx.query(sql)
|
|
|
|
|
@@ -112,7 +119,7 @@ function M.set_material_sync_status(msg_body)
|
|
|
for i = 1, #msg_body.id_list, 1 do
|
|
|
local res,sql,id;
|
|
|
id = msg_body.id_list[i]
|
|
|
- sql = string.format("UPDATE filter_data SET material_sync_status = %d WHERE id = %d ",msg_body.material_sync_status,id)
|
|
|
+ sql = string.format("UPDATE filter_data SET material_sync_status = %d , status = 1 WHERE id = %d ",msg_body.material_sync_status,id)
|
|
|
res = mysqldbx.query(sql)
|
|
|
end
|
|
|
return true,{}
|