eganwu 1 tahun lalu
induk
melakukan
e3a78aaf58

+ 18 - 13
src/custom/restcontroller/webmanage/saletool/fad/Fad.java

@@ -45,6 +45,11 @@ public class Fad extends Controller {
                 }
             }
         }
+        String offsaledate = content.getStringValue("offsaledate", true, "null");
+        boolean isstop = true;
+        if (offsaledate.equals("null")) {
+            isstop = false;
+        }
 
         if (sa_fadid <= 0) {
             sa_fadid = createTableID(sa_fad);
@@ -60,10 +65,10 @@ public class Fad extends Controller {
             sqlFactory.setValue("sequence", content.getLongValue("sequence"));
             sqlFactory.setValue("content", content.getStringValue("contentstr", true));
             sqlFactory.setValue("price", content.getBigDecimalValue("price"));
-            sqlFactory.setValue("offsaledate", content.getStringValue("offsaledate", true, "null"));
+            sqlFactory.setValue("offsaledate", offsaledate);
             sqlFactory.setValue("sa_fadclassids", sa_fadclassids);
             sqlFactory.setValue("classid", 1);
-            sqlFactory.setValue("isstop",  content.getBooleanValue("isstop"));
+            sqlFactory.setValue("isstop", isstop);
             sqlFactory.insert();
             content.put("sa_fadid", sa_fadid);
         } else {
@@ -79,9 +84,9 @@ public class Fad extends Controller {
             sqlFactory.setValue("sequence", content.getLongValue("sequence"));
             sqlFactory.setValue("content", content.getStringValue("contentstr", true));
             sqlFactory.setValue("price", content.getBigDecimalValue("price"));
-            sqlFactory.setValue("offsaledate", content.getStringValue("offsaledate", true, "null"));
+            sqlFactory.setValue("offsaledate", offsaledate);
             sqlFactory.setValue("sa_fadclassids", sa_fadclassids);
-            sqlFactory.setValue("isstop",  content.getBooleanValue("isstop"));
+            sqlFactory.setValue("isstop", isstop);
             sqlFactory.update();
         }
 
@@ -124,7 +129,7 @@ public class Fad extends Controller {
         return detail();
     }
 
-    @API(title = "单品详情", apiversion = R.ID20240418141002.v1.class,accesstoken = false)
+    @API(title = "单品详情", apiversion = R.ID20240418141002.v1.class, accesstoken = false)
     public String detail() throws YosException {
         Long sa_fadid = content.getLongValue("sa_fadid");
         String ownertable = sa_fad;
@@ -134,7 +139,7 @@ public class Fad extends Controller {
             siteid = fadrows.get(0).getString("siteid");
         }
 
-        dbConnect.runSqlUpdate("UPDATE sa_fad SET readcount=readcount+1 WHERE sa_fadid="+sa_fadid);
+        dbConnect.runSqlUpdate("UPDATE sa_fad SET readcount=readcount+1 WHERE sa_fadid=" + sa_fadid);
 
         QuerySQL querySQ = SQLFactory.createQuerySQL(this, sa_fad)
                 .setTableAlias("t1");
@@ -148,9 +153,9 @@ public class Fad extends Controller {
 
 
         Rows attRows = getAttachmentUrl(sa_fad, sa_fadid);
-        attRows.sortby("sequence","linksid");
+        attRows.sortby("sequence", "linksid");
         detailRow.put("attinfos", attRows);
-        detailRow.put("appleturl", userInfo.getWechatAppPage("marketingtool","FadUrl") + sa_fadid);
+        detailRow.put("appleturl", userInfo.getWechatAppPage("marketingtool", "FadUrl") + sa_fadid);
 
 
         QuerySQL attachmentQuery = SQLFactory.createQuerySQL(this, "sys_attachment_links").setTableAlias("t1");
@@ -298,10 +303,10 @@ public class Fad extends Controller {
 
 
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, sa_fad,
-                        "sa_fadid", "name", "isonsale", "model", "spec", "price", "sequence", "createby", "createdate", "onsaledate","isstop")
+                        "sa_fadid", "name", "isonsale", "model", "spec", "price", "sequence", "createby", "createdate", "onsaledate", "isstop")
                 .setTableAlias("t1");
         querySQL.setSiteid(siteid);
-        querySQL.setWhere("classid",1);
+        querySQL.setWhere("classid", 1);
         querySQL.setWhere(where.toString());
         querySQL.setOrderBy(pageSorting).setPage(pageSize, pageNumber);
         Rows rows = querySQL.query();
@@ -312,9 +317,9 @@ public class Fad extends Controller {
         RowsMap RowsMap = getAttachmentUrl(sa_fad, ids);
         for (Row row : rows) {
             Rows attRows = RowsMap.getOrDefault(row.getString("sa_fadid"), new Rows());
-            attRows.sortby("sequence","linksid");
+            attRows.sortby("sequence", "linksid");
             row.put("attinfos", attRows);
-            row.put("appleturl", userInfo.getWechatAppPage("marketingtool","FadUrl") + row.getString("sa_fadid"));
+            row.put("appleturl", userInfo.getWechatAppPage("marketingtool", "FadUrl") + row.getString("sa_fadid"));
             row.putIfAbsent("onsaledate", "");
         }
 
@@ -408,7 +413,7 @@ public class Fad extends Controller {
                 "sa_fad_linkid");
         querySQL.setWhere("t1.siteid", siteid);
         querySQL.setWhere(where.toString());
-        querySQL.setWhere("t3.sa_fadid",sa_fadid);
+        querySQL.setWhere("t3.sa_fadid", sa_fadid);
         querySQL.setOrderBy(pageSorting);
         querySQL.setPage(pageSize, pageNumber);
 

+ 1 - 0
src/custom/restcontroller/webmanage/saletool/phonebook/PhoneBook2.java

@@ -83,6 +83,7 @@ public class PhoneBook2 extends Controller {
                 where.append(" and (");
                 where.append("t1.name like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append("or t1.remarks like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.phonenumber like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
             if (whereObject.containsKey("groupname") && !"".equals(whereObject.getString("groupname"))) {

+ 7 - 0
src/custom/restcontroller/webmanage/saletool/phonebook/PhoneBookGroup2.java

@@ -73,6 +73,13 @@ public class PhoneBookGroup2 extends Controller {
         StringBuffer where = new StringBuffer(" 1=1 ");
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and (");
+                where.append("t1.groupname like'%").append(whereObject.getString("condition")).append("%' ");
+//                where.append("or t1.remarks like'%").append(whereObject.getString("condition")).append("%' ");
+//                where.append("or t1.phonenumber like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
             if (whereObject.containsKey("isenable") && !"".equals(whereObject.getString("isenable"))) {
                 where.append(" and (");
                 where.append("isenable=" + whereObject.getBoolean("isenable"));