Roc 2 年之前
父节点
当前提交
6f0bf8c65d
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      utils/common.go

+ 10 - 1
utils/common.go

@@ -870,4 +870,13 @@ func GetLocalIP() (ip string, err error) {
 func GetRichText(content string) (contentSub string) {
 	contentSub = strings.Replace(content, "<p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;\">Powered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>", "", -1)
 	return
-}
+}
+
+// GetOrmInReplace 获取orm的in查询替换?的方法
+func GetOrmInReplace(num int) string {
+	template := make([]string, num)
+	for i := 0; i < num; i++ {
+		template[i] = "?"
+	}
+	return strings.Join(template, ",")
+}