Selaa lähdekoodia

购物车优化

eganwu 1 vuosi sitten
vanhempi
commit
59b1a41585

+ 3 - 3
src/custom/objectregister/sa_shoppingcart.java

@@ -25,9 +25,9 @@ public class sa_shoppingcart implements YosObject {
     @Override
     public ArrayList<YosObjectCol> table_cols() {
         ArrayList<YosObjectCol> arrayList = new ArrayList<>();
-        arrayList.add(new VarcharCol("customcheek", "工艺", "工艺", 100, true, false, false, "", 1));
-        arrayList.add(new VarcharCol("customcolors", "颜色", "颜色", 200, true, false, false, "", 2));
-        arrayList.add(new VarcharCol("custommaterial", "选项", "选项", 100, true, false, false, "", 3));
+        arrayList.add(new VarcharCol("cheek", "工艺", "工艺", 100, true, false, false, "", 1));
+        arrayList.add(new VarcharCol("colors", "颜色", "颜色", 100, true, false, false, "", 2));
+        arrayList.add(new VarcharCol("material", "选项", "选项", 100, true, false, false, "", 3));
 
         return arrayList;
     }

+ 3 - 3
src/custom/restcontroller/sale/shoppingcart/SQL/购物车列表.sql

@@ -10,9 +10,9 @@ SELECT t1.sa_shoppingcartid,
        t1.qty,
        t1.length,
        t1.width,
-       t1.customcheek,
-       t1.customcolors,
-       t1.custommaterial,
+       t1.cheek,
+       t1.colors,
+       t1.material,
        t3.model,
        t3.spec,
        t3.orderminqty,

+ 2 - 2
src/custom/restcontroller/sale/shoppingcart/SQL/购物车新增.sql

@@ -1,6 +1,6 @@
 insert into sa_shoppingcart (siteid, sa_shoppingcartid, createuserid, createby, createdate, changeby, changedate,
                              sa_brandid, itemid, qty, itemno, sys_enterpriseid, tradefield, length, width,
-                             sa_promotionid, sa_promotion_itemsid, customcheek, customcolors, custommaterial)
+                             sa_promotionid, sa_promotion_itemsid, cheek, colors, material)
 values ($siteid$, $sa_shoppingcartid$, $userid$, $username$, current_time, $username$, current_time, $sa_brandid$,
         $itemid$, $qty$, $itemno$, $sys_enterpriseid$, $tradefield$, $length$, $width$, $sa_promotionid$,
-        $sa_promotion_itemsid$, $customcheek$, $customcolors$, $custommaterial$);
+        $sa_promotion_itemsid$, $cheek$, $colors$, $material$);

+ 3 - 3
src/custom/restcontroller/sale/shoppingcart/SQL/购物车更新.sql

@@ -5,8 +5,8 @@ SET changeby=$username$,
     tradefield = $tradefield$,
     length =$length$,
     width=$width$,
-    customcheek=$customcheek$,
-    customcolors=$customcolors$,
-    custommaterial=$custommaterial$
+    cheek=$cheek$,
+    colors=$colors$,
+    material=$material$
 WHERE sa_shoppingcartid = $sa_shoppingcartid$
   and siteid = $siteid$

+ 13 - 6
src/custom/restcontroller/sale/shoppingcart/ShoppingCart.java

@@ -80,6 +80,13 @@ public class ShoppingCart extends Controller {
         sqlFactory.addParameter("sa_brandid", sa_brandid);
         sqlFactory.addParameter("qty", qty);
         sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
+        String cheek = content.getStringValue("cheek");
+        String colors = content.getStringValue("colors");
+        String material = content.getStringValue("material");
+
+        sqlFactory.addParameter("cheek", cheek.equals("0") ? "" : cheek);
+        sqlFactory.addParameter("colors", colors.equals("0") ? "" : colors);
+        sqlFactory.addParameter("material", material.equals("0") ? "" : material);
         sqlList.add(sqlFactory.getSQL());
 
         dbConnect.runSqlUpdate(sqlList);
@@ -143,13 +150,13 @@ public class ShoppingCart extends Controller {
             sqlFactory.addParameter("qty", qty);
             sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
 
-            String customcheek = item.getStringValue("customcheek");
-            String customcolors = item.getStringValue("customcolors");
-            String custommaterial = item.getStringValue("custommaterial");
+            String cheek = content.getStringValue("cheek");
+            String colors = content.getStringValue("colors");
+            String material = content.getStringValue("material");
 
-            sqlFactory.addParameter("customcheek", customcheek.equals("0") ? "" : customcheek);
-            sqlFactory.addParameter("customcolors", customcolors.equals("0") ? "" : customcolors);
-            sqlFactory.addParameter("custommaterial", custommaterial.equals("0") ? "" : custommaterial);
+            sqlFactory.addParameter("cheek", cheek.equals("0") ? "" : cheek);
+            sqlFactory.addParameter("colors", colors.equals("0") ? "" : colors);
+            sqlFactory.addParameter("material", material.equals("0") ? "" : material);
             //System.out.println(sqlFactory.getSQL());
             sqlList.add(sqlFactory.getSQL());
         }