|
@@ -144,7 +144,7 @@ function M.mainFilter(msg_body)
|
|
|
end
|
|
|
|
|
|
function M.search(msg_body)
|
|
|
- local isok ,key = tools.checkData({"avatar_status","property_status","main_id","content","page_size","page_number","status"},msg_body)
|
|
|
+ local isok ,key = tools.checkData({"advertiser_id_list","avatar_status","property_status","main_id","content","page_size","page_number","status"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
|
end
|
|
@@ -152,6 +152,13 @@ function M.search(msg_body)
|
|
|
local page_number = msg_body.page_number
|
|
|
local offset = (page_number - 1) * page_size
|
|
|
|
|
|
+ local advertiser_id_list_param = ""
|
|
|
+ if msg_body.advertiser_id_list~="" then
|
|
|
+ local idString = table.concat(msg_body.advertiser_id_list, ",")
|
|
|
+ advertiser_id_list_param = string.format(" AND advertiser_id IN (%s) ",idString)
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
local property_status_param = ""
|
|
|
if msg_body.property_status~="" then
|
|
|
property_status_param = "AND property_status = "..msg_body.property_status.." "
|
|
@@ -177,7 +184,7 @@ function M.search(msg_body)
|
|
|
content_param = string.format(" AND (advertiser_name LIKE CONCAT( '%%%s%%')) OR (advertiser_id LIKE CONCAT('%%%s%%'))",msg_body.content,msg_body.content)
|
|
|
end
|
|
|
|
|
|
- local param = avatar_status_param..property_status_param..statuss_param..main_id_param..content_param
|
|
|
+ local param = advertiser_id_list_param..avatar_status_param..property_status_param..statuss_param..main_id_param..content_param
|
|
|
local sql = "SELECT COUNT(*) AS total FROM advertiser WHERE 1=1 "..param
|
|
|
local total = mysqldbx.query(sql)
|
|
|
|