Commit 7104ee66ad3adb034bdf4aafad6c751cea629b8b
1 parent
a2df11d6
重复过新手bug, daily错误更新id bug,增加sql报错日志
Showing
4 changed files
with
6 additions
and
3 deletions
 
Show diff stats
src/models/Daily.lua
| @@ -64,6 +64,8 @@ function Daily:refreshDailyData(notify) | @@ -64,6 +64,8 @@ function Daily:refreshDailyData(notify) | ||
| 64 | if self:getProperty(field) > 0 then | 64 | if self:getProperty(field) > 0 then | 
| 65 | dataMap[field] = 0 | 65 | dataMap[field] = 0 | 
| 66 | end | 66 | end | 
| 67 | + elseif field == "id" then | ||
| 68 | + -- skip | ||
| 67 | elseif field == "treasureList" then | 69 | elseif field == "treasureList" then | 
| 68 | dataMap[field] = self:getTreasrueList() | 70 | dataMap[field] = self:getTreasrueList() | 
| 69 | elseif field ~= "key" then | 71 | elseif field ~= "key" then | 
src/services/pvpd.lua
| 1 | skynet = require "skynet" | 1 | skynet = require "skynet" | 
| 2 | local json = require("shared.json") | 2 | local json = require("shared.json") | 
| 3 | redisproxy = require("shared.redisproxy") | 3 | redisproxy = require("shared.redisproxy") | 
| 4 | +mysqlproxy = require("shared.mysqlproxy") | ||
| 4 | local cluster = require "skynet.cluster" | 5 | local cluster = require "skynet.cluster" | 
| 5 | local serverId = tonumber(skynet.getenv("servId")) | 6 | local serverId = tonumber(skynet.getenv("servId")) | 
| 6 | datacenter = require "skynet.datacenter" | 7 | datacenter = require "skynet.datacenter" | 
src/shared/ModelBaseMysql.lua
| @@ -503,8 +503,8 @@ function ModelBaseMysql:updateFields(fields) | @@ -503,8 +503,8 @@ function ModelBaseMysql:updateFields(fields) | ||
| 503 | sql = string_format(sql, tbName, table.concat(tmp, ","), self.pri_key, self:getKey()) | 503 | sql = string_format(sql, tbName, table.concat(tmp, ","), self.pri_key, self:getKey()) | 
| 504 | local res = mysqlproxy:query(sql) | 504 | local res = mysqlproxy:query(sql) | 
| 505 | if res["errno"] then | 505 | if res["errno"] then | 
| 506 | - skynet.error(sql) | ||
| 507 | - skynet.error(res["err"]) | 506 | + skynet.error("error sql:"..sql) | 
| 507 | + skynet.error("error str:"..res["err"]) | ||
| 508 | return false | 508 | return false | 
| 509 | end | 509 | end | 
| 510 | end | 510 | end | 
src/utils/MysqlUtil.lua
| @@ -57,7 +57,7 @@ function roleExists(roleId) | @@ -57,7 +57,7 @@ function roleExists(roleId) | ||
| 57 | end | 57 | end | 
| 58 | 58 | ||
| 59 | function roleUidExists(uid) | 59 | function roleUidExists(uid) | 
| 60 | - local res = mysqlproxy:query(string.format("SELECT `name` FROM `Role` WHERE `uid` = %s", uid)) | 60 | + local res = mysqlproxy:query(string.format("SELECT `name` FROM `Role` WHERE `uid` = '%s'", uid)) | 
| 61 | if res["errno"] or not next(res) then | 61 | if res["errno"] or not next(res) then | 
| 62 | return false | 62 | return false | 
| 63 | end | 63 | end |