|
@@ -152,6 +152,10 @@ func siteRouters() {
|
152
|
152
|
beego.Router("/api/site/updatelinkaddress",&Microwebsite{},"Post:UpdateLinkAddress")
|
153
|
153
|
beego.Router("/api/site/addmaclinkaddress",&Microwebsite{},"Post:AddMacLinkAddress")
|
154
|
154
|
beego.Router("/api/site/getlinkaddress",&Microwebsite{},"Get:GetLinkAddress")
|
|
155
|
+ beego.Router("/api/site/getcountimages",&Microwebsite{},"Get:GetCountImages")
|
|
156
|
+ beego.Router("/api/site/addNavigationlinkform",&Microwebsite{},"Post:AddNavigationLinkform")
|
|
157
|
+ beego.Router("api/site/getnavigationlinkaddress",&Microwebsite{},"Get:GetNavigationlinkaddress")
|
|
158
|
+ beego.Router("/api/site/updateditnavigationlinkform",&Microwebsite{},"Post:UpdateditnavigationLink")
|
155
|
159
|
}
|
156
|
160
|
|
157
|
161
|
type Microwebsite struct {
|
|
@@ -568,6 +572,7 @@ func (this *Microwebsite) AddKeEnvironment() {
|
568
|
572
|
id := int64(idsInter.(float64))
|
569
|
573
|
ids = append(ids, id)
|
570
|
574
|
}
|
|
575
|
+ fmt.Println("ids是什么",ids)
|
571
|
576
|
model := models.SgjPatientModel{
|
572
|
577
|
Title: title,
|
573
|
578
|
Sort: sort,
|
|
@@ -1398,6 +1403,12 @@ func (this *Microwebsite) Deletemodlebyid() {
|
1398
|
1403
|
err := site_service.DeletemodleById(id, userOrgID)
|
1399
|
1404
|
modelid := site_service.DeleteHospitalByModelid(id, userOrgID)
|
1400
|
1405
|
byModelid := site_service.DeleteOfficeByModelid(id, userOrgID)
|
|
1406
|
+ linkByModelid := site_service.DeleteEditPicLinkByModelid(id, userOrgID)
|
|
1407
|
+ enviroments := site_service.DeleteEnviroments(id, userOrgID)
|
|
1408
|
+ conrotation := site_service.DeleteConrotation(id, userOrgID)
|
|
1409
|
+ fmt.Println("linkByModelid",linkByModelid)
|
|
1410
|
+ fmt.Println("enviroments",enviroments)
|
|
1411
|
+ fmt.Println("enviroments",conrotation)
|
1401
|
1412
|
fmt.Println(modelid,byModelid)
|
1402
|
1413
|
if err !=nil{
|
1403
|
1414
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除成功")
|
|
@@ -1767,6 +1778,8 @@ func (this *Microwebsite) AddImages() {
|
1767
|
1778
|
UserOrgId: userOrgID,
|
1768
|
1779
|
Ctime: time.Now().Unix(),
|
1769
|
1780
|
Status: 1,
|
|
1781
|
+ Imgshow:1,
|
|
1782
|
+
|
1770
|
1783
|
}
|
1771
|
1784
|
err = site_service.AddImages(&patientEnviroimages)
|
1772
|
1785
|
if err !=nil{
|
|
@@ -1941,6 +1954,8 @@ func (this *Microwebsite) AddNavigation() {
|
1941
|
1954
|
adminUserInfo := this.GetAdminUserInfo()
|
1942
|
1955
|
userOrgID := int64(adminUserInfo.CurrentOrgId)
|
1943
|
1956
|
fmt.Println("机构ID",userOrgID)
|
|
1957
|
+ linkid, _ := this.GetInt64("id")
|
|
1958
|
+ fmt.Println("linkid",linkid)
|
1944
|
1959
|
dataBody := make(map[string]interface{}, 0)
|
1945
|
1960
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
1946
|
1961
|
if err != nil {
|
|
@@ -1979,6 +1994,7 @@ func (this *Microwebsite) AddNavigation() {
|
1979
|
1994
|
UserOrgId:userOrgID,
|
1980
|
1995
|
Status: 1,
|
1981
|
1996
|
Ctime:time.Now().Unix(),
|
|
1997
|
+ Linkid:linkid,
|
1982
|
1998
|
}
|
1983
|
1999
|
err = site_service.AddNavigation(&navigation)
|
1984
|
2000
|
if err !=nil{
|
|
@@ -2097,7 +2113,9 @@ func (this *Microwebsite) DeleteModle() {
|
2097
|
2113
|
errtw := site_service.DeleteModleByModeID(userOrgID, id)
|
2098
|
2114
|
way := site_service.DeleteRideWay(userOrgID, id)
|
2099
|
2115
|
workTime := site_service.DeleteWorkTime(userOrgID, id)
|
|
2116
|
+ conrotation := site_service.DeleteConrotation(id, userOrgID)
|
2100
|
2117
|
fmt.Println("错误是什么",errtw,way,workTime)
|
|
2118
|
+ fmt.Println(conrotation)
|
2101
|
2119
|
if err !=nil{
|
2102
|
2120
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除成功")
|
2103
|
2121
|
return
|
|
@@ -2171,6 +2189,8 @@ func (this *Microwebsite) AddRotationpic() {
|
2171
|
2189
|
patientConrotation, err := site_service.GetPatientConrotationLast(userOrgID)
|
2172
|
2190
|
fmt.Println("patientConrotation是设么",patientConrotation.ID)
|
2173
|
2191
|
fmt.Println("err是什么",err)
|
|
2192
|
+ conrotations, total, err := site_service.GetTotalCount(userOrgID)
|
|
2193
|
+ fmt.Println("conrotations",conrotations)
|
2174
|
2194
|
conlinkaddress := models.SgjPatientConlinkaddress{
|
2175
|
2195
|
ConId:patientConrotation.ID,
|
2176
|
2196
|
}
|
|
@@ -2181,6 +2201,7 @@ func (this *Microwebsite) AddRotationpic() {
|
2181
|
2201
|
return
|
2182
|
2202
|
}
|
2183
|
2203
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
2204
|
+ "total":total,
|
2184
|
2205
|
"conrotation":conrotation,
|
2185
|
2206
|
})
|
2186
|
2207
|
}
|
|
@@ -2329,12 +2350,15 @@ func (this *Microwebsite) AddImageslink() {
|
2329
|
2350
|
}
|
2330
|
2351
|
|
2331
|
2352
|
err = site_service.AddImageslink(&editpiclink)
|
|
2353
|
+ edipiclink, total, err := site_service.GetCountImages(userOrgID)
|
|
2354
|
+ fmt.Println(edipiclink)
|
2332
|
2355
|
if err !=nil{
|
2333
|
2356
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
2334
|
2357
|
return
|
2335
|
2358
|
}
|
2336
|
2359
|
this.ServeSuccessJSON(map[string]interface{}{
|
2337
|
2360
|
"editpiclink":editpiclink,
|
|
2361
|
+ "total":total,
|
2338
|
2362
|
})
|
2339
|
2363
|
}
|
2340
|
2364
|
|
|
@@ -2520,6 +2544,15 @@ func (this *Microwebsite) DeleteRotations(){
|
2520
|
2544
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除图片失败")
|
2521
|
2545
|
return
|
2522
|
2546
|
}
|
|
2547
|
+ edipiclink, total, err := site_service.GetCountImages(userOrgID)
|
|
2548
|
+ fmt.Println("edipiclink",edipiclink)
|
|
2549
|
+ if err !=nil{
|
|
2550
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2551
|
+ return
|
|
2552
|
+ }
|
|
2553
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2554
|
+ "total":total,
|
|
2555
|
+ })
|
2523
|
2556
|
returnData := make(map[string]interface{}, 0)
|
2524
|
2557
|
returnData["msg"] = "ok"
|
2525
|
2558
|
this.ServeSuccessJSON(returnData)
|
|
@@ -2738,6 +2771,15 @@ func (this *Microwebsite) DeleteImages() {
|
2738
|
2771
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
2739
|
2772
|
return
|
2740
|
2773
|
}
|
|
2774
|
+ conrotation, total, err := site_service.GetTotalCount(userOrgID)
|
|
2775
|
+ fmt.Println("conrotation",conrotation)
|
|
2776
|
+ if err !=nil{
|
|
2777
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
2778
|
+ return
|
|
2779
|
+ }
|
|
2780
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2781
|
+ "total":total,
|
|
2782
|
+ })
|
2741
|
2783
|
returnData := make(map[string]interface{}, 0)
|
2742
|
2784
|
returnData["msg"] = "ok"
|
2743
|
2785
|
this.ServeSuccessJSON(returnData)
|
|
@@ -2755,6 +2797,15 @@ func (this *Microwebsite) DeleteSingleImages() {
|
2755
|
2797
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
2756
|
2798
|
return
|
2757
|
2799
|
}
|
|
2800
|
+ edipiclink, total, err := site_service.GetCountImages(userOrgID)
|
|
2801
|
+ fmt.Println(edipiclink)
|
|
2802
|
+ if err !=nil{
|
|
2803
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
2804
|
+ return
|
|
2805
|
+ }
|
|
2806
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2807
|
+ "total":total,
|
|
2808
|
+ })
|
2758
|
2809
|
returnData := make(map[string]interface{}, 0)
|
2759
|
2810
|
returnData["msg"] = "ok"
|
2760
|
2811
|
this.ServeSuccessJSON(returnData)
|
|
@@ -2962,6 +3013,8 @@ func (this *Microwebsite) SaveEditpic() {
|
2962
|
3013
|
fmt.Println("图片链接",piclink)
|
2963
|
3014
|
linkaddress := dataBody["linkaddress"].(string)
|
2964
|
3015
|
fmt.Println("链接地址",linkaddress)
|
|
3016
|
+ modeid := int64(dataBody["modeid"].(float64))
|
|
3017
|
+ fmt.Println("天梦中",modeid)
|
2965
|
3018
|
conrotation := models.SgjPatientConrotation{
|
2966
|
3019
|
Images: images,
|
2967
|
3020
|
Sort: sort,
|
|
@@ -2974,8 +3027,12 @@ func (this *Microwebsite) SaveEditpic() {
|
2974
|
3027
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
2975
|
3028
|
return
|
2976
|
3029
|
}
|
|
3030
|
+ conrotations, err := site_service.QueryConRotation(modeid, userOrgID)
|
|
3031
|
+ fmt.Println("错误小小马",err)
|
|
3032
|
+ fmt.Println(conrotations)
|
2977
|
3033
|
this.ServeSuccessJSON(map[string]interface{}{
|
2978
|
3034
|
"conrotation":conrotation,
|
|
3035
|
+ "conrotations":conrotations,
|
2979
|
3036
|
})
|
2980
|
3037
|
}
|
2981
|
3038
|
|
|
@@ -3003,14 +3060,16 @@ func (this *Microwebsite) AddEditpic() {
|
3003
|
3060
|
linkaddress := dataBody["linkaddress"].(string)
|
3004
|
3061
|
fmt.Println("链接地址",linkaddress)
|
3005
|
3062
|
id, _ := this.GetInt64("id")
|
|
3063
|
+ fmt.Println("下孟子id",id)
|
3006
|
3064
|
oldrotation, err := site_service.QueryOldrotion(id, userOrgID)
|
|
3065
|
+ fmt.Println("oldrotation",oldrotation)
|
3007
|
3066
|
conrotation := models.SgjPatientConrotation{
|
3008
|
3067
|
Images: images,
|
3009
|
3068
|
Sort: sort,
|
3010
|
3069
|
Piclink: piclink,
|
3011
|
3070
|
Linkaddress: linkaddress,
|
3012
|
3071
|
Status: 1,
|
3013
|
|
- Modeid: oldrotation.ModeId,
|
|
3072
|
+ Modeid: id,
|
3014
|
3073
|
UserOrgId: userOrgID,
|
3015
|
3074
|
Ctime:time.Now().Unix(),
|
3016
|
3075
|
ImgShow:1,
|
|
@@ -3020,8 +3079,12 @@ func (this *Microwebsite) AddEditpic() {
|
3020
|
3079
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
3021
|
3080
|
return
|
3022
|
3081
|
}
|
|
3082
|
+ conrotations, erros := site_service.QueryConRotation(id, userOrgID)
|
|
3083
|
+ fmt.Println("门前错误",erros)
|
|
3084
|
+ fmt.Println("conrotations是什么",conrotations)
|
3023
|
3085
|
this.ServeSuccessJSON(map[string]interface{}{
|
3024
|
3086
|
"conrotation":conrotation,
|
|
3087
|
+ "conrotations":conrotations,
|
3025
|
3088
|
})
|
3026
|
3089
|
}
|
3027
|
3090
|
|
|
@@ -3053,13 +3116,14 @@ func (this *Microwebsite) AddEdialogVisible() {
|
3053
|
3116
|
}
|
3054
|
3117
|
err = site_service.UpdateConrotaionById(id, userOrgID,oldrotation)
|
3055
|
3118
|
fmt.Println(err)
|
3056
|
|
- patientOldrotation, err:= site_service.QueryOldrotion(id, userOrgID)
|
|
3119
|
+ fmt.Println("马文强错错误是什么",err)
|
3057
|
3120
|
ordmodel := models.SgjPatientOrdmodel{
|
3058
|
3121
|
Title: title,
|
3059
|
3122
|
Sort: sort,
|
3060
|
3123
|
}
|
3061
|
|
- err = site_service.UpdateOrdeModel(patientOldrotation.ModeId, userOrgID, ordmodel)
|
3062
|
|
- if err !=nil{
|
|
3124
|
+ err = site_service.UpdateOrdeModel(id, userOrgID, ordmodel)
|
|
3125
|
+
|
|
3126
|
+ if err !=nil{
|
3063
|
3127
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
3064
|
3128
|
return
|
3065
|
3129
|
}
|
|
@@ -3081,13 +3145,17 @@ func (this *Microwebsite) GetEditRotationimages() {
|
3081
|
3145
|
editpiclink, err := site_service.QueryEditpiclink(id, userOrgID)
|
3082
|
3146
|
fmt.Println("错误是多少",err)
|
3083
|
3147
|
fmt.Println("返回数据",editpiclink)
|
|
3148
|
+ editpiclinks, total, err := site_service.QueryEditpiclinkCount(id, userOrgID)
|
|
3149
|
+ fmt.Println(editpiclinks)
|
3084
|
3150
|
if err !=nil{
|
3085
|
3151
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
3086
|
3152
|
return
|
3087
|
3153
|
}
|
|
3154
|
+
|
3088
|
3155
|
this.ServeSuccessJSON(map[string]interface{}{
|
3089
|
3156
|
"patientEditpiclink":patientEditpiclink,
|
3090
|
3157
|
"editpiclink":editpiclink,
|
|
3158
|
+ "total":total,
|
3091
|
3159
|
})
|
3092
|
3160
|
|
3093
|
3161
|
}
|
|
@@ -3136,6 +3204,8 @@ func (this *Microwebsite) UpdateSingleForm() {
|
3136
|
3204
|
fmt.Println("图片链接",piclink)
|
3137
|
3205
|
linkaddress := dataBody["linkaddress"].(string)
|
3138
|
3206
|
fmt.Println("链接地址",linkaddress)
|
|
3207
|
+ modelid := int64(dataBody["modeid"].(float64))
|
|
3208
|
+
|
3139
|
3209
|
editpiclink := models.SgjPatientEditpiclink{
|
3140
|
3210
|
Images: images,
|
3141
|
3211
|
Sort: sort,
|
|
@@ -3144,7 +3214,7 @@ func (this *Microwebsite) UpdateSingleForm() {
|
3144
|
3214
|
}
|
3145
|
3215
|
err = site_service.UpdateEditPatPicLink(id, userOrgID, editpiclink)
|
3146
|
3216
|
fmt.Println("第一个错误是设么",err)
|
3147
|
|
- patientEditpiclink, err := site_service.GetQueryEditpiclink(id, userOrgID)
|
|
3217
|
+ patientEditpiclink, err := site_service.GetQueryEditpiclink(modelid, userOrgID)
|
3148
|
3218
|
fmt.Println("错误是多",err)
|
3149
|
3219
|
fmt.Println("pateientEditpiclink是多少",patientEditpiclink)
|
3150
|
3220
|
if err !=nil{
|
|
@@ -3194,12 +3264,15 @@ func (this *Microwebsite) AddEditPicForm() {
|
3194
|
3264
|
ImgShow:1,
|
3195
|
3265
|
}
|
3196
|
3266
|
err = site_service.AddImageslink(&editpiclink)
|
|
3267
|
+ edipiclink, total, err := site_service.GetCountPicImages(userOrgID, patientRotation.ModelId)
|
|
3268
|
+ fmt.Println(edipiclink)
|
3197
|
3269
|
if err !=nil{
|
3198
|
3270
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
3199
|
3271
|
return
|
3200
|
3272
|
}
|
3201
|
3273
|
this.ServeSuccessJSON(map[string]interface{}{
|
3202
|
3274
|
"editpiclink":editpiclink,
|
|
3275
|
+ "total":total,
|
3203
|
3276
|
})
|
3204
|
3277
|
}
|
3205
|
3278
|
|
|
@@ -3644,11 +3717,14 @@ func (this *Microwebsite) AddOfficeTwo() {
|
3644
|
3717
|
}
|
3645
|
3718
|
sort:= int64(dataBody["sort"].(float64))
|
3646
|
3719
|
fmt.Println("排序",sort)
|
|
3720
|
+ modelid := int64(dataBody["modelid"].(float64))
|
|
3721
|
+ fmt.Println("小泽",modelid)
|
3647
|
3722
|
enviroimages := models.SgjPatientEnviroimages{
|
3648
|
3723
|
Enviroimages: officeImages,
|
3649
|
3724
|
Sort: sort,
|
3650
|
3725
|
}
|
3651
|
3726
|
err = site_service.UpdateOfficeTwo(userOrgID, id, enviroimages)
|
|
3727
|
+ patientEnviroimages, err := site_service.GetQueryEnviroimage(userOrgID, modelid)
|
3652
|
3728
|
fmt.Println("错误是什么",err)
|
3653
|
3729
|
if err !=nil{
|
3654
|
3730
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
@@ -3656,6 +3732,7 @@ func (this *Microwebsite) AddOfficeTwo() {
|
3656
|
3732
|
}
|
3657
|
3733
|
this.ServeSuccessJSON(map[string]interface{}{
|
3658
|
3734
|
"enviroimages":enviroimages,
|
|
3735
|
+ "patientEnviroimages":patientEnviroimages,
|
3659
|
3736
|
})
|
3660
|
3737
|
}
|
3661
|
3738
|
|
|
@@ -4527,3 +4604,140 @@ func (this*Microwebsite) GetLinkAddress() {
|
4527
|
4604
|
"linkaddress":linkaddress,
|
4528
|
4605
|
})
|
4529
|
4606
|
}
|
|
4607
|
+
|
|
4608
|
+func (this*Microwebsite) GetCountImages() {
|
|
4609
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
4610
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
4611
|
+ fmt.Println("机构id", userOrgID)
|
|
4612
|
+ edipiclink, total, err := site_service.GetCountImages(userOrgID)
|
|
4613
|
+ fmt.Println(edipiclink)
|
|
4614
|
+ fmt.Println("total是什么",total)
|
|
4615
|
+ fmt.Println("err是什么",err)
|
|
4616
|
+}
|
|
4617
|
+
|
|
4618
|
+func (this*Microwebsite) AddNavigationLinkform() {
|
|
4619
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
4620
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
4621
|
+ fmt.Println("机构id", userOrgID)
|
|
4622
|
+ dataBody := make(map[string]interface{}, 0)
|
|
4623
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
4624
|
+ if err != nil {
|
|
4625
|
+ utils.ErrorLog(err.Error())
|
|
4626
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
4627
|
+ return
|
|
4628
|
+ }
|
|
4629
|
+ linktype := int64(dataBody["linktype"].(float64))
|
|
4630
|
+ fmt.Println("链接类型",linktype)
|
|
4631
|
+ linktypetwo := int64(dataBody["linktypetwo"].(float64))
|
|
4632
|
+ fmt.Println("链接类型2",linktypetwo)
|
|
4633
|
+ articetype := int64(dataBody["articetype"].(float64))
|
|
4634
|
+ fmt.Println("文章分类",articetype)
|
|
4635
|
+ title := int64(dataBody["title"].(float64))
|
|
4636
|
+ fmt.Println("文章标题",title)
|
|
4637
|
+ phone := dataBody["phone"].(string)
|
|
4638
|
+ fmt.Println("电话号码",phone)
|
|
4639
|
+ outstation := dataBody["outstation"].(string)
|
|
4640
|
+ fmt.Println("站外链接",outstation)
|
|
4641
|
+ linkaddress := dataBody["linkaddress"].(string)
|
|
4642
|
+ fmt.Println("链接地址",linkaddress)
|
|
4643
|
+ if(phone != ""){
|
|
4644
|
+ linkaddress = phone
|
|
4645
|
+ }
|
|
4646
|
+ if(outstation != ""){
|
|
4647
|
+ linkaddress = outstation
|
|
4648
|
+ }
|
|
4649
|
+ navgationlink := models.SgjPatientNavgationlink{
|
|
4650
|
+ Linktype: linktype,
|
|
4651
|
+ Linktypetwo: linktypetwo,
|
|
4652
|
+ Articetype: articetype,
|
|
4653
|
+ Title: title,
|
|
4654
|
+ Phone: phone,
|
|
4655
|
+ Outstation: outstation,
|
|
4656
|
+ Status: 1,
|
|
4657
|
+ Ctime: time.Now().Unix(),
|
|
4658
|
+ UserOrgId: userOrgID,
|
|
4659
|
+ Linkaddress:linkaddress,
|
|
4660
|
+ }
|
|
4661
|
+ addNavgationlink := site_service.AddNavgationlink(&navgationlink)
|
|
4662
|
+ patientNavgationlink, err:= site_service.GetNavgationlinkLastData(userOrgID)
|
|
4663
|
+ fmt.Println("错误",err)
|
|
4664
|
+ fmt.Println("patientNavgationlink",patientNavgationlink)
|
|
4665
|
+ if err !=nil{
|
|
4666
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
4667
|
+ return
|
|
4668
|
+ }
|
|
4669
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
4670
|
+ "addNavgationlink":addNavgationlink,
|
|
4671
|
+ "patientNavgationlink":patientNavgationlink,
|
|
4672
|
+ })
|
|
4673
|
+}
|
|
4674
|
+
|
|
4675
|
+func (this*Microwebsite) GetNavigationlinkaddress() {
|
|
4676
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
4677
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
4678
|
+ fmt.Println("机构id", userOrgID)
|
|
4679
|
+ id,_ := this.GetInt64("id")
|
|
4680
|
+ fmt.Println("id是什么",id)
|
|
4681
|
+ navgationlink, err := site_service.GetNavgationlinkAddressBylinkId(userOrgID, id)
|
|
4682
|
+ fmt.Println("大错误",err)
|
|
4683
|
+ fmt.Println(navgationlink)
|
|
4684
|
+ if err !=nil{
|
|
4685
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
4686
|
+ return
|
|
4687
|
+ }
|
|
4688
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
4689
|
+ "navgationlink":navgationlink,
|
|
4690
|
+ })
|
|
4691
|
+}
|
|
4692
|
+
|
|
4693
|
+func (this*Microwebsite) UpdateditnavigationLink() {
|
|
4694
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
4695
|
+ userOrgID := adminUserInfo.CurrentOrgId
|
|
4696
|
+ fmt.Println("机构id", userOrgID)
|
|
4697
|
+ id,_ := this.GetInt64("id")
|
|
4698
|
+ fmt.Println("这个id",id)
|
|
4699
|
+ dataBody := make(map[string]interface{}, 0)
|
|
4700
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
4701
|
+ if err != nil {
|
|
4702
|
+ utils.ErrorLog(err.Error())
|
|
4703
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
4704
|
+ return
|
|
4705
|
+ }
|
|
4706
|
+ linktype := int64(dataBody["linktype"].(float64))
|
|
4707
|
+ fmt.Println("链接类型",linktype)
|
|
4708
|
+ linktypetwo := int64(dataBody["linktypetwo"].(float64))
|
|
4709
|
+ fmt.Println("链接类型二",linktypetwo)
|
|
4710
|
+ articetype := int64(dataBody["articetype"].(float64))
|
|
4711
|
+ fmt.Println("文章分类",articetype)
|
|
4712
|
+ title := int64(dataBody["title"].(float64))
|
|
4713
|
+ fmt.Println("文章标题",title)
|
|
4714
|
+ phone := dataBody["phone"].(string)
|
|
4715
|
+ fmt.Println("电话号码",phone)
|
|
4716
|
+ outstation := dataBody["outstation"].(string)
|
|
4717
|
+ fmt.Println("站外链接",outstation)
|
|
4718
|
+ linkaddress := dataBody["linkaddress"].(string)
|
|
4719
|
+ fmt.Println("链接地址",linkaddress)
|
|
4720
|
+ if(phone!=""){
|
|
4721
|
+ linkaddress = phone;
|
|
4722
|
+ }
|
|
4723
|
+ if(outstation != ""){
|
|
4724
|
+ linkaddress = outstation;
|
|
4725
|
+ }
|
|
4726
|
+ navgationlink := models.SgjPatientNavgationlink{
|
|
4727
|
+ Linktype: linktype,
|
|
4728
|
+ Linktypetwo: linktype,
|
|
4729
|
+ Articetype: articetype,
|
|
4730
|
+ Title: title,
|
|
4731
|
+ Phone: phone,
|
|
4732
|
+ Outstation:outstation,
|
|
4733
|
+ Linkaddress: linkaddress,
|
|
4734
|
+ }
|
|
4735
|
+ err = site_service.UpdateditnavigationLink(userOrgID, id, navgationlink)
|
|
4736
|
+ if err !=nil{
|
|
4737
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
|
|
4738
|
+ return
|
|
4739
|
+ }
|
|
4740
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
4741
|
+ "navgationlink":navgationlink,
|
|
4742
|
+ })
|
|
4743
|
+}
|