Android analytics done, camera instructions added.
This commit is contained in:
13
lib/db.dart
13
lib/db.dart
@@ -37,14 +37,14 @@ class SqliteHelper {
|
||||
db = await openDatabase(path, version: 1,
|
||||
onCreate: (Database db, int version) async {
|
||||
|
||||
await db.execute('''create table $tableSession (
|
||||
await db.execute('''create table $tableSession (
|
||||
$columnMerchantID text primary key,
|
||||
$columnToken text,
|
||||
$columnToken text,
|
||||
$columnPosID text,
|
||||
$columnDocID integer)''');
|
||||
|
||||
await db.execute('''create table $tableSettings (
|
||||
$columnCurrency integer,
|
||||
await db.execute('''create table $tableSettings (
|
||||
$columnCurrency integer,
|
||||
$columnLocale text)''');
|
||||
});
|
||||
}
|
||||
@@ -52,14 +52,12 @@ class SqliteHelper {
|
||||
/// Создается запись в таблице, содержащая
|
||||
/// необходимые для идентификации пользователя и проведения запросов.
|
||||
Future createSession(String merchantID, String posID, String token) async {
|
||||
|
||||
Map session = {
|
||||
columnMerchantID: merchantID,
|
||||
columnPosID: posID,
|
||||
columnToken: token,
|
||||
columnDocID: 0
|
||||
};
|
||||
|
||||
return db.insert(tableSession, session);
|
||||
}
|
||||
|
||||
@@ -109,7 +107,8 @@ class SqliteHelper {
|
||||
|
||||
Future<String> getPosID() async {
|
||||
Map session = await selectAll(tableSession);
|
||||
return session != null ? session[columnPosID] : new DateTime.now().millisecondsSinceEpoch.toString();
|
||||
String time = new DateTime.now().millisecondsSinceEpoch.toString();
|
||||
return session != null ? session[columnPosID] : time;
|
||||
}
|
||||
|
||||
Future<int> getDocID() async {
|
||||
|
||||
Reference in New Issue
Block a user