|
@@ -264,7 +264,7 @@ func (job *columnJob) ColumnCron(ctx context.Context) {
|
|
|
if len(dArr) > 100 {
|
|
|
total += len(dArr)
|
|
|
//g.DB().Model(job.tableName).Ctx(ctx).WhereIn("bid_id", bidIDs).Delete()
|
|
|
- if _, err = g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM %s_do ON CLUSTER cluster WHERE bid_id in ('%s')", job.tableName, strings.Join(bidIDs, `','`))); err == nil {
|
|
|
+ if _, err = g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM %s_do on CLUSTER default_cluster WHERE bid_id in ('%s')", job.tableName, strings.Join(bidIDs, `','`))); err == nil {
|
|
|
g.DB().Insert(ctx, job.tableName, dArr)
|
|
|
}
|
|
|
bidIDs, dArr = []string{}, []ColumnMsg{}
|
|
@@ -275,7 +275,7 @@ func (job *columnJob) ColumnCron(ctx context.Context) {
|
|
|
if len(dArr) > 0 {
|
|
|
total += len(dArr)
|
|
|
//g.DB().Model(job.tableName).Ctx(ctx).WhereIn("bid_id", bidIDs).Delete()
|
|
|
- if _, err = g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM %s_do ON CLUSTER cluster WHERE bid_id in ('%s')", job.tableName, strings.Join(bidIDs, `','`))); err == nil {
|
|
|
+ if _, err = g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM %s_do on CLUSTER default_cluster WHERE bid_id in ('%s')", job.tableName, strings.Join(bidIDs, `','`))); err == nil {
|
|
|
g.DB().Insert(ctx, job.tableName, dArr)
|
|
|
}
|
|
|
}
|
|
@@ -315,7 +315,7 @@ func SaveBidSign(ctx context.Context, arr []*BidSign) {
|
|
|
func DelBidSign(ctx context.Context, arr []string) {
|
|
|
//保存至数据库
|
|
|
//g.DB().Model("new_bid_sign").Ctx(ctx).WhereIn("bid_id", arr).Delete()
|
|
|
- if _, err := g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM new_bid_sign_do ON CLUSTER cluster WHERE bid_id in ('%s')", strings.Join(arr, `','`))); err != nil {
|
|
|
+ if _, err := g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM new_bid_sign_do on CLUSTER default_cluster WHERE bid_id in ('%s')", strings.Join(arr, `','`))); err != nil {
|
|
|
g.Log().Errorf(ctx, "DelBidSign err:%v\n", err.Error())
|
|
|
}
|
|
|
}
|
|
@@ -333,7 +333,7 @@ func RepeatIds(ctx context.Context) {
|
|
|
if len(repeatIds) == 100 || k == count {
|
|
|
g.Log().Infof(ctx, "删除重复id %v", repeatIds)
|
|
|
//g.DB().Delete(context.Background(), "new_bid_sign", "bid_id IN (?)", strings.Join(repeatIds, ","))
|
|
|
- if _, err = g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM new_bid_sign_do ON CLUSTER cluster WHERE bid_id in ('%s')", strings.Join(repeatIds, `','`))); err != nil {
|
|
|
+ if _, err = g.DB().Exec(ctx, fmt.Sprintf("DELETE FROM new_bid_sign_do on CLUSTER default_cluster WHERE bid_id in ('%s')", strings.Join(repeatIds, `','`))); err != nil {
|
|
|
g.Log().Errorf(ctx, "RepeatIds err:%v\n", err.Error())
|
|
|
}
|
|
|
repeatIds = []string{}
|