|
@@ -9,6 +9,27 @@ local mysql = require "skynet.db.mysql"
|
|
local db
|
|
local db
|
|
local mysqldtaskbx = {}
|
|
local mysqldtaskbx = {}
|
|
|
|
|
|
|
|
+function M.search_xia_jia(msg_body)
|
|
|
|
+ local isok ,key = tools.checkData({"id_list","page_size",
|
|
|
|
+ "page_number",},msg_body)
|
|
|
|
+ if not isok then
|
|
|
|
+ return false,string.format("缺少字段: %s.", key)
|
|
|
|
+ end
|
|
|
|
+ local page_size = msg_body.page_size
|
|
|
|
+ local page_number = msg_body.page_number
|
|
|
|
+ local offset = (page_number - 1) * page_size
|
|
|
|
+
|
|
|
|
+ local idString = table.concat(msg_body.id_list, ",")
|
|
|
|
+ local sql = string.format("SELECT * FROM video_product WHERE product_id IN (%s)",idString)..string.format(" LIMIT %d OFFSET %d ",page_size, offset)
|
|
|
|
+ local isok,res;
|
|
|
|
+ skynet.error("sql:",sql)
|
|
|
|
+ local res = mysqldtaskbx.Singleton().query(sql)
|
|
|
|
+ sql = string.format("SELECT COUNT(*) AS total FROM video_product WHERE product_id IN (%s)",idString)
|
|
|
|
+ skynet.error("sql:",sql)
|
|
|
|
+ local total = mysqldtaskbx.Singleton().query(sql)
|
|
|
|
+ return true,res,total[1].total
|
|
|
|
+end
|
|
|
|
+
|
|
function M.search_book_data_on_main(msg_body)
|
|
function M.search_book_data_on_main(msg_body)
|
|
local isok ,key = tools.checkData({
|
|
local isok ,key = tools.checkData({
|
|
"alias_name",
|
|
"alias_name",
|