feat(1.0): 调整关联小程序
This commit is contained in:
parent
110ecb2818
commit
0ffda3fb0b
@ -135,6 +135,22 @@ func (h *handler) RelApp() core.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
// 删除原来已经关联过的
|
||||
if _, err := h.writeDB.MiniProgram.WithContext(ctx.RequestContext()).
|
||||
Where(h.writeDB.MiniProgram.AdminID.Eq(int32(adminID))).
|
||||
Updates(map[string]interface{}{
|
||||
"admin_id": 0,
|
||||
"updated_user": ctx.SessionUserInfo().UserName,
|
||||
"updated_at": time.Now(),
|
||||
}); err != nil {
|
||||
ctx.AbortWithError(core.Error(
|
||||
http.StatusBadRequest,
|
||||
code.RelAppError,
|
||||
fmt.Sprintf("%s: %s", code.Text(code.RelAppError), err.Error())),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := h.writeDB.MiniProgram.WithContext(ctx.RequestContext()).
|
||||
Where(h.writeDB.MiniProgram.ID.In(ids...)).
|
||||
Updates(map[string]interface{}{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user