904118851 vor 7 Monaten
Ursprung
Commit
a90dab19ad
1 geänderte Dateien mit 55 neuen und 4 gelöschten Zeilen
  1. 55 4
      common/dbproxy/tg_platform.lua

+ 55 - 4
common/dbproxy/tg_platform.lua

@@ -18,13 +18,15 @@ end
 
 --添加平台
 function M.addPlatform(msg_body)
-    local isok ,key ,id=  tools.checkData({"filter_guajian_logic_list","platform_shared_id","mini_program_platform_id","tg_platform_name","filter_guajian_logic"},msg_body)
+    local isok ,key ,id=  tools.checkData({"parent_platform_id","filter_guajian_logic_list","platform_shared_id","mini_program_platform_id","tg_platform_name","filter_guajian_logic"},msg_body)
     if not isok then
         return false,string.format("缺少字段: %s.", key)
     end
     local _,data = M.getTotal()
     local id = data.total + 1
-    local sql = string.format("INSERT INTO `tg_platform` (filter_guajian_logic_list,platform_shared_id,mini_program_platform_id,tg_platform_id,tg_platform_name,filter_guajian_logic)  VALUES ('%s',%d,%d,%d,'%s','%s')", cjson.encode(msg_body.filter_guajian_logic_list),msg_body.platform_shared_id,msg_body.mini_program_platform_id,id,msg_body.tg_platform_name,msg_body.filter_guajian_logic)
+    local sql = string.format("INSERT INTO `tg_platform` (parent_platform_id,filter_guajian_logic_list,platform_shared_id,mini_program_platform_id,tg_platform_id,tg_platform_name,filter_guajian_logic)  VALUES (%d,'%s',%d,%d,%d,'%s','%s')",
+    msg_body.parent_platform_id, 
+    cjson.encode(msg_body.filter_guajian_logic_list),msg_body.platform_shared_id,msg_body.mini_program_platform_id,id,msg_body.tg_platform_name,msg_body.filter_guajian_logic)
     skynet.error(sql)
     mysqldbx.query(sql)
     skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updatePlatformConfig"}))
@@ -32,13 +34,62 @@ function M.addPlatform(msg_body)
 end
 
 
+function M.set_huichuan(msg_body)
+    local isok ,key =  tools.checkData({"huichuan","id"},msg_body)
+    if not isok then
+        return false,string.format("缺少字段: %s.", key)
+    end
+    local sql = string.format("UPDATE `tg_platform` SET  huichuan = '%s'  WHERE id = %d ",
+    cjson.encode(msg_body.huichuan),msg_body.id)
+    mysqldbx.query(sql)
+    skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updatePlatformConfig"}))
+    return true
+end
+
+function M.set_chongzhi(msg_body)
+    local isok ,key =  tools.checkData({"chongzhi","id"},msg_body)
+    if not isok then
+        return false,string.format("缺少字段: %s.", key)
+    end
+    local sql = string.format("UPDATE `tg_platform` SET  chongzhi = '%s'  WHERE id = %d ",
+    cjson.encode(msg_body.chongzhi),msg_body.id)
+    mysqldbx.query(sql)
+    skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updatePlatformConfig"}))
+    return true
+end
+
+function M.set_kadian(msg_body)
+    local isok ,key =  tools.checkData({"kadian","id"},msg_body)
+    if not isok then
+        return false,string.format("缺少字段: %s.", key)
+    end
+    local sql = string.format("UPDATE `tg_platform` SET  kadian = '%s'  WHERE id = %d ",
+    cjson.encode(msg_body.kadian),msg_body.id)
+    mysqldbx.query(sql)
+    skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updatePlatformConfig"}))
+    return true
+end
+
+function M.set_f_chongzhi(msg_body)
+    local isok ,key =  tools.checkData({"f_chongzhi","id"},msg_body)
+    if not isok then
+        return false,string.format("缺少字段: %s.", key)
+    end
+    local sql = string.format("UPDATE `tg_platform` SET  f_chongzhi = '%s'  WHERE id = %d ",
+    cjson.encode(msg_body.f_chongzhi),msg_body.id)
+    mysqldbx.query(sql)
+    skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updatePlatformConfig"}))
+    return true
+end
+
 --修改平台
 function M.modifyPlatform(msg_body)
-    local isok ,key =  tools.checkData({"filter_guajian_logic_list","platform_shared_id","mini_program_platform_id","tg_platform_name","id","filter_guajian_logic"},msg_body)
+    local isok ,key =  tools.checkData({"parent_platform_id","filter_guajian_logic_list","platform_shared_id","mini_program_platform_id","tg_platform_name","id","filter_guajian_logic"},msg_body)
     if not isok then
         return false,string.format("缺少字段: %s.", key)
     end
-    local sql = string.format("UPDATE `tg_platform` SET filter_guajian_logic_list = '%s' , platform_shared_id = %d , mini_program_platform_id = %d , filter_guajian_logic = '%s' , tg_platform_name = '%s'  WHERE id = %d ",
+    local sql = string.format("UPDATE `tg_platform` SET parent_platform_id = %d , filter_guajian_logic_list = '%s' , platform_shared_id = %d , mini_program_platform_id = %d , filter_guajian_logic = '%s' , tg_platform_name = '%s'  WHERE id = %d ",
+    msg_body.parent_platform_id,
     cjson.encode(msg_body.filter_guajian_logic_list),
     msg_body.platform_shared_id,
     msg_body.mini_program_platform_id,