X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=brisk.git;a=blobdiff_plain;f=web%2FObj%2Fdbase_pgsql.phh;h=1c9bea4d601540686967299f066af8e1e2333f44;hp=74a5dbd80c99f8b8a55175b9ba49220829d258d6;hb=fd5eec5ecd988df774eb9fb8744a0274e918980b;hpb=396f7d9d4af7eeb3af838c13c1e84296629ee21f diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index 74a5dbd..1c9bea4 100644 --- a/web/Obj/dbase_pgsql.phh +++ b/web/Obj/dbase_pgsql.phh @@ -720,8 +720,11 @@ class BriskDB // match not exists, insert it // , BIN5_TOURNAMENT_NO_DRAW - $mtc_sql = sprintf("INSERT INTO %sbin5_matches (ttok, tidx, mazzo_next, mult_next, tcode) VALUES ('%s', %d, %d, %d, %d) RETURNING *;", - $G_dbpfx, $sql_ttok, $tidx, $table->mazzo, $table->mult, $table->rules->id_get()); + $mtc_sql = sprintf("INSERT INTO %sbin5_matches (ttok, ttype, tidx, mazzo_next, mult_next, tcode) VALUES ('%s', %d, %d, %d, %d, %d) RETURNING *;", + $G_dbpfx, $sql_ttok, + ($tidx < TABLES_CERT_N ? 1 : ($tidx < TABLES_AUTH_N ? 2 : ( + $tidx < TABLES_APPR_N ? 3 : 4))), + $tidx, $table->mazzo, $table->mult, $table->rules->id_get()); if (($mtc_pg = $this->query($mtc_sql)) == FALSE || pg_affected_rows($mtc_pg) != 1) { log_crit(sprintf("bin5_points_save: failed at insert match [%s]", $mtc_sql)); break;