public void SaveBHMatchBHData(BHMatchBHData data, bool chgChampion = true, bool chgKill = true) { string sql = string.Format("INSERT INTO t_banghui_match_bh(`type`, `bhid`, `bhname`, `zoneid_bh`, `rid`, `rname`, `zoneid_r`, `play`, `champion`, `kill`, bullshit, bestrecord) VALUES({0},{1},'{2}',{3},{4},'{5}',{6},{7},{8},{9},{10},{11}) ON DUPLICATE KEY UPDATE `bhname`='{2}',`zoneid_bh`={3},`rid`={4},`rname`='{5}',`zoneid_r`={6},`play`={7},`champion`={8},`kill`={9},`bullshit`={10},`bestrecord`={11};", new object[] { data.type, data.bhid, data.bhname, data.zoneid_bh, data.rid, data.rname, data.zoneid_r, data.hist_play, data.hist_champion, data.hist_kill, data.hist_bullshit, data.best_record }); this.ExecuteSqlNoQuery(sql); if (chgChampion) { sql = string.Format("UPDATE t_banghui_match_bh SET ranktm_champion=NOW() WHERE `type`={0} AND `bhid`={1};", data.type, data.bhid); this.ExecuteSqlNoQuery(sql); } if (chgKill) { sql = string.Format("UPDATE t_banghui_match_bh SET ranktm_kill=NOW() WHERE `type`={0} AND `bhid`={1};", data.type, data.bhid); this.ExecuteSqlNoQuery(sql); } }
public void SaveBHMatchBHSeasonData(int season, BHMatchBHData data, bool chgWin = true, bool chgScore = true) { string sql = string.Format("INSERT INTO t_banghui_match_bh_season(`type`, season, bhid, win, `group`, score) VALUES({0},{1},{2},{3},{4},{5}) ON DUPLICATE KEY UPDATE win={3},`group`={4},score={5};", new object[] { data.type, season, data.bhid, data.cur_win, data.group, data.cur_score }); this.ExecuteSqlNoQuery(sql); if (chgWin) { sql = string.Format("UPDATE t_banghui_match_bh_season SET ranktm_win=NOW() WHERE `type`={0} AND `season`={1} AND `bhid`={2};", data.type, season, data.bhid); this.ExecuteSqlNoQuery(sql); } if (chgScore) { sql = string.Format("UPDATE t_banghui_match_bh_season SET ranktm_score=NOW() WHERE `type`={0} AND `season`={1} AND `bhid`={2};", data.type, season, data.bhid); this.ExecuteSqlNoQuery(sql); } }