Skip to content

Commit 0f2a1a1

Browse files
committed
fix. getRaceCountByAthleteCount wrong parameter.
1 parent 475105c commit 0f2a1a1

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/pageWidgets/shortDistanceRace/shortDistancePage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class _SprintRacePageState extends State<ShortDistancePage> {
248248
var c = widget.raceBar.contains('趴板')
249249
? CType.pronePaddle
250250
: CType.sprint;
251-
final raceCount = await getRaceCountByAthleteCount(athleteCount,c);
251+
final raceCount = await getRaceCountByAthleteCount(athleteCount,c,widget.raceEventName);
252252
return [athleteCount, raceCount]; // 返回一个列表,包含两个值
253253
}(), builder: (context, snapshot) {
254254
if (snapshot.connectionState == ConnectionState.done) {

lib/utils/DatabaseManager.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:sqflite/sqflite.dart';
55

66
class DatabaseManager {
77
static Future<Database> getDatabase(String dbName) async {
8+
print("获取数据库:$dbName");
89
String path = await getFilePath("$dbName.db");
910
return await openDatabase(
1011
path,

lib/utils/GlobalFunction.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ Future<int> getAthleteCountByDivision(
8585

8686
/// 通过运动员数量获取比赛数
8787
/// - [athleteCount] 运动员数量
88-
Future<int> getRaceCountByAthleteCount(int athleteCount,CType c) async {
88+
Future<int> getRaceCountByAthleteCount(int athleteCount,CType c,String dbName) async {
89+
print("getRaceCountByAthleteCount$dbName");
8990
int athleteCountPerGroup =
90-
await getAthleteCountPerGroup('PaddleScoreData', c);
91+
await getAthleteCountPerGroup(dbName, c);
9192
if (athleteCount <= athleteCountPerGroup) {
9293
return 1;
9394
} else if (athleteCount > athleteCountPerGroup &&

0 commit comments

Comments
 (0)