client
This commit is contained in:
parent
99d570bd3a
commit
13296529c3
@ -806,24 +806,12 @@ class AppDatabase {
|
||||
|
||||
Future<List<Commande>> getCommandes() async {
|
||||
final db = await database;
|
||||
|
||||
final result = await db.query('''
|
||||
SELECT
|
||||
c.*,
|
||||
cl.nom as clientNom,
|
||||
cl.prenom as clientPrenom,
|
||||
cl.email as clientEmail,
|
||||
u.nom as commandeurNom,
|
||||
u.prenom as commandeurPrenom,
|
||||
pdv.nom as pointDeVenteNom,
|
||||
pdv.id as pointDeVenteId
|
||||
FROM commandes c
|
||||
LEFT JOIN clients cl ON c.clientId = cl.id
|
||||
LEFT JOIN users u ON c.commandeurId = u.id
|
||||
LEFT JOIN points_de_vente pdv ON u.point_de_vente_id = pdv.id
|
||||
ORDER BY c.dateCommande DESC
|
||||
''');
|
||||
|
||||
SELECT c.*, cl.nom as clientNom, cl.prenom as clientPrenom, cl.email as clientEmail
|
||||
FROM commandes c
|
||||
LEFT JOIN clients cl ON c.clientId = cl.id
|
||||
ORDER BY c.dateCommande DESC
|
||||
''');
|
||||
return result.map((row) => Commande.fromMap(row.fields)).toList();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ class DatabaseConfig {
|
||||
static const String localDatabase = 'guycom';
|
||||
|
||||
// Production (public) MySQL settings
|
||||
static const String prodHost = '185.70.105.157';
|
||||
static const String prodHost = '102.17.52.31';
|
||||
static const String prodUsername = 'guycom';
|
||||
static const String prodPassword = '3iV59wjRdbuXAPR';
|
||||
static const String prodDatabase = 'guycom';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user