fix:每日菜谱排序和消费机排序一致

This commit is contained in:
dzc committed 2026-10-14 16:59:18 +08:00
1 parent aa4eb7b86e
commit fdfabf7eb7
3 files changed
+12 -9

No files matched your search

+1 -1
View File
@@ -983,7 +983,7 @@ class _$CanteenSpuDao extends CanteenSpuDao {
String saleDate,
) async {
return _queryAdapter.queryList(
'SELECT canteen_spu.* FROM canteen_spu LEFT JOIN classify ON canteen_spu.classifyServiceUniqueCode = classify.serviceUniqueCode AND classify.delFlag = 0 WHERE (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || hourType || \',\', \',\' || ?2 || \',\') > 0) AND (?3 = \'-1\' OR strftime(\'%Y-%m-%d\', saleDate) = strftime(\'%Y-%m-%d\', ?3)) ORDER BY classify.sort,canteen_spu.sort desc,canteen_spu.price',
'SELECT canteen_spu.* FROM canteen_spu WHERE (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || hourType || \',\', \',\' || ?2 || \',\') > 0) AND (?3 = \'-1\' OR strftime(\'%Y-%m-%d\', saleDate) = strftime(\'%Y-%m-%d\', ?3)) ORDER BY canteen_spu.sort asc, canteen_spu.id asc',
mapper: (Map<String, Object?> row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, stock: row['stock'] as int?, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, isPriceIncreased: _boolConverter.decode(row['isPriceIncreased'] as int), spuType: row['spuType'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String)),
arguments: [classifyServiceUniqueCode, hourType, saleDate]);
}