|
@@ -5,6 +5,7 @@ import (
|
|
|
"fmt"
|
|
|
"github.com/baiy/Cadmin-server-go/admin"
|
|
|
"math/rand"
|
|
|
+ qutil "qfw/util"
|
|
|
"time"
|
|
|
"util"
|
|
|
)
|
|
@@ -109,8 +110,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.Local(),
|
|
|
- "last_time": now.Local(),
|
|
|
+ "create_time": now.Format(qutil.Date_Full_Layout),
|
|
|
+ "last_time": now.Format(qutil.Date_Full_Layout),
|
|
|
"state": "1",
|
|
|
})
|
|
|
if id <= 0 {
|
|
@@ -129,7 +130,7 @@ func Delete(context *admin.Context) (interface{}, error) {
|
|
|
return nil, err
|
|
|
}
|
|
|
if param.Id != 0 {
|
|
|
- ok := util.JysqlDB.Update(TemplateManage, map[string]interface{}{"id": param.Id}, map[string]interface{}{"state": 0, "last_time": time.Now(), "last_people": context.User.Username})
|
|
|
+ ok := util.JysqlDB.Update(TemplateManage, map[string]interface{}{"id": param.Id}, map[string]interface{}{"state": 0, "last_time": time.Now().Format(qutil.Date_Full_Layout), "last_people": context.User.Username})
|
|
|
if !ok {
|
|
|
return nil, errors.New("删除模板信息失败")
|
|
|
}
|