Просмотр исходного кода

160914
Modify: optimise func model_category_img speed up.

Ray Zhang 9 лет назад
Родитель
Сommit
dae5917c0d

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


+ 4 - 4
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -191,7 +191,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "2176"
             endingLineNumber = "2176"
-            landmarkName = "+model_subtotal:count:db:compute_part:"
+            landmarkName = "+model_bundle:db:compute_part:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -223,14 +223,14 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "3344"
             endingLineNumber = "3344"
-            landmarkName = "+model_bundle:db:count:"
+            landmarkName = "+category_img:db:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
@@ -239,7 +239,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "3348"
             endingLineNumber = "3348"
-            landmarkName = "+model_bundle:db:count:"
+            landmarkName = "+category_img:db:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>

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

@@ -1292,9 +1292,9 @@
     //select url,type from model_image where product_id=%d and type=1 order by default_img desc , _id asc limit 1;",product_id
     
     if(product_id==nil && model_name)
-        sqlQuery = [NSString stringWithFormat:@"select i.url from product m LEFT join model_image i on m.product_id = i.product_id  where m.name=%@ order by i.default_img desc, i._id asc limit 1;",model_name];// select i.url from model m LEFT join model_image i on m.product_id = i.product_id  where m.name=%@ order by i.default_img desc, i._id asc limit 1;
+        sqlQuery = [NSString stringWithFormat:@"select i.url from (select name,product_id from product where name=%@) m LEFT join model_image i on m.product_id = i.product_id   order by i.default_img desc, i._id asc limit 1;",model_name];// select i.url from model m LEFT join model_image i on m.product_id = i.product_id  where m.name=%@ order by i.default_img desc, i._id asc limit 1;
     else if (product_id)
-        sqlQuery = [NSString stringWithFormat:@"select i.url from product m LEFT join model_image i on m.product_id = i.product_id  where m.product_id=%@ order by i.default_img desc, i._id asc limit 1;",product_id];// select i.url from model m
+        sqlQuery = [NSString stringWithFormat:@"select i.url from (select name,product_id from product where name=%@) m LEFT join model_image i on m.product_id = i.product_id   order by i.default_img desc, i._id asc limit 1;",product_id];// select i.url from model m
     
     sqlite3_stmt * statement;