fix
This commit is contained in:
@@ -54,9 +54,8 @@ func (l *SaveBaseMapLogic) SaveBaseMap(r *http.Request) (resp *basic.Response) {
|
||||
return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "param can`t be empty array")
|
||||
}
|
||||
updDataArr := make([]gmodel.FsProductTemplateBasemap, 0, len(postData))
|
||||
baseMapIds := make([]int64, 0, len(postData))
|
||||
for _, v := range postData {
|
||||
baseMapIds = append(baseMapIds, v.Id)
|
||||
val := v
|
||||
ctimeT, err := time.ParseInLocation("2006-01-02 15:04:05", v.Ctime, time.Local)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
@@ -64,14 +63,14 @@ func (l *SaveBaseMapLogic) SaveBaseMap(r *http.Request) (resp *basic.Response) {
|
||||
}
|
||||
ctime := ctimeT.Unix()
|
||||
updDataArr = append(updDataArr, gmodel.FsProductTemplateBasemap{
|
||||
Id: v.Id,
|
||||
Name: &v.Name,
|
||||
Url: &v.Url,
|
||||
Id: val.Id,
|
||||
Name: &val.Name,
|
||||
Url: &val.Url,
|
||||
Ctime: &ctime,
|
||||
})
|
||||
}
|
||||
//更新
|
||||
err = l.svcCtx.AllModels.FsProductTemplateBasemap.UpdateBaseMapWithTransaction(l.ctx, updDataArr, baseMapIds)
|
||||
err = l.svcCtx.AllModels.FsProductTemplateBasemap.UpdateBaseMapWithTransaction(l.ctx, updDataArr)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to update base map")
|
||||
|
||||
Reference in New Issue
Block a user