904118851 8 meses atrás
pai
commit
69ee7b5cc1
1 arquivos alterados com 6 adições e 6 exclusões
  1. 6 6
      common/dbproxy/tg_main.lua

+ 6 - 6
common/dbproxy/tg_main.lua

@@ -42,14 +42,14 @@ end
 -- `daily_new_limit` int DEFAULT '0' COMMENT '今天新上数量上限',
 -- `daily_new_limit` int DEFAULT '0' COMMENT '今天新上数量上限',
 
 
 function M.addMain(msg_body)
 function M.addMain(msg_body)
-    local isok ,key =  tools.checkData({"no_bid_budget","max_ad_quantity","tg_link_config","tg_platform_id","app_id","main_name","running_status","ad_quantity","cpa_bid","bid_type","bid_ratio","custom_budget","daily_new_limit","valid_time","group_id"},msg_body)
+    local isok ,key =  tools.checkData({"channelId","no_bid_budget","max_ad_quantity","tg_link_config","tg_platform_id","app_id","main_name","running_status","ad_quantity","cpa_bid","bid_type","bid_ratio","custom_budget","daily_new_limit","valid_time","group_id"},msg_body)
     if not isok then
     if not isok then
         return false,string.format("缺少字段: %s.", key)
         return false,string.format("缺少字段: %s.", key)
     end
     end
     local current_time = os.date("%Y-%m-%d %H:%M:%S")
     local current_time = os.date("%Y-%m-%d %H:%M:%S")
     msg_body.create_time = current_time
     msg_body.create_time = current_time
-    local sql = string.format("INSERT INTO `tg_main` (no_bid_budget,max_ad_quantity,tg_link_config,tg_platform_id,app_id,main_name,running_status,ad_quantity,cpa_bid,bid_type,bid_ratio,custom_budget,daily_new_limit,valid_time,group_id)  VALUES (%d,%d,'%s',%d,'%s','%s',%d,%d,%d,%d,'%s',%d,%d,%d,'%s')",
-        msg_body.no_bid_budget,msg_body.max_ad_quantity,cjson.encode(msg_body.tg_link_config),msg_body.tg_platform_id,msg_body.app_id,msg_body.main_name
+    local sql = string.format("INSERT INTO `tg_main` (channelId,no_bid_budget,max_ad_quantity,tg_link_config,tg_platform_id,app_id,main_name,running_status,ad_quantity,cpa_bid,bid_type,bid_ratio,custom_budget,daily_new_limit,valid_time,group_id)  VALUES ('%s',%d,%d,'%s',%d,'%s','%s',%d,%d,%d,%d,'%s',%d,%d,%d,'%s')",
+       msg_body.channelId, msg_body.no_bid_budget,msg_body.max_ad_quantity,cjson.encode(msg_body.tg_link_config),msg_body.tg_platform_id,msg_body.app_id,msg_body.main_name
     ,msg_body.running_status,msg_body.ad_quantity,msg_body.cpa_bid,msg_body.bid_type,msg_body.bid_ratio,msg_body.custom_budget,msg_body.daily_new_limit,msg_body.valid_time,msg_body.group_id)
     ,msg_body.running_status,msg_body.ad_quantity,msg_body.cpa_bid,msg_body.bid_type,msg_body.bid_ratio,msg_body.custom_budget,msg_body.daily_new_limit,msg_body.valid_time,msg_body.group_id)
     mysqldbx.query(sql)
     mysqldbx.query(sql)
     skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updateMainConfig"}))
     skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updateMainConfig"}))
@@ -158,14 +158,14 @@ function pushAddMainMsg(msg_body)
    
    
 end
 end
 function M.modifyMain(msg_body)
 function M.modifyMain(msg_body)
-    local isok ,key =  tools.checkData({"no_bid_budget","max_ad_quantity","tg_link_config","id","tg_platform_id","app_id","main_name","running_status","ad_quantity","cpa_bid","bid_type","bid_ratio","custom_budget","daily_new_limit","valid_time","group_id"},msg_body)
+    local isok ,key =  tools.checkData({"channelId","no_bid_budget","max_ad_quantity","tg_link_config","id","tg_platform_id","app_id","main_name","running_status","ad_quantity","cpa_bid","bid_type","bid_ratio","custom_budget","daily_new_limit","valid_time","group_id"},msg_body)
     if not isok then
     if not isok then
         return false,string.format("缺少字段: %s.", key)
         return false,string.format("缺少字段: %s.", key)
     end
     end
     local current_time = os.date("%Y-%m-%d %H:%M:%S")
     local current_time = os.date("%Y-%m-%d %H:%M:%S")
     msg_body.update_time = current_time
     msg_body.update_time = current_time
-    local sql = string.format("UPDATE  `tg_main` SET no_bid_budget = %d , max_ad_quantity = %d ,tg_platform_id = %d , app_id = '%s' ,main_name = '%s' , update_time = '%s' , running_status = %d ,ad_quantity = %d ,cpa_bid = %d ,bid_type = %d ,bid_ratio = '%s' ,custom_budget = %d ,daily_new_limit = %d ,valid_time = %d ,tg_link_config = '%s' ,group_id = '%s' WHERE id = %d ",
-    msg_body.no_bid_budget,msg_body.max_ad_quantity,msg_body.tg_platform_id,msg_body.app_id,msg_body.main_name,msg_body.update_time,msg_body.running_status,msg_body.ad_quantity,msg_body.cpa_bid,msg_body.bid_type,msg_body.bid_ratio,msg_body.custom_budget,
+    local sql = string.format("UPDATE  `tg_main` SET channelId = '%s' , no_bid_budget = %d , max_ad_quantity = %d ,tg_platform_id = %d , app_id = '%s' ,main_name = '%s' , update_time = '%s' , running_status = %d ,ad_quantity = %d ,cpa_bid = %d ,bid_type = %d ,bid_ratio = '%s' ,custom_budget = %d ,daily_new_limit = %d ,valid_time = %d ,tg_link_config = '%s' ,group_id = '%s' WHERE id = %d ",
+    msg_body.channelId,msg_body.no_bid_budget,msg_body.max_ad_quantity,msg_body.tg_platform_id,msg_body.app_id,msg_body.main_name,msg_body.update_time,msg_body.running_status,msg_body.ad_quantity,msg_body.cpa_bid,msg_body.bid_type,msg_body.bid_ratio,msg_body.custom_budget,
     msg_body.daily_new_limit,msg_body.valid_time,cjson.encode(msg_body.tg_link_config),msg_body.group_id,msg_body.id)
     msg_body.daily_new_limit,msg_body.valid_time,cjson.encode(msg_body.tg_link_config),msg_body.group_id,msg_body.id)
     mysqldbx.query(sql)
     mysqldbx.query(sql)
     skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updateMainConfig"}))
     skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updateMainConfig"}))