XMLWAN před 3 roky
rodič
revize
56bb6f6a4a

+ 12 - 0
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go Zobrazit soubor

@@ -37,6 +37,9 @@ func XcxApiControllersRegisterRouters() {
37 37
 
38 38
 	//获取患者的电子病历
39 39
 	beego.Router("/xcx/api/mobile/getpatientinfo", &XcxApiController{}, "Get:GetPatientInfo")
40
+
41
+	//获取机构名称
42
+	beego.Router("/xcx/api/mobile/getorginfo", &XcxApiController{}, "Get:GetOrgInfo")
40 43
 }
41 44
 
42 45
 type XcxApiController struct {
@@ -551,3 +554,12 @@ func (this *XcxApiController) GetPatientInfo() {
551 554
 		"patient": patient,
552 555
 	})
553 556
 }
557
+
558
+func (this *XcxApiController) GetOrgInfo() {
559
+	patient_id, _ := this.GetInt64("patient_id")
560
+	info, _ := service.GetXcxPatientInfo(patient_id)
561
+	orgInfo, _ := service.GetOrgInfo(info.UserOrgId)
562
+	this.ServeSuccessJSON(map[string]interface{}{
563
+		"orgInfo": orgInfo,
564
+	})
565
+}

+ 42 - 0
models/xcx_user_models.go Zobrazit soubor

@@ -204,3 +204,45 @@ type XcXDialysisOrder struct {
204 204
 func (XcXDialysisOrder) TableName() string {
205 205
 	return "xt_dialysis_order"
206 206
 }
207
+
208
+type XcxSgjUserOrg struct {
209
+	ID              int64   `gorm:"column:id" json:"id" form:"id"`
210
+	Creator         int64   `gorm:"column:creator" json:"creator" form:"creator"`
211
+	OrgName         string  `gorm:"column:org_name" json:"org_name" form:"org_name"`
212
+	OrgShortName    string  `gorm:"column:org_short_name" json:"org_short_name" form:"org_short_name"`
213
+	OrgLogo         string  `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
214
+	OrgIntroduction string  `gorm:"column:org_introduction" json:"org_introduction" form:"org_introduction"`
215
+	Illness         string  `gorm:"column:illness" json:"illness" form:"illness"`
216
+	Province        int64   `gorm:"column:province" json:"province" form:"province"`
217
+	City            int64   `gorm:"column:city" json:"city" form:"city"`
218
+	District        int64   `gorm:"column:district" json:"district" form:"district"`
219
+	Address         string  `gorm:"column:address" json:"address" form:"address"`
220
+	Longitude       string  `gorm:"column:longitude" json:"longitude" form:"longitude"`
221
+	Latitude        string  `gorm:"column:latitude" json:"latitude" form:"latitude"`
222
+	OrgType         int64   `gorm:"column:org_type" json:"org_type" form:"org_type"`
223
+	Comments        int64   `gorm:"column:comments" json:"comments" form:"comments"`
224
+	Evaluate        float64 `gorm:"column:evaluate" json:"evaluate" form:"evaluate"`
225
+	Gallery         string  `gorm:"column:gallery" json:"gallery" form:"gallery"`
226
+	BusinessWeek    string  `gorm:"column:business_week" json:"business_week" form:"business_week"`
227
+	BusinessTime    string  `gorm:"column:business_time" json:"business_time" form:"business_time"`
228
+	ContactName     string  `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
229
+	Telephone       string  `gorm:"column:telephone" json:"telephone" form:"telephone"`
230
+	Claim           int64   `gorm:"column:claim" json:"claim" form:"claim"`
231
+	OperatingState  int64   `gorm:"column:operating_state" json:"operating_state" form:"operating_state"`
232
+	Status          int64   `gorm:"column:status" json:"status" form:"status"`
233
+	Ctime           int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
234
+	Mtime           int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
235
+	Source          int64   `gorm:"column:source" json:"source" form:"source"`
236
+	Ttype           int64   `gorm:"column:ttype" json:"ttype" form:"ttype"`
237
+	Ttid            int64   `gorm:"column:ttid" json:"ttid" form:"ttid"`
238
+	Tuid            int64   `gorm:"column:tuid" json:"tuid" form:"tuid"`
239
+	Reason          string  `gorm:"column:reason" json:"reason" form:"reason"`
240
+	Level           int64   `gorm:"column:level" json:"level" form:"level"`
241
+	Website         string  `gorm:"column:website" json:"website" form:"website"`
242
+	Import          int64   `gorm:"column:import" json:"import" form:"import"`
243
+	Sortno          int64   `gorm:"column:sortno" json:"sortno" form:"sortno"`
244
+}
245
+
246
+func (XcxSgjUserOrg) TableName() string {
247
+	return "sgj_user_org"
248
+}

+ 6 - 0
service/xcx_mobile_api_service.go Zobrazit soubor

@@ -244,3 +244,9 @@ func GetXcxPatientInfo(patient_id int64) (models.XcxPatients, error) {
244 244
 	err := XTReadDB().Model(&patients).Where("id = ? and status = 1", patient_id).Find(&patients).Error
245 245
 	return patients, err
246 246
 }
247
+
248
+func GetOrgInfo(id int64) (models.XcxSgjUserOrg, error) {
249
+	org := models.XcxSgjUserOrg{}
250
+	err := XTReadDB().Model(&org).Where("id = ? and status= 1", id).Find(&org).Error
251
+	return org, err
252
+}