作者 唐旭辉

bug 修复

@@ -2,7 +2,6 @@ package models @@ -2,7 +2,6 @@ package models
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 - "time"  
6 5
7 "github.com/astaxie/beego/orm" 6 "github.com/astaxie/beego/orm"
8 ) 7 )
@@ -22,8 +21,8 @@ type Chance struct { @@ -22,8 +21,8 @@ type Chance struct {
22 ZanTotal int `orm:"column(zan_total)" description:"点赞总数"` 21 ZanTotal int `orm:"column(zan_total)" description:"点赞总数"`
23 ReviewStatus int8 `orm:"column(review_status)" description:"审核状态 0:待处理 1:待审核 2:被退回 3:已通过 "` 22 ReviewStatus int8 `orm:"column(review_status)" description:"审核状态 0:待处理 1:待审核 2:被退回 3:已通过 "`
24 EnableStatus int8 `orm:"column(enable_status)" description:"有效状态 0:无效 1:有效 "` 23 EnableStatus int8 `orm:"column(enable_status)" description:"有效状态 0:无效 1:有效 "`
25 - UpdateAt time.Time `orm:"column(update_at);type(timestamp)" description:"更新时间"`  
26 - CreateAt time.Time `orm:"column(create_at);type(timestamp)" description:"创建时间"` 24 + UpdateAt string `orm:"column(update_at)" description:"更新时间"`
  25 + CreateAt string `orm:"column(create_at)" description:"创建时间"`
27 BasicScore float64 `orm:"column(basic_score);null;digits(4);decimals(1)" description:"基础评分"` 26 BasicScore float64 `orm:"column(basic_score);null;digits(4);decimals(1)" description:"基础评分"`
28 ExtraScore float64 `orm:"column(extra_score);null;digits(4);decimals(1)" description:"附加评分"` 27 ExtraScore float64 `orm:"column(extra_score);null;digits(4);decimals(1)" description:"附加评分"`
29 ValueScore float64 `orm:"column(value_score);null;digits(4);decimals(1)" description:"价值评分"` 28 ValueScore float64 `orm:"column(value_score);null;digits(4);decimals(1)" description:"价值评分"`
@@ -21,7 +21,7 @@ type SqlData struct { @@ -21,7 +21,7 @@ type SqlData struct {
21 AuditTemplateId int64 `orm:"column(audit_template_id)"` 21 AuditTemplateId int64 `orm:"column(audit_template_id)"`
22 ChanceTypeId int `orm:"column(chance_type_id)"` 22 ChanceTypeId int `orm:"column(chance_type_id)"`
23 PublishStatus int `orm:"column(publish_status)"` 23 PublishStatus int `orm:"column(publish_status)"`
24 - CreateAt time.Time `orm:"column(create_at);type(timestamp)"` 24 + CreateAt string `orm:"column(create_at)`
25 ReviewStatus int8 `orm:"column(review_status)"` 25 ReviewStatus int8 `orm:"column(review_status)"`
26 Status int8 `orm:"column(status)"` 26 Status int8 `orm:"column(status)"`
27 DiscoveryScore string `orm:"column(discovery_score)"` 27 DiscoveryScore string `orm:"column(discovery_score)"`
@@ -277,7 +277,6 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64 @@ -277,7 +277,6 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
277 return returnData, nil 277 return returnData, nil
278 } 278 }
279 for _, v := range data { 279 for _, v := range data {
280 - t := v.CreateAt.Unix()  
281 item := protocol.RspAuditList{ 280 item := protocol.RspAuditList{
282 Id: fmt.Sprint(v.Id), 281 Id: fmt.Sprint(v.Id),
283 Status: v.Status, 282 Status: v.Status,
@@ -290,12 +289,11 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64 @@ -290,12 +289,11 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
290 DiscoveryScore: v.DiscoveryScore, 289 DiscoveryScore: v.DiscoveryScore,
291 CommentTotal: v.CommentTotal, 290 CommentTotal: v.CommentTotal,
292 UserName: v.NickName, 291 UserName: v.NickName,
  292 + CreateTime: 0,
293 } 293 }
294 -  
295 - if t < 0 {  
296 - item.CreateTime = 0  
297 - } else {  
298 - item.CreateTime = t 294 + t, err := time.ParseInLocation("2006-01-02 15:04:05", v.CreateAt, time.Local)
  295 + if err == nil {
  296 + item.CreateTime = t.Unix()
299 } 297 }
300 if d, err := models.GetDepartmentById(v.DepartmentId); err == nil { 298 if d, err := models.GetDepartmentById(v.DepartmentId); err == nil {
301 item.Department = d.Name 299 item.Department = d.Name
@@ -350,8 +348,7 @@ func GetChanceDetail(chanceid int64, companyid int64) (ResponseChanceInfo, error @@ -350,8 +348,7 @@ func GetChanceDetail(chanceid int64, companyid int64) (ResponseChanceInfo, error
350 log.Error("机会的公司不匹配") 348 log.Error("机会的公司不匹配")
351 return returnData, protocol.NewErrWithMessage("1") 349 return returnData, protocol.NewErrWithMessage("1")
352 } 350 }
353 - returnData.CreateTime = chanceInfo.CreateAt.Format("2006-01-02 15:16:17")  
354 - 351 + returnData.CreateTime = chanceInfo.CreateAt
355 var ( 352 var (
356 chanceContent []protocol.InputElement 353 chanceContent []protocol.InputElement
357 ) 354 )
@@ -446,7 +443,7 @@ func AllowChanceEnableStatus(chanceid int64, companyid int64) error { @@ -446,7 +443,7 @@ func AllowChanceEnableStatus(chanceid int64, companyid int64) error {
446 return nil 443 return nil
447 } 444 }
448 chanceinfo.Status = models.ChanceStatusAllow 445 chanceinfo.Status = models.ChanceStatusAllow
449 - chanceinfo.UpdateAt = time.Now() 446 + chanceinfo.UpdateAt = time.Now().String()
450 err = models.UpdateChanceById(chanceinfo, []string{"Status", "UpdateAt"}) 447 err = models.UpdateChanceById(chanceinfo, []string{"Status", "UpdateAt"})
451 if err != nil { 448 if err != nil {
452 log.Error("更新机会数据失败:%s", err) 449 log.Error("更新机会数据失败:%s", err)
@@ -470,7 +467,7 @@ func ForbidChanceEnableStatus(chanceid int64, companyid int64) error { @@ -470,7 +467,7 @@ func ForbidChanceEnableStatus(chanceid int64, companyid int64) error {
470 return protocol.NewErrWithMessage("1") 467 return protocol.NewErrWithMessage("1")
471 } 468 }
472 chanceinfo.Status = models.ChanceStatusForbid 469 chanceinfo.Status = models.ChanceStatusForbid
473 - chanceinfo.UpdateAt = time.Now() 470 + chanceinfo.UpdateAt = time.Now().String()
474 err = models.UpdateChanceById(chanceinfo, []string{"Status", "UpdateAt"}) 471 err = models.UpdateChanceById(chanceinfo, []string{"Status", "UpdateAt"})
475 if err != nil { 472 if err != nil {
476 log.Error("更新机会数据失败:%s", err) 473 log.Error("更新机会数据失败:%s", err)