|
@@ -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)
|