- 将微信的备注改为店名相关的信息
This commit is contained in:
@@ -892,3 +892,26 @@ func PrintMsg(ctx *jxcontext.Context, vendorID int, id1, id2, msgTitle, msgConte
|
||||
}
|
||||
return handler.PrintMsg(ctx, id1, id2, msgTitle, msgContent)
|
||||
}
|
||||
|
||||
func UpdateAllWeiXinRemark(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
var weixinList []*legacymodel.WeiXins
|
||||
if err = dao.GetRows(dao.GetDB(), &weixinList, `
|
||||
SELECT *
|
||||
FROM weixins
|
||||
WHERE openid <> '' AND tel <> ''
|
||||
`); err == nil {
|
||||
rootTask := tasksch.NewParallelTask("刷新微信备注", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
weixins := batchItemList[0].(*legacymodel.WeiXins)
|
||||
err = jxutils.HandleUserWXRemark(dao.GetDB(), weixins.Tel)
|
||||
return nil, err
|
||||
}, weixinList)
|
||||
tasksch.ManageTask(rootTask).Run()
|
||||
if !isAsync {
|
||||
_, err = rootTask.GetResult(0)
|
||||
} else {
|
||||
hint = rootTask.ID
|
||||
}
|
||||
}
|
||||
return hint, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user