|
@@ -2,9 +2,9 @@ package templateManage
|
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
+ "fmt"
|
|
|
"github.com/baiy/Cadmin-server-go/admin"
|
|
|
"math/rand"
|
|
|
- qutil "qfw/util"
|
|
|
"time"
|
|
|
"util"
|
|
|
)
|
|
@@ -89,7 +89,7 @@ func Add(context *admin.Context) (interface{}, error) {
|
|
|
return nil, errors.New("模板名称不可为空")
|
|
|
}
|
|
|
now := time.Now()
|
|
|
- id := util.JysqlDB.Insert("template_config", map[string]interface{}{
|
|
|
+ id := util.JysqlDB.Insert(TemplateManage, map[string]interface{}{
|
|
|
"template_name": param.TemplateName,
|
|
|
"news_type": param.NewsType,
|
|
|
"news_title": param.NewsTitle,
|
|
@@ -98,10 +98,10 @@ func Add(context *admin.Context) (interface{}, error) {
|
|
|
"android_link": param.AndroidLink,
|
|
|
"apple_link": param.AppleLink,
|
|
|
"wx_link": param.WxLink,
|
|
|
- "template_id": now.Unix() + qutil.Int64All(rand.Intn(100)),
|
|
|
+ "template_id": fmt.Sprint(now.Unix()) + fmt.Sprint(rand.Intn(100)),
|
|
|
"create_people": context.User.Username,
|
|
|
- "create_time": now.Unix(),
|
|
|
- "last_time": now.Unix(),
|
|
|
+ "create_time": now,
|
|
|
+ "last_time": now,
|
|
|
"state": "1",
|
|
|
})
|
|
|
if id <= 0 {
|