904118851 4 bulan lalu
induk
melakukan
5fd34fd14e
1 mengubah file dengan 21 tambahan dan 0 penghapusan
  1. 21 0
      service/backmgr/video_product.lua

+ 21 - 0
service/backmgr/video_product.lua

@@ -9,6 +9,27 @@ local mysql = require "skynet.db.mysql"
 local db
 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)
     local isok ,key =  tools.checkData({
     "alias_name",