|
@@ -666,7 +666,7 @@ func DeleteDoctorAdvice(m *models.DoctorAdvice) (err error) {
|
666
|
666
|
return
|
667
|
667
|
}
|
668
|
668
|
func DeleteGroupAdvice(orgId int64, groupNo int64, admin_user_id int64) (err error) {
|
669
|
|
- err = writeDb.Model(&models.DoctorAdvice{}).Where("user_org_id=? and groupno=?", orgId, groupNo).Update(map[string]interface{}{"UpdatedTime": time.Now().Unix(), "Status": 0, "Modifier": admin_user_id}).Error
|
|
669
|
+ err = writeDb.Model(&models.DoctorAdvice{}).Where("user_org_id = ? and groupno = ?", orgId, groupNo).Update(map[string]interface{}{"UpdatedTime": time.Now().Unix(), "Status": 0, "Modifier": admin_user_id}).Error
|
670
|
670
|
if err != nil {
|
671
|
671
|
return
|
672
|
672
|
}
|
|
@@ -996,14 +996,14 @@ func FindDoctorAdviceByIds(orgID int64, ids []string) (advice []models.DoctorAdv
|
996
|
996
|
return
|
997
|
997
|
}
|
998
|
998
|
|
999
|
|
-func BatchDeleteDoctorAdvice(ids []string) (err error) {
|
|
999
|
+func BatchDeleteDoctorAdvice(ids []string, user_id int64) (err error) {
|
1000
|
1000
|
ut := writeDb.Begin()
|
1001
|
|
- err = ut.Model(&models.DoctorAdvice{}).Where("status = 1 AND id IN (?)", ids).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()}).Error
|
|
1001
|
+ err = ut.Model(&models.DoctorAdvice{}).Where("status = 1 AND id IN (?)", ids).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix(), "modifier": user_id}).Error
|
1002
|
1002
|
if err != nil {
|
1003
|
1003
|
ut.Rollback()
|
1004
|
1004
|
return
|
1005
|
1005
|
}
|
1006
|
|
- err = ut.Model(&models.DoctorAdvice{}).Where("status = 1 AND parent_id IN (?)", ids).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()}).Error
|
|
1006
|
+ err = ut.Model(&models.DoctorAdvice{}).Where("status = 1 AND parent_id IN (?)", ids).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix(), "modifier": user_id}).Error
|
1007
|
1007
|
if err != nil {
|
1008
|
1008
|
ut.Rollback()
|
1009
|
1009
|
return
|