|
@@ -1283,8 +1283,8 @@ func DeleteDoctorAdvice(m *models.DoctorAdvice) (err error) {
|
1283
|
1283
|
|
1284
|
1284
|
return
|
1285
|
1285
|
}
|
1286
|
|
-func DeleteGroupAdvice(orgId int64, groupNo int64, admin_user_id int64) (err error) {
|
1287
|
|
- 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
|
|
1286
|
+func DeleteGroupAdvice(orgId int64, groupNo int64, admin_user_id int64, patient_id int64, advice_date int64) (err error) {
|
|
1287
|
+ err = writeDb.Model(&models.DoctorAdvice{}).Where("user_org_id = ? and groupno = ? and patient_id = ? and advice_date = ? and status=1", orgId, groupNo, patient_id, advice_date).Update(map[string]interface{}{"UpdatedTime": time.Now().Unix(), "Status": 0, "Modifier": admin_user_id}).Error
|
1288
|
1288
|
if err != nil {
|
1289
|
1289
|
return
|
1290
|
1290
|
}
|
|
@@ -1329,6 +1329,11 @@ func FindHisDoctorAdviceOne(orgID, patient_id int64) (advice models.HisDoctorAdv
|
1329
|
1329
|
return
|
1330
|
1330
|
}
|
1331
|
1331
|
|
|
1332
|
+func FindDoctorAdviceByGroupNoOne(orgID, groupNo int64, patient_id int64, advice_date int64) (advice models.DoctorAdvice, err error) {
|
|
1333
|
+ err = readDb.Model(&models.DoctorAdvice{}).Where("groupno = ? and user_org_id=? and status = 1 and patient_id = ? and advice_date = ?", groupNo, orgID, patient_id, advice_date).First(&advice).Error
|
|
1334
|
+ return
|
|
1335
|
+}
|
|
1336
|
+
|
1332
|
1337
|
func FindDoctorAdviceByGroupNo(orgID, groupNo int64) (advice models.DoctorAdvice, err error) {
|
1333
|
1338
|
err = readDb.Model(&models.DoctorAdvice{}).Where("groupno = ? and user_org_id=? and status = 1", groupNo, orgID).First(&advice).Error
|
1334
|
1339
|
return
|