fix: delete ims user and voip auth

This commit is contained in:
zhangsz
2025-04-11 15:37:49 +08:00
parent 6375bb7d8b
commit cbdec51ba8
3 changed files with 15 additions and 12 deletions

View File

@@ -82,6 +82,10 @@ func (r *IMSUserRepository) SelectPage(query map[string]any) map[string]any {
conditions = append(conditions, "msisdn like concat(concat('%', ?), '%')")
params = append(params, strings.Trim(v.(string), " "))
}
if v, ok := query["tag"]; ok && v != "" {
conditions = append(conditions, "tag=?")
params = append(params, strings.Trim(v.(string), " "))
}
if v, ok := query["imsis"]; ok && v != "" {
placeholder := repo.KeyPlaceholderByQuery(len(v.([]any)))
conditions = append(conditions, fmt.Sprintf("imsi in (%s)", placeholder))
@@ -240,7 +244,7 @@ func (r *IMSUserRepository) Inserts(uArr []model.IMSUser) int64 {
// Delete 删除实体
func (r *IMSUserRepository) Delete(imsi, neId string) int64 {
tx := datasource.DefaultDB().Where("imsi = ? and ne_id = ?", imsi, neId).Delete(&IMSUserRepository{})
tx := datasource.DefaultDB().Where("imsi = ? and ne_id = ?", imsi, neId).Delete(&model.IMSUser{})
if err := tx.Error; err != nil {
logger.Errorf("Delete err => %v", err)
}