Browse Source

商品组商品重复添加

hu 1 week ago
parent
commit
eac41d0dde

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

@@ -22,4 +22,4 @@ where $where$
   and t1.siteid = $siteid$
   and ifnull(t1.isonsale, 0) = 1
   and ifnull(t1.sa_customschemeid,0)!=0 and $tablefilter$
-  and not exists(select 1 from sa_itemgroupmx t inner join sa_itemgroup t2 on t.sa_itemgroupid=t2.sa_itemgroupid and t.siteid=t2.siteid where t.siteid = $siteid$ and t.itemid = t1.itemid)
+  and if($itemgrouprepeat$,1=1,not exists(select 1 from sa_itemgroupmx t inner join sa_itemgroup t2 on t.sa_itemgroupid=t2.sa_itemgroupid and t.siteid=t2.siteid where t.siteid = $siteid$ and t.itemid = t1.itemid))

+ 6 - 0
src/custom/restcontroller/webmanage/sale/itemgroup/itemgroup.java

@@ -490,9 +490,15 @@ public class itemgroup extends Controller {
             where = where + " and  t1.sa_customschemeid ='" + sa_customschemeid + "'";
         }
 //		String hrid = content.getString("hrid");
+        boolean itemgrouprepeat =false;
+        Rows siteParameterRows =dbConnect.runSqlQuery("select itemgrouprepeat from sys_site_parameter where siteid='"+siteid+"'");
+        if(siteParameterRows.isNotEmpty()){
+            itemgrouprepeat=siteParameterRows.get(0).getBoolean("itemgrouprepeat");
+        }
         SQLFactory sqlFactory = new SQLFactory(this, "商品查询", pageSize, pageNumber, pageSorting);
         sqlFactory.addParameter_SQL("where", where);
         sqlFactory.addParameter("sa_itemgroupid", sa_itemgroupid);
+        sqlFactory.addParameter("itemgrouprepeat", itemgrouprepeat);
         sqlFactory.addParameter("siteid", siteid);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL(false));