|
@@ -26,7 +26,8 @@ function M.set_sweight(msg_body)
|
|
|
end
|
|
|
|
|
|
function M.search_task_material_queue_queue(msg_body)
|
|
|
- local isok ,key = tools.checkData({"id","butler_id","tg_main_id","page_size","page_number","start_create_time","end_create_time",
|
|
|
+ local isok ,key = tools.checkData({ "is_copy", "start_publish_time",
|
|
|
+ "end_publish_time","id","butler_id","tg_main_id","page_size","page_number","start_create_time","end_create_time",
|
|
|
"tg_platform_id","advertiser_id","advertiser_name","product_id","product_name","material_id","status"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
@@ -36,6 +37,16 @@ function M.search_task_material_queue_queue(msg_body)
|
|
|
local offset = (page_number - 1) * page_size
|
|
|
|
|
|
|
|
|
+ local date_param = ""
|
|
|
+ if msg_body.start_publish_time~="" and msg_body.end_publish_time~="" then
|
|
|
+ date_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 is_copy_param = ""
|
|
|
+ if msg_body.is_copy~="" then
|
|
|
+ is_copy_param = " AND is_copy = "..msg_body.is_copy
|
|
|
+ end
|
|
|
+
|
|
|
local id_param = ""
|
|
|
if msg_body.id~="" then
|
|
|
id_param = " AND id = "..msg_body.id
|
|
@@ -93,7 +104,7 @@ function M.search_task_material_queue_queue(msg_body)
|
|
|
create_date_param = " AND DATE(created_at) >= DATE(FROM_UNIXTIME(" .. (msg_body.start_create_time / 1000) .. ")) AND DATE(created_at) <= DATE(FROM_UNIXTIME(" .. (msg_body.end_create_time / 1000) .. "))"
|
|
|
end
|
|
|
|
|
|
- local param = id_param..tg_main_id_param..butler_id_param..tg_platform_id_param..advertiser_id_param..advertiser_name_param..product_id_param..product_name_param..material_id_param..status_param..create_date_param
|
|
|
+ local param = date_param..is_copy_param..id_param..tg_main_id_param..butler_id_param..tg_platform_id_param..advertiser_id_param..advertiser_name_param..product_id_param..product_name_param..material_id_param..status_param..create_date_param
|
|
|
|
|
|
local sql = "SELECT * FROM task_material_queue_queue WHERE 1=1 "..param.." ORDER BY id DESC "..string.format(" LIMIT %d OFFSET %d ",page_size, offset)
|
|
|
|