浏览代码

获取当地时间

renjiaojiao 3 年之前
父节点
当前提交
31c549baa4
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      src/templateManage/jyTemplateManageController.go
  2. 1 1
      src/templateManage/jyTemplateManageService.go

+ 2 - 2
src/templateManage/jyTemplateManageController.go

@@ -109,8 +109,8 @@ func Add(context *admin.Context) (interface{}, error) {
 		"template_id":   fmt.Sprint(now.Unix()) + fmt.Sprint(rand.Intn(100)),
 		"create_people": context.User.Username,
 		"last_people":   context.User.Username,
-		"create_time":   now.Location(),
-		"last_time":     now.Location(),
+		"create_time":   now.Local(),
+		"last_time":     now.Local(),
 		"state":         "1",
 	})
 	if id <= 0 {

+ 1 - 1
src/templateManage/jyTemplateManageService.go

@@ -17,7 +17,7 @@ func FindOneTemplate(id int) (res map[string]interface{}) {
 }
 
 func UpdateSceneOne(id int, newsContent, newsTitle, newsType, pcLink, templateName, wxLink, androidLink, appleLink, username string) bool {
-	ok := util.JysqlDB.Update(TemplateManage, map[string]interface{}{"id": id}, map[string]interface{}{"news_content": newsContent, "news_title": newsTitle, "news_type": newsType, "pc_link": pcLink, "template_name": templateName, "wx_link": wxLink, "android_link": androidLink, "apple_link": appleLink, "last_time": time.Now().Location(), "last_people": username})
+	ok := util.JysqlDB.Update(TemplateManage, map[string]interface{}{"id": id}, map[string]interface{}{"news_content": newsContent, "news_title": newsTitle, "news_type": newsType, "pc_link": pcLink, "template_name": templateName, "wx_link": wxLink, "android_link": androidLink, "apple_link": appleLink, "last_time": time.Now().Local(), "last_people": username})
 	if !ok {
 		return false
 	}