feat:搜索总数的问题
This commit is contained in:
1 parent
4a7a6e5c6c
commit
e8553a39c0
4 files changed
+7
-3
No files matched your search
@@ -36,7 +36,7 @@ abstract class SupermarketSkuDao {
|
||||
INNER JOIN supermarket_spu ON supermarket_sku.spuId = supermarket_spu.serviceUniqueCode AND supermarket_spu.delFlag = 0
|
||||
WHERE
|
||||
1 = 1
|
||||
AND (:barCode = '-1' OR supermarket_sku.barCode LIKE '%' || :barCode || '%' OR supermarket_spu.productName LIKE '%' || :barCode || '%' )
|
||||
AND (:barCode = '-1' OR supermarket_sku.barCode LIKE '%' || :barCode || '%' OR supermarket_spu.productName LIKE '%' || :barCode || '%' OR (:barCode != '' AND supermarket_spu.productNamePy LIKE '%' || :barCode || '%') )
|
||||
AND (:classifyServiceUniqueCode = '-1' OR supermarket_spu.classifyServiceUniqueCode = :classifyServiceUniqueCode)
|
||||
""")
|
||||
Future<int?> getCount(String barCode, String classifyServiceUniqueCode);
|
||||
|
||||
@@ -808,7 +808,7 @@ class _$SupermarketSkuDao extends SupermarketSkuDao {
|
||||
String classifyServiceUniqueCode,
|
||||
) async {
|
||||
return _queryAdapter.query(
|
||||
'SELECT DISTINCT COUNT(0) FROM supermarket_sku INNER JOIN supermarket_spu ON supermarket_sku.spuId = supermarket_spu.serviceUniqueCode AND supermarket_spu.delFlag = 0 WHERE 1 = 1 AND (?1 = \'-1\' OR supermarket_sku.barCode LIKE \'%\' || ?1 || \'%\' OR supermarket_spu.productName LIKE \'%\' || ?1 || \'%\' ) AND (?2 = \'-1\' OR supermarket_spu.classifyServiceUniqueCode = ?2)',
|
||||
'SELECT DISTINCT COUNT(0) FROM supermarket_sku INNER JOIN supermarket_spu ON supermarket_sku.spuId = supermarket_spu.serviceUniqueCode AND supermarket_spu.delFlag = 0 WHERE 1 = 1 AND (?1 = \'-1\' OR supermarket_sku.barCode LIKE \'%\' || ?1 || \'%\' OR supermarket_spu.productName LIKE \'%\' || ?1 || \'%\' OR (?1 != \'\' AND supermarket_spu.productNamePy LIKE \'%\' || ?1 || \'%\') ) AND (?2 = \'-1\' OR supermarket_spu.classifyServiceUniqueCode = ?2)',
|
||||
mapper: (Map<String, Object?> row) => row.values.first as int,
|
||||
arguments: [barCode, classifyServiceUniqueCode]);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
||||
import 'package:background_downloader/background_downloader.dart';
|
||||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -43,6 +44,10 @@ class AppControl extends GetxController {
|
||||
|
||||
Future<void> initAsync() async {
|
||||
await AppSettingTool.removeSettingCache();
|
||||
var granted = await Permission.manageExternalStorage.request().isGranted;
|
||||
if (!granted) {
|
||||
granted = await Permission.storage.request().isGranted;
|
||||
}
|
||||
dataBase = await AppDatabase.getDataBase();
|
||||
printManage = PrintManage();
|
||||
serialCardManage = SerialCardManage();
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'dart:async';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:background_downloader/background_downloader.dart';
|
||||
import 'package:flutter_subscreen_plugin/flutter_subscreen_plugin.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pj_supermarket_cloud/app.dart';
|
||||
|
||||
Reference in new issue
Block a user