Bladeren bron

更新代码

XMLWAN 5 jaren geleden
bovenliggende
commit
ff3eba5031
3 gewijzigde bestanden met toevoegingen van 15 en 2 verwijderingen
  1. 1 1
      conf/app.conf
  2. 1 1
      controllers/mobile_api_controllers/admin_user_api_controller.go
  3. 13 0
      service/admin_service.go

+ 1 - 1
conf/app.conf Bestand weergeven

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3 3
 runmode = dev
4 4
 
5 5
 

+ 1 - 1
controllers/mobile_api_controllers/admin_user_api_controller.go Bestand weergeven

@@ -20,7 +20,7 @@ func (c *AdminUserApiController) GetAdminUserElectronicSignature() {
20 20
 	adminUserInfo := c.GetMobileAdminUserInfo()
21 21
 	//orgId, _ := service.GetCreatByOrgId(adminUserInfo.Org.Id)
22 22
 	id := adminUserInfo.AdminUser.Id
23
-	es, _ := service.GetAdminUserElectronicSignature(adminUserInfo.Org.Id, adminUserInfo.App.Id, id)
23
+	es, _ := service.GetAdminUserElectronicSignatureTwo(id)
24 24
 	if es != nil {
25 25
 		c.ServeSuccessJSON(map[string]interface{}{
26 26
 			"state":                1,

+ 13 - 0
service/admin_service.go Bestand weergeven

@@ -273,6 +273,19 @@ func GetPatientAgeDistribution() ([]*PatientAgeCountStruct, error) {
273 273
 	return counts, nil
274 274
 }
275 275
 
276
+func GetAdminUserElectronicSignatureTwo(userid int64) (*models.AdminUserElectronicSignature, error) {
277
+	var es models.AdminUserElectronicSignature
278
+	err := readUserDb.Model(&models.AdminUserElectronicSignature{}).Where("creator=? and status=1", userid).First(&es).Error
279
+
280
+	if err == gorm.ErrRecordNotFound {
281
+		return nil, nil
282
+	}
283
+	if err != nil {
284
+		return nil, err
285
+	}
286
+	return &es, nil
287
+}
288
+
276 289
 func GetAdminUserElectronicSignature(orgID int64, appID int64, userID int64) (*models.AdminUserElectronicSignature, error) {
277 290
 	var es models.AdminUserElectronicSignature
278 291
 	err := readUserDb.Model(&models.AdminUserElectronicSignature{}).Where("org_id=? and app_id=? and creator=? and status=1", orgID, appID, userID).First(&es).Error