ソースを参照

修复打开PDF路径错误。

Pen Li 9 年 前
コミット
01ce1349e3

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 7 - 2
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -10342,13 +10342,18 @@
     
     __block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
     
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+    NSString *cachefolder = [paths objectAtIndex:0];
+    NSString *pdfFolder = [cachefolder stringByAppendingPathComponent:@"pdf_cache"];
+    
     [iSalesDB jk_query:sql completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
         
         NSString *name = [self textAtColumn:0 statement:stmt];
         NSString *note = [self textAtColumn:1 statement:stmt];
         NSString *time = [self textAtColumn:2 statement:stmt];
         NSString *user = [self textAtColumn:3 statement:stmt];
-        NSString *patch = [self textAtColumn:4 statement:stmt];
+        NSString *path = [self textAtColumn:4 statement:stmt];
+        path = [pdfFolder stringByAppendingPathComponent:path];
         
         time = [self changeDateTimeFormate:time];
         time = [time stringByAppendingString:@" PST"];
@@ -10359,7 +10364,7 @@
         
         NSMutableDictionary *item = @{
                                       @"tearsheetsId": @(sheet_id),
-                                      @"pdf_path": patch,
+                                      @"pdf_path": path,
                                       @"create_time": time,
                                       @"create_user": user,
                                       @"tear_note": note,