Przeglądaj źródła

游客信息统计

eganwu 1 rok temu
rodzic
commit
10315bfde8

+ 5 - 0
src/custom/restcontroller/R.java

@@ -6304,6 +6304,11 @@ public class R {
         }
     }
 
+    public static class ID20240510104102 {
+        public static class v1 {
+        }
+    }
+
 
 }
 

+ 9 - 5
src/custom/restcontroller/webmanage/saletool/custorder/DeliveryAddress.java

@@ -94,16 +94,20 @@ public class DeliveryAddress extends Controller {
     public String isdefault() throws YosException {
 
         Long contactsid = content.getLongValue("contactsid");
+        boolean isdefault = content.getBooleanValue("isdefault");
         UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sys_enterprise_contacts");
-        updateSQL.setSiteid(siteid);
-        updateSQL.setWhere("createuserid", userid);
-        updateSQL.setValue("isdefault", 0);
-        updateSQL.update();
+        if (isdefault) {
+            updateSQL.setSiteid(siteid);
+            updateSQL.setWhere("createuserid", userid);
+            updateSQL.setValue("isdefault", 0);
+            updateSQL.update();
+        }
+
 
         updateSQL = SQLFactory.createUpdateSQL(this, "sys_enterprise_contacts");
         updateSQL.setSiteid(siteid);
         updateSQL.setWhere("contactsid", contactsid);
-        updateSQL.setValue("isdefault", 1);
+        updateSQL.setValue("isdefault", isdefault);
         updateSQL.update();
 
         return getSucReturnObject().toString();

+ 36 - 0
src/custom/restcontroller/webmanage/users/visitors.java

@@ -0,0 +1,36 @@
+package restcontroller.webmanage.users;
+
+import com.alibaba.fastjson.JSONObject;
+import common.Controller;
+import common.YosException;
+import common.annotation.API;
+import common.data.Row;
+import common.data.Rows;
+import restcontroller.R;
+
+/**
+ * 营销宝,我的,游客
+ */
+public class visitors extends Controller {
+    /**
+     * 构造函数
+     *
+     * @param content
+     */
+    public visitors(JSONObject content) throws YosException {
+        super(content);
+    }
+
+    @API(title = "游客信息统计", apiversion = R.ID20240510104102.v1.class)
+    public String visitorsInfo() throws YosException {
+        Row row = new Row();
+        //统计我的访问店铺数量
+        Rows rows=dbConnect.runSqlQuery("SELECT count(*) count from sa_store_history WHERE userid="+userid+" and siteid='"+siteid+"'");
+        row.put("store_history",rows.get(0).getLong("count"));
+
+
+        return getSucReturnObject().setData(row).toString();
+    }
+
+
+}