Skip to content

Commit

Permalink
feat:add 更新补充说明
Browse files Browse the repository at this point in the history
  • Loading branch information
mao888 committed Feb 14, 2023
1 parent 5f1091d commit 136c98d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion project/data-sync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,7 @@ func main() {
// Mongo/plat_console/artneeds.main_desc 数据迁移到 ARK cruiser_console/base_desc_template
//art_need.RunBaseDescTemplate()

//
// 美术需求主表-更新补充说明
// Mongo/plat_console/artneedlogs 数据迁移到 ARK cruiser_console/art_needs.extra_desc
//art_need.RunSupplyDesc()
}
6 changes: 3 additions & 3 deletions project/data-sync/mongo-to-mysql/art_need/supply_desc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ func RunSupplyDesc() {

// 2、从mysql查询数据
artNeeds := make([]*ArtNeed, 0)
err := db2.MySQLClientCruiser.Table("art_needs").Find(artNeeds).Error
err := db2.MySQLClientCruiser.Table("art_needs").Find(&artNeeds).Error
if err != nil {
fmt.Println("从mysql查询数据 错误:", err)
return
}
fmt.Println(artNeeds)
//fmt.Println(artNeeds)

// 3、将mongo数据装入切片
for _, need := range artNeeds {
Expand All @@ -40,7 +40,7 @@ func RunSupplyDesc() {
sort.Slice(mArtNeedLogs, func(i, j int) bool {
return mArtNeedLogs[i].UpdateTime.Unix() > mArtNeedLogs[j].UpdateTime.Unix() // 降序
})
//

for _, log := range mArtNeedLogs {
// SupplyDesc 补充说明 为空跳过
if log.SupplyDesc == constants.EmptyString {
Expand Down

0 comments on commit 136c98d

Please sign in to comment.