904118851 7 kuukautta sitten
vanhempi
sitoutus
6cde7598c7
3 muutettua tiedostoa jossa 27 lisäystä ja 3 poistoa
  1. 21 0
      common/dbproxy/tg_main.lua
  2. 4 3
      service/backmgr/checks.lua
  3. 2 0
      service/backmgr/init.lua

+ 21 - 0
common/dbproxy/tg_main.lua

@@ -28,6 +28,27 @@ function M.getCloseMainList()
     end
     return true, res
 end
+
+
+function M.getOpenCreateLinkMainList()
+    local sql = string.format("select * from `tg_main` where is_open_create_link = 1 ")
+    local isok,res;
+    res = mysqldbx.query(sql)
+    if #res <= 0 then
+        return true , {}
+    end
+    return true, res
+end
+
+function M.getCloseCreateLinkMainList()
+    local sql = string.format("select * from `tg_main` where is_open_create_link = 0 ")
+    local isok,res;
+    res = mysqldbx.query(sql)
+    if #res <= 0 then
+        return true , {}
+    end
+    return true, res
+end
 --page_size  是你想要在每页中显示的记录数。
 --page_number 页数
 --获取所有主体

+ 4 - 3
service/backmgr/checks.lua

@@ -5,15 +5,16 @@ local tools = require "tools"
 local skynet = require "skynet"
 local mysql = require "skynet.db.mysql"
 local config = require "run_config"
+local cjson = require "cjson"
 local db
 local mysqldtaskbx = {}
-
+-- SELECT * FROM products WHERE JSON_CONTAINS(main_id_info, '111') LIMIT 100
 function M.set_products_main_id(msg_body)
-    local isok ,key =  tools.checkData({"main_id","id"},msg_body)
+    local isok ,key =  tools.checkData({"main_id_info","id"},msg_body)
     if not isok then
         return false,string.format("缺少字段: %s.", key)
     end
-    local sql = string.format("UPDATE  products SET main_id = %d WHERE id = %d ",msg_body.main_id,msg_body.id)
+    local sql = string.format("UPDATE  products SET main_id_info = '%s' WHERE id = %d ",cjson.encode(msg_body.main_id_info),msg_body.id)
     mysqldtaskbx.Singleton().query(sql)
     return true, {}
 end

+ 2 - 0
service/backmgr/init.lua

@@ -35,6 +35,7 @@ local origin_data = require "origin_data"
 local video_product_material = require "video_product_material"
 local aweme_auth_list = require "aweme_auth_list"
 local checks = require "checks"
+local fq_mf_book = require "fq_mf_book"
 local status_200 = 200
 local CMD = {
     
@@ -68,6 +69,7 @@ CMD["origin_data"] = origin_data;
 CMD["video_product_material"] = video_product_material;
 CMD["aweme_auth_list"] = aweme_auth_list;
 CMD["checks"] = checks;
+CMD["fq_mf_book"] = fq_mf_book;
 function run(target,fun,msg_body,fd)
     if target~=nil and fun~=nil and target[fun]~=nil then
         local isok,data,total = target[fun](msg_body)