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 | 64 | if self:getProperty(field) > 0 then |
| 65 | 65 | dataMap[field] = 0 |
| 66 | 66 | end |
| 67 | + elseif field == "id" then | |
| 68 | + -- skip | |
| 67 | 69 | elseif field == "treasureList" then |
| 68 | 70 | dataMap[field] = self:getTreasrueList() |
| 69 | 71 | elseif field ~= "key" then | ... | ... |
src/services/pvpd.lua
| 1 | 1 | skynet = require "skynet" |
| 2 | 2 | local json = require("shared.json") |
| 3 | 3 | redisproxy = require("shared.redisproxy") |
| 4 | +mysqlproxy = require("shared.mysqlproxy") | |
| 4 | 5 | local cluster = require "skynet.cluster" |
| 5 | 6 | local serverId = tonumber(skynet.getenv("servId")) |
| 6 | 7 | datacenter = require "skynet.datacenter" | ... | ... |
src/shared/ModelBaseMysql.lua
| ... | ... | @@ -503,8 +503,8 @@ function ModelBaseMysql:updateFields(fields) |
| 503 | 503 | sql = string_format(sql, tbName, table.concat(tmp, ","), self.pri_key, self:getKey()) |
| 504 | 504 | local res = mysqlproxy:query(sql) |
| 505 | 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 | 508 | return false |
| 509 | 509 | end |
| 510 | 510 | end | ... | ... |
src/utils/MysqlUtil.lua
| ... | ... | @@ -57,7 +57,7 @@ function roleExists(roleId) |
| 57 | 57 | end |
| 58 | 58 | |
| 59 | 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 | 61 | if res["errno"] or not next(res) then |
| 62 | 62 | return false |
| 63 | 63 | end | ... | ... |