Browse Source

收藏夹功能完善

eganwu 1 year ago
parent
commit
092369d9c7

+ 1 - 3
src/custom/restcontroller/sale/itemgroup/SQL/商品组明细查询.sql

@@ -2,8 +2,7 @@ select t2.itemno,
        t2.spec,
        t2.color,
        t3.material,
-       t2.cheek,
-       t5.iscollection
+       t2.cheek
 from sa_itemgroupmx t1
          inner join plm_item t2
                     on t1.itemid = t2.itemid and t1.siteid = t2.siteid and t2.isonsale = 1 and t2.status = '审核'
@@ -11,7 +10,6 @@ from sa_itemgroupmx t1
          left join (SELECT itemid, siteid, GROUP_CONCAT(tradefield) tradefield
                     FROM plm_item_tradefield
                     GROUP BY itemid, siteid) t4 on t4.itemid = t2.itemid and t4.siteid = t2.siteid
-         left join sa_favorites t5 on t5.itemid = t2.itemid and t5.siteid = t2.siteid
 where t1.siteid = $siteid$
   and t1.sa_itemgroupid = $sa_itemgroupid$
   and $where$

+ 3 - 1
src/custom/restcontroller/sale/itemgroup/SQL/查询商品列表.sql

@@ -21,10 +21,12 @@ SELECT t1.*,
         (SELECT (case
                     when t3.cansaleqty >= t1.stockstatus1 then '充足'
                     when t3.cansaleqty <= t1.stockstatus2 then '缺货'
-                    else '紧缺' end)) stockstatus
+                    else '紧缺' end)) stockstatus,
+    t5.iscollection
 FROM plm_item t1
          LEFT JOIN plm_unit t2 ON t2.unitid = t1.unitid AND t2.siteid = t1.siteid
           LEFT JOIN st_invbal_sale t3 ON t3.siteid = t1.siteid AND t3.itemid = t1.itemid
          LEFT JOIN plm_itemextend t8 ON t8.itemid= t1.itemid AND t8.siteid = t1.siteid
+        left join sa_favorites t5 on t5.itemid = t1.itemid and t5.siteid = t1.siteid and t5.sys_enterpriseid=$sys_enterpriseid$
 WHERE t1.siteid = $siteid$
   and t1.itemid in $itemids$

+ 3 - 1
src/custom/restcontroller/sale/itemgroup/SQL/查询商品详情.sql

@@ -21,10 +21,12 @@ SELECT t1.*,
         (SELECT (case
                     when t3.cansaleqty >= t1.stockstatus1 then '充足'
                     when t3.cansaleqty <= t1.stockstatus2 then '缺货'
-                    else '紧缺' end)) stockstatus
+                    else '紧缺' end)) stockstatus,
+    t5.iscollection
 FROM plm_item t1
          LEFT JOIN plm_unit t2 ON t2.unitid = t1.unitid AND t2.siteid = t1.siteid
           LEFT JOIN st_invbal_sale t3 ON t3.siteid = t1.siteid AND t3.itemid = t1.itemid
          LEFT JOIN plm_itemextend t8 ON t8.itemid= t1.itemid AND t8.siteid = t1.siteid
+         left join sa_favorites t5 on t5.itemid = t1.itemid and t5.siteid = t1.siteid and t5.sys_enterpriseid=$sys_enterpriseid$
 WHERE t1.siteid = $siteid$
   and t1.itemno = $itemno$

+ 2 - 0
src/custom/restcontroller/sale/itemgroup/itemgroup.java

@@ -242,6 +242,7 @@ public class itemgroup extends Controller {
         SQLFactory sqlFactory = new SQLFactory(this, "查询商品列表");
         sqlFactory.addParameter_in("itemids", ids);
         sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
         Rows itemrows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         for (Row row : itemrows) {
             ItemPrice itemPrice = ItemPrice.getItemPrice(this, sys_enterpriseid, row.getLong("itemid"));
@@ -936,6 +937,7 @@ public class itemgroup extends Controller {
         sqlFactory.addParameter_SQL("where", "t2.itemno='" + itemno + "' ");
         sqlFactory.addParameter("itemno", itemno);
         sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
         Rows itemrows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         for (Row row : itemrows) {
             ItemPrice itemPrice = ItemPrice.getItemPrice(this, sys_enterpriseid, row.getLong("itemid"));