Browse Source

微网站

xiaoming_global 4 years ago
parent
commit
24c559c90d

+ 4 - 1
controllers/article/article_controller.go View File

@@ -972,7 +972,7 @@ func (this * ArticleManage) UpdateVidoInfo()  {
972 972
 	}
973 973
 	vioupload := dataBody["vio_upload"].(string)
974 974
 	fmt.Println("视频上传路径",vioupload)
975
-	vidpic := dataBody["vid_pic"].(string)+"?vframe/jpg/offset/1/w/300/h/200"
975
+	vidpic := dataBody["vid_pic"].(string)
976 976
 	fmt.Println("视频封面",vidpic)
977 977
 	if len(vidpic) == 0 {
978 978
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "文章标题不能为空")
@@ -1180,6 +1180,9 @@ func (this * ArticleManage) GetReplyAllComents()  {
1180 1180
 	userOrgID := adminUserInfo.CurrentOrgId
1181 1181
 	fmt.Println("机构ID",userOrgID)
1182 1182
 	comment, total, err := article_service.GetReplyAllComents(userOrgID,page, limit)
1183
+	fmt.Println("comment",comment)
1184
+	fmt.Println("total",total)
1185
+	fmt.Println("错误",err)
1183 1186
 	if err !=nil{
1184 1187
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取评论列表失败")
1185 1188
 		return

+ 5 - 4
controllers/micro/micro_controller.go View File

@@ -8,7 +8,7 @@ import (
8 8
 )
9 9
 
10 10
 func microRouters(){
11
-	beego.Router("/api/site/getdata",&Micro{},"Get:GetData")
11
+	beego.Router("/api/site/getdatabyorgid",&Micro{},"Get:GetDataByOrgId")
12 12
 	beego.Router("/api/site/getdatatwo",&Micro{},"Get:GetDatatwo")
13 13
 	beego.Router("/api/site/getdatathree",&Micro{},"Get:GetOfficeDetail")
14 14
 	beego.Router("/api/site/getdatafour",&Micro{},"Get:GetDoctorDetail")
@@ -23,7 +23,6 @@ func microRouters(){
23 23
 	beego.Router("/api/site/singleactivitinfo",&Micro{},"Get:GetActivitDetail")
24 24
 	beego.Router("/api/site/singlearticleinfo",&Micro{},"Get:GetArticlesDetail")
25 25
    beego.Router("/api/site/singledoctorinfo",&Micro{},"Get:GetDoctorInfo")
26
-   beego.Router("/api/site/getrotationlinkaddress",&Micro{},"Get:GetRotationLinkAddress")
27 26
 }
28 27
 
29 28
 type Micro struct {
@@ -41,7 +40,7 @@ func (this *Micro) ServeSuccessJSON(data map[string]interface{}) {
41 40
 }
42 41
 
43 42
 
44
-func (this *Micro) GetData(){
43
+func (this *Micro) GetDataByOrgId(){
45 44
 	fmt.Println("我和我的祖国")
46 45
 	orgid, _ := this.GetInt64("orgid")
47 46
 	fmt.Println("小明id",orgid)
@@ -299,4 +298,6 @@ func (this *Micro) GetRotationLinkAddress()  {
299 298
 	this.ServeSuccessJSON(map[string]interface{}{
300 299
 		"linkaddress":linkaddress,
301 300
 	})
302
-}
301
+}
302
+
303
+

+ 310 - 115
controllers/site/site_controller.go View File

@@ -174,6 +174,9 @@ func siteRouters() {
174 174
 	beego.Router("/api/site/editrotationemages",&Microwebsite{},"Get:GeteditRotationEmages")
175 175
 	beego.Router("/api/site/getoutrotationlink",&Microwebsite{},"Get:GetOutRotationLink")
176 176
 	beego.Router("/api/site/updatedrolinkaddress",&Microwebsite{},"Post:UpdatedRolinkAddress")
177
+	beego.Router("/api/site/updatedconrotation",&Microwebsite{},"Post:UpdatedConrotation")
178
+	beego.Router("/api/site/getrotationvisiblebylinkid",&Microwebsite{},"Get:GetRotationVisibleByLinkId")
179
+	beego.Router("/api/site/addrotationvisibleform",&Microwebsite{},"Post:AddRotationVisibleForm")
177 180
 }
178 181
 
179 182
 type Microwebsite struct {
@@ -1427,9 +1430,11 @@ func (this *Microwebsite) Deletemodlebyid()  {
1427 1430
 	linkByModelid := site_service.DeleteEditPicLinkByModelid(id, userOrgID)
1428 1431
 	enviroments := site_service.DeleteEnviroments(id, userOrgID)
1429 1432
 	conrotation := site_service.DeleteConrotation(id, userOrgID)
1433
+	margin := site_service.DeletePatentEditMargin(id, userOrgID)
1430 1434
 	fmt.Println("linkByModelid",linkByModelid)
1431 1435
 	fmt.Println("enviroments",enviroments)
1432 1436
 	fmt.Println("enviroments",conrotation)
1437
+	fmt.Println("margin",margin)
1433 1438
 	fmt.Println(modelid,byModelid)
1434 1439
 	if err !=nil{
1435 1440
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除成功")
@@ -1803,42 +1808,52 @@ func (this *Microwebsite) GetData()  {
1803 1808
 	adminUserInfo := this.GetAdminUserInfo()
1804 1809
 	userOrgID := int64(adminUserInfo.CurrentOrgId)
1805 1810
 	fmt.Println("机构ID机构ID机构ID机构IDvvvv机构ID机构ID机构ID机构ID机构ID机构ID" ,userOrgID)
1806
-	model, err := site_service.GetData(userOrgID)
1807
-	fmt.Println("model是什么",model)
1808
-	fmt.Println("长度",len(model))
1809
-	fmt.Println("err",err)
1810
-	if(len(model) == 0){
1811
-		patientModel := models.SgjPatientModel{
1812
-			Title:     "轮播图",
1813
-			Sort:      1,
1814
-			UserOrgId: userOrgID,
1815
-			Ctime:     time.Now().Unix(),
1816
-			Status:    1,
1817
-			ModeType:  1,
1811
+	navigation, err := site_service.GetPatientNavigation(userOrgID)
1812
+	fmt.Println("navigation是什么",len(navigation))
1813
+	if(len(navigation) == 0){
1814
+		patientNavigation := models.SgjPatientNavigation{
1815
+			Navtitle:    "首页",
1816
+			Navimages:   "https://images.shengws.com/2089_o_1571990714383.png",
1817
+			Status:      1,
1818
+			UserOrgId:   userOrgID,
1819
+			Nonavimages: "https://images.shengws.com/2105_o_1571990730785.png",
1820
+			Ctime:       time.Now().Unix(),
1818 1821
 		}
1819
-		addPatientModel := site_service.AddPatientModelTwo(&patientModel)
1820
-		fmt.Println("第一个模块id",addPatientModel)
1821
-		sgjPatientModel, err := site_service.GetQueryModelByLastData(userOrgID)
1822
-		fmt.Println("查询模块错误是设么",err)
1823
-		editpiclink := models.SgjPatientEditpiclink{
1824
-			Images:    "https://images.shengws.com/2124_o_1570607834870.png",
1825
-			Sort:      1,
1826
-			UserOrgId: userOrgID,
1827
-			Status:    1,
1828
-			Ctime:     time.Now().Unix(),
1829
-			Modeid:sgjPatientModel.ID,
1822
+		err = site_service.AddNavgation(&patientNavigation)
1823
+		fmt.Println(err)
1824
+		sgjPatientNavigation := models.SgjPatientNavigation{
1825
+			Navtitle:    "消息",
1826
+			Navimages:   "https://images.shengws.com/2124_o_1571990749565.png",
1827
+			Status:      1,
1828
+			UserOrgId:   userOrgID,
1829
+			Nonavimages: "https://images.shengws.com/2079_o_1571990763549.png",
1830
+			Ctime:       time.Now().Unix(),
1830 1831
 		}
1831
-		err = site_service.AddPatientEdit(&editpiclink)
1832
-		fmt.Println("err",err)
1833
-		fmt.Println("editpiclink",editpiclink)
1834
-		if err !=nil{
1835
-			this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
1836
-			return
1832
+		err = site_service.AddNavgation(&sgjPatientNavigation)
1833
+		patientnavigationtwo := models.SgjPatientNavigation{
1834
+			Navtitle:    "电话",
1835
+			Navimages:   "https://images.shengws.com/2092_o_1571990776921.png",
1836
+			Status:      1,
1837
+			UserOrgId:   userOrgID,
1838
+			Nonavimages: "https://images.shengws.com/2100_o_1571990784845.png",
1839
+			Ctime:       time.Now().Unix(),
1840
+		}
1841
+		err = site_service.AddNavgation(&patientnavigationtwo)
1842
+		patientnavigationthree := models.SgjPatientNavigation{
1843
+			Navtitle:    "客服",
1844
+			Navimages:   "https://images.shengws.com/2101_o_1571990903053.png",
1845
+			Status:      1,
1846
+			UserOrgId:   userOrgID,
1847
+			Nonavimages: "https://images.shengws.com/2113_o_1571990915581.png",
1848
+			Ctime:       time.Now().Unix(),
1837 1849
 		}
1838
-		this.ServeSuccessJSON(map[string]interface{}{
1839
-			"patientModels":model,
1840
-		})
1850
+		err = site_service.AddNavgation(&patientnavigationthree)
1841 1851
 	}
1852
+
1853
+	model, err := site_service.GetData(userOrgID)
1854
+	fmt.Println("model是什么",model)
1855
+	fmt.Println("长度",len(model))
1856
+	fmt.Println("err",err)
1842 1857
 	if (len(model) == 0){
1843 1858
 			patientModel := models.SgjPatientModel{
1844 1859
 				Title:     "轮播图",
@@ -1878,7 +1893,7 @@ func (this *Microwebsite) GetData()  {
1878 1893
 			fmt.Println(err)
1879 1894
 			editmargin := models.SgjPatientEditmargin{
1880 1895
 				Margtitle: "医院介绍",
1881
-				Margimage: "https://images.shengws.com/2109_o_1569824063320.png",
1896
+				Margimage: "https://images.shengws.com/2162_o_1571992616722.png",
1882 1897
 				UserOrgId: userOrgID,
1883 1898
 				Status:    1,
1884 1899
 				Ctime:     time.Now().Unix(),
@@ -1889,7 +1904,7 @@ func (this *Microwebsite) GetData()  {
1889 1904
 
1890 1905
 			patientEditmargin := models.SgjPatientEditmargin{
1891 1906
 				Margtitle: "医护团队",
1892
-				Margimage: "https://images.shengws.com/2121_o_1569824193950.png",
1907
+				Margimage: "https://images.shengws.com/2121_o_1571992634289.png",
1893 1908
 				UserOrgId: userOrgID,
1894 1909
 				Status:    1,
1895 1910
 				Ctime:     time.Now().Unix(),
@@ -1899,8 +1914,8 @@ func (this *Microwebsite) GetData()  {
1899 1914
 			fmt.Println(err)
1900 1915
 
1901 1916
 			sgjPatientEditmargin := models.SgjPatientEditmargin{
1902
-				Margtitle: "科室介绍",
1903
-				Margimage: "https://images.shengws.com/2113_o_1569824421007.png",
1917
+				Margtitle: "医院动态",
1918
+				Margimage: "https://images.shengws.com/2163_o_1571992676180.png",
1904 1919
 				UserOrgId: userOrgID,
1905 1920
 				Status:    1,
1906 1921
 				Ctime:     time.Now().Unix(),
@@ -1912,7 +1927,7 @@ func (this *Microwebsite) GetData()  {
1912 1927
 
1913 1928
 			patienteditmarginfour := models.SgjPatientEditmargin{
1914 1929
 				Margtitle: "医院活动",
1915
-				Margimage: "https://images.shengws.com/2131_o_1569824498886.png",
1930
+				Margimage: "https://images.shengws.com/2117_o_1571992689392.png",
1916 1931
 				UserOrgId: userOrgID,
1917 1932
 				Status:    1,
1918 1933
 				Ctime:     time.Now().Unix(),
@@ -1924,7 +1939,7 @@ func (this *Microwebsite) GetData()  {
1924 1939
 
1925 1940
 			patienteditmarginfive := models.SgjPatientEditmargin{
1926 1941
 				Margtitle: "医院环境",
1927
-				Margimage: "https://images.shengws.com/2131_o_1569824498886.png",
1942
+				Margimage: "https://images.shengws.com/2130_o_1571992702226.png",
1928 1943
 				UserOrgId: userOrgID,
1929 1944
 				Status:    1,
1930 1945
 				Ctime:     time.Now().Unix(),
@@ -1935,8 +1950,8 @@ func (this *Microwebsite) GetData()  {
1935 1950
 			fmt.Println(err)
1936 1951
 
1937 1952
 			patienteditmarginsix := models.SgjPatientEditmargin{
1938
-				Margtitle: "咨询服",
1939
-				Margimage: "https://images.shengws.com/2111_o_1569824596227.png",
1953
+				Margtitle: "咨询服",
1954
+				Margimage: "https://images.shengws.com/2149_o_1571992721076.png",
1940 1955
 				UserOrgId: userOrgID,
1941 1956
 				Status:    1,
1942 1957
 				Ctime:     time.Now().Unix(),
@@ -1947,7 +1962,7 @@ func (this *Microwebsite) GetData()  {
1947 1962
 
1948 1963
 			patienteditmarginserven := models.SgjPatientEditmargin{
1949 1964
 				Margtitle: "加入会员",
1950
-				Margimage: "https://images.shengws.com/2126_o_1569824611892.png",
1965
+				Margimage: "https://images.shengws.com/2165_o_1571992737567.png",
1951 1966
 				UserOrgId: userOrgID,
1952 1967
 				Status:    1,
1953 1968
 				Ctime:     time.Now().Unix(),
@@ -1959,7 +1974,7 @@ func (this *Microwebsite) GetData()  {
1959 1974
 
1960 1975
 			patienteditmargineghit := models.SgjPatientEditmargin{
1961 1976
 				Margtitle: "联系我们",
1962
-				Margimage: "https://images.shengws.com/2141_o_1569824626531.png",
1977
+				Margimage: "https://images.shengws.com/2122_o_1571992753168.png",
1963 1978
 				UserOrgId: userOrgID,
1964 1979
 				Status:    1,
1965 1980
 				Ctime:     time.Now().Unix(),
@@ -2061,6 +2076,44 @@ func (this *Microwebsite) GetData()  {
2061 2076
 			}
2062 2077
 			err = site_service.AddImages(&enviroimages)
2063 2078
 			fmt.Println("err",err)
2079
+		//    modeleight := models.SgjPatientModel{
2080
+		//	  Title:     "文章列表",
2081
+		//	  Sort:      7,
2082
+		//	  UserOrgId: userOrgID,
2083
+		//	  Ctime:     time.Now().Unix(),
2084
+		//	  Status:    1,
2085
+		//	  ModeType:  6,
2086
+	    	//}
2087
+		//   err = site_service.AddPatientModelTwo(&modeleight)
2088
+		//byLastData, err := site_service.GetQueryModelByLastData(userOrgID)
2089
+		//fmt.Println(byLastData,err)
2090
+		//articlelist := models.SgjPatientArticlelist{
2091
+		//	Title:       "文章列表",
2092
+		//	Sort:7,
2093
+		//	UserOrgId:   userOrgID,
2094
+		//	Status:      1,
2095
+		//	Ctime:       time.Now().Unix(),
2096
+		//	Number:      1,
2097
+		//	Modeid:      byLastData.ID,
2098
+		//}
2099
+		//err = site_service.AddActiclelist(&articlelist)
2100
+		//articles := models.Articles{
2101
+		//	Title:     "文章列表",
2102
+		//	UserOrgId: userOrgID,
2103
+		//	Content:   "暂无数据",
2104
+		//	Imgs:"https://images.shengws.com/2062_o_1570608303729.png",
2105
+		//}
2106
+		//err = site_service.AddActicles(&articles)
2107
+		//fmt.Println("错误",err)
2108
+		//modelnight := models.SgjPatientModel{
2109
+		//	Title:     "活动列表",
2110
+		//	Sort:      8,
2111
+		//	UserOrgId: userOrgID,
2112
+		//	Ctime:     time.Now().Unix(),
2113
+		//	Status:    1,
2114
+		//	ModeType:  7,
2115
+		//}
2116
+		//err = site_service.AddPatientModelTwo(&modelnight)
2064 2117
 	}
2065 2118
 	fmt.Println(model,err)
2066 2119
 	if err !=nil{
@@ -2557,6 +2610,7 @@ func (this *Microwebsite) AddNavigation()  {
2557 2610
 	fmt.Println("链接地址",navigationaddress)
2558 2611
 	linkid := int64(dataBody["linkid"].(float64))
2559 2612
 	fmt.Println("linkID",linkid)
2613
+	linktype := int64(dataBody["linktype"].(float64))
2560 2614
 	navigation := models.SgjPatientNavigation{
2561 2615
 		Navtitle:   navtitle,
2562 2616
 		Navimages:  navigationImages,
@@ -2567,6 +2621,7 @@ func (this *Microwebsite) AddNavigation()  {
2567 2621
 		Status: 1,
2568 2622
 		Ctime:time.Now().Unix(),
2569 2623
 		Linkid:linkid,
2624
+		Linktype:linktype,
2570 2625
 	}
2571 2626
 	err = site_service.AddNavigation(&navigation)
2572 2627
 	if err !=nil{
@@ -2664,6 +2719,7 @@ func (this *Microwebsite) DeleteNavition()  {
2664 2719
 	adminUserInfo := this.GetAdminUserInfo()
2665 2720
 	userOrgID := int64(adminUserInfo.CurrentOrgId)
2666 2721
 	id, _ := this.GetInt64("id")
2722
+	fmt.Println("id是什么呢",id)
2667 2723
 	err := site_service.DeleteNavitionById(userOrgID, id)
2668 2724
 	if err !=nil{
2669 2725
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除成功")
@@ -3258,12 +3314,17 @@ func (this *Microwebsite) SaveNavigation()  {
3258 3314
 	}
3259 3315
 	navaddress := dataBody["navaddress"].(string)
3260 3316
 	fmt.Println("链接地址",navaddress)
3317
+	linkid := int64(dataBody["linkid"].(float64))
3318
+	fmt.Println("linkid是多少",linkid)
3319
+	linktype := int64(dataBody["linktype"].(float64))
3261 3320
 	navigation := models.SgjPatientNavigation{
3262 3321
 		Navtitle:   navtitle,
3263 3322
 		Navimages:  navimages,
3264 3323
         Nonavimages:noCheckImages,
3265 3324
 		Jumpset:    jumpset,
3266 3325
 		Navaddress: navaddress,
3326
+		Linkid:linkid,
3327
+		Linktype:linktype,
3267 3328
 	}
3268 3329
 	err = site_service.UpdateNavtion(id, userOrgID, navigation)
3269 3330
 	navigations, err := site_service.GetDefaultNavigation(userOrgID)
@@ -4403,7 +4464,9 @@ func  (this *Microwebsite) Getlinkaddress()  {
4403 4464
 	adminUserInfo := this.GetAdminUserInfo()
4404 4465
 	userOrgID := adminUserInfo.CurrentOrgId
4405 4466
 	fmt.Println("机构id",userOrgID)
4406
-	linkaddress, err := site_service.GetLinkAddress(userOrgID)
4467
+	id, _ := this.GetInt64("id")
4468
+	fmt.Println("id",id)
4469
+	linkaddress, err := site_service.GetLinkAddress(userOrgID,id)
4407 4470
 	fmt.Println("错误",err)
4408 4471
 	fmt.Println("地址",linkaddress)
4409 4472
 	if err !=nil{
@@ -4666,6 +4729,8 @@ func  (this *Microwebsite) GetLinkAddressDetail()  {
4666 4729
 	id, _ := this.GetInt64("id")
4667 4730
 	fmt.Println("链接id",id)
4668 4731
 	conlinkaddress, err := site_service.GetLinkAddressDetail(userOrgID, id)
4732
+	fmt.Println("错误",err)
4733
+	fmt.Println("conlinkaddress",conlinkaddress)
4669 4734
 	if err !=nil{
4670 4735
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
4671 4736
 		return
@@ -4688,6 +4753,19 @@ func (this *Microwebsite) UpdatePicFformThree()  {
4688 4753
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
4689 4754
 		return
4690 4755
 	}
4756
+	defineaddress := dataBody["defineaddress"].(string)
4757
+	fmt.Println("defineaddress",defineaddress)
4758
+	conlinkaddress := models.SgjPatientConlinkaddress{
4759
+		Defineaddress: defineaddress,
4760
+	}
4761
+	err = site_service.UpdatedConlinkAddress(id, userOrgID, conlinkaddress)
4762
+	if err !=nil{
4763
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
4764
+		return
4765
+	}
4766
+	this.ServeSuccessJSON(map[string]interface{}{
4767
+		"conlinkaddress":conlinkaddress,
4768
+	})
4691 4769
 
4692 4770
 }
4693 4771
 
@@ -5041,6 +5119,7 @@ func  (this*Microwebsite) UpdateLinkAddress()  {
5041 5119
 		UserOrgId:userOrgID,
5042 5120
 		Status:1,
5043 5121
 	}
5122
+	model, err := site_service.GetPatienModelByModelId(linkaddress, userOrgID)
5044 5123
 	patientMagiclink, err := site_service.GetMacLinkAddressTwo(userOrgID)
5045 5124
 	fmt.Println("长度",len(patientMagiclink))
5046 5125
 	if(len(patientMagiclink)== 0){
@@ -5057,6 +5136,7 @@ func  (this*Microwebsite) UpdateLinkAddress()  {
5057 5136
 	}
5058 5137
 	this.ServeSuccessJSON(map[string]interface{}{
5059 5138
 		"magiclink":magiclink,
5139
+		"model":model,
5060 5140
 	})
5061 5141
 }
5062 5142
 
@@ -5131,7 +5211,7 @@ func (this*Microwebsite) GetCountImages()  {
5131 5211
 	userOrgID := adminUserInfo.CurrentOrgId
5132 5212
 	fmt.Println("机构id", userOrgID)
5133 5213
 	edipiclink, total, err := site_service.GetCountImages(userOrgID)
5134
-	fmt.Println(edipiclink)
5214
+	fmt.Println("edipiclink是什么",edipiclink)
5135 5215
 	fmt.Println("total是什么",total)
5136 5216
 	fmt.Println("err是什么",err)
5137 5217
 }
@@ -5214,8 +5294,11 @@ func (this*Microwebsite) UpdateditnavigationLink() {
5214 5294
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
5215 5295
 		return
5216 5296
 	}
5217
-	id := int64(dataBody["id"].(float64))
5297
+	//id := int64(dataBody["id"].(float64))
5298
+		//fmt.Println("id是什么",id)
5299
+	id, _ := this.GetInt64("id")
5218 5300
 	fmt.Println("id是什么",id)
5301
+
5219 5302
 	linktype := int64(dataBody["linktype"].(float64))
5220 5303
 	fmt.Println("linktype",linktype)
5221 5304
 	navitionlinktype := int64(dataBody["navitionlinktype"].(float64))
@@ -5232,11 +5315,26 @@ func (this*Microwebsite) UpdateditnavigationLink() {
5232 5315
 		Outstationlink:   outstationlink,
5233 5316
 		Linkaddress:      linkaddress,
5234 5317
 		Phone:phone,
5318
+		UserOrgId:userOrgID,
5319
+		Status:1,
5235 5320
 	}
5236
-	err = site_service.UpdateditnavigationLink(id, userOrgID, navgationlink)
5237
-	if err !=nil{
5238
-		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5239
-		return
5321
+	patientNavgationlink, errcode := site_service.GetNavgationLinkById(id, userOrgID)
5322
+	fmt.Println(patientNavgationlink,errcode)
5323
+	if errcode == gorm.ErrRecordNotFound{
5324
+		err = site_service.AddNavigationlink(&navgationlink)
5325
+		fmt.Println("数据添加成功",err)
5326
+	}else if errcode == nil {
5327
+		err = site_service.UpdateditnavigationLink(id, userOrgID, navgationlink)
5328
+		if err !=nil{
5329
+			this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5330
+			return
5331
+		}
5332
+	}else {
5333
+		err = site_service.UpdateditnavigationLink(id, userOrgID, navgationlink)
5334
+		if err !=nil{
5335
+			this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5336
+			return
5337
+		}
5240 5338
 	}
5241 5339
 	this.ServeSuccessJSON(map[string]interface{}{
5242 5340
 		"navgationlink":navgationlink,
@@ -5305,71 +5403,71 @@ func (this *Microwebsite) GetNavigationset()  {
5305 5403
 	adminUserInfo := this.GetAdminUserInfo()
5306 5404
 	userOrgID := adminUserInfo.CurrentOrgId
5307 5405
 	fmt.Println("机构id", userOrgID)
5308
-	navigation, err := site_service.GetDefaultNavigation(userOrgID)
5309
-	fmt.Println("错误是设么",err)
5310
-	if (len(navigation) == 0) {
5311
-		sgjPatientNavigation := models.SgjPatientNavigation{
5312
-			Navtitle:   "首页",
5313
-			Navimages:  "https://images.shengws.com/2099_o_1570840397245.png",
5314
-			Nonavimages:"https://images.shengws.com/2099_o_1570840397245.png",
5315
-			Jumpset:    1,
5316
-			Navaddress: "",
5317
-			Ctime:      time.Now().Unix(),
5318
-			Status:     1,
5319
-			UserOrgId:  userOrgID,
5320
-		}
5321
-		err = site_service.AddDefaultData(&sgjPatientNavigation)
5322
-		patientNavigation := models.SgjPatientNavigation{
5323
-			Navtitle:   "微商城",
5324
-			Navimages:  "https://images.shengws.com/2122_o_1570840361702.png",
5325
-			Nonavimages:"https://images.shengws.com/2122_o_1570840361702.png",
5326
-			Jumpset:    1,
5327
-			Navaddress: "http://shop.kuyicloud.com/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&fxtoken=bdc5659cbd1bd67baa9af215b0d6ae4c&fxorgid=3877&timestamp=1571050598&fxadmin=185&wxref=mp.weixin.qq.com#wechat_redirect",
5328
-			Ctime:      time.Now().Unix(),
5329
-			Status:     1,
5330
-			UserOrgId:  userOrgID,
5331
-		}
5332
-		err = site_service.AddDefaultData(&patientNavigation)
5333
-		fmt.Println(err)
5334
-        fmt.Println(patientNavigation)
5335
-		sgjPatientNavigationtwo := models.SgjPatientNavigation{
5336
-			Navtitle:   "联系我们",
5337
-			Navimages:  "https://images.shengws.com/2138_o_1570840377129.png",
5338
-			Nonavimages:"https://images.shengws.com/2138_o_1570840377129.png",
5339
-			Jumpset:    1,
5340
-			Navaddress: "",
5341
-			Ctime:      time.Now().Unix(),
5342
-			Status:     1,
5343
-			UserOrgId:  userOrgID,
5344
-		}
5345
-		err = site_service.AddDefaultData(&sgjPatientNavigationtwo)
5346
-		fmt.Println(err)
5347
-       fmt.Println(sgjPatientNavigationtwo)
5348
-		sgjPatientNavigationthree := models.SgjPatientNavigation{
5349
-			Navtitle:   "在线客服",
5350
-			Navimages:  "https://images.shengws.com/2079_o_1570842501972.png",
5351
-			Nonavimages:"https://images.shengws.com/2079_o_1570842501972.png",
5352
-			Jumpset:    1,
5353
-			Navaddress: "0755-86526342",
5354
-			Ctime:      time.Now().Unix(),
5355
-			Status:     1,
5356
-			UserOrgId:  userOrgID,
5357
-		}
5358
-		err = site_service.AddDefaultData(&sgjPatientNavigationthree)
5359
-		fmt.Println(err)
5360
-        fmt.Println(sgjPatientNavigationthree)
5361
-
5362
-		navigations, err := site_service.GetDefaultNavigation(userOrgID)
5363
-		fmt.Println(err)
5364
-		if err !=nil{
5365
-			this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5366
-			return
5367
-		}
5368
-		this.ServeSuccessJSON(map[string]interface{}{
5369
-			"sgjPatientNavigation":sgjPatientNavigation,
5370
-			"navigations":navigations,
5371
-		})
5372
-	}
5406
+	//navigation, err := site_service.GetDefaultNavigation(userOrgID)
5407
+	//fmt.Println("错误是设么",err)
5408
+	//if (len(navigation) == 0) {
5409
+	//	sgjPatientNavigation := models.SgjPatientNavigation{
5410
+	//		Navtitle:   "首页",
5411
+	//		Navimages:  "https://images.shengws.com/2099_o_1570840397245.png",
5412
+	//		Nonavimages:"https://images.shengws.com/2099_o_1570840397245.png",
5413
+	//		Jumpset:    1,
5414
+	//		Navaddress: "",
5415
+	//		Ctime:      time.Now().Unix(),
5416
+	//		Status:     1,
5417
+	//		UserOrgId:  userOrgID,
5418
+	//	}
5419
+	//	err = site_service.AddDefaultData(&sgjPatientNavigation)
5420
+	//	patientNavigation := models.SgjPatientNavigation{
5421
+	//		Navtitle:   "微商城",
5422
+	//		Navimages:  "https://images.shengws.com/2122_o_1570840361702.png",
5423
+	//		Nonavimages:"https://images.shengws.com/2122_o_1570840361702.png",
5424
+	//		Jumpset:    1,
5425
+	//		Navaddress: "http://shop.kuyicloud.com/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&fxtoken=bdc5659cbd1bd67baa9af215b0d6ae4c&fxorgid=3877&timestamp=1571050598&fxadmin=185&wxref=mp.weixin.qq.com#wechat_redirect",
5426
+	//		Ctime:      time.Now().Unix(),
5427
+	//		Status:     1,
5428
+	//		UserOrgId:  userOrgID,
5429
+	//	}
5430
+	//	err = site_service.AddDefaultData(&patientNavigation)
5431
+	//	fmt.Println(err)
5432
+     //   fmt.Println(patientNavigation)
5433
+	//	sgjPatientNavigationtwo := models.SgjPatientNavigation{
5434
+	//		Navtitle:   "联系我们",
5435
+	//		Navimages:  "https://images.shengws.com/2138_o_1570840377129.png",
5436
+	//		Nonavimages:"https://images.shengws.com/2138_o_1570840377129.png",
5437
+	//		Jumpset:    1,
5438
+	//		Navaddress: "",
5439
+	//		Ctime:      time.Now().Unix(),
5440
+	//		Status:     1,
5441
+	//		UserOrgId:  userOrgID,
5442
+	//	}
5443
+	//	err = site_service.AddDefaultData(&sgjPatientNavigationtwo)
5444
+	//	fmt.Println(err)
5445
+     //  fmt.Println(sgjPatientNavigationtwo)
5446
+	//	sgjPatientNavigationthree := models.SgjPatientNavigation{
5447
+	//		Navtitle:   "在线客服",
5448
+	//		Navimages:  "https://images.shengws.com/2079_o_1570842501972.png",
5449
+	//		Nonavimages:"https://images.shengws.com/2079_o_1570842501972.png",
5450
+	//		Jumpset:    1,
5451
+	//		Navaddress: "0755-86526342",
5452
+	//		Ctime:      time.Now().Unix(),
5453
+	//		Status:     1,
5454
+	//		UserOrgId:  userOrgID,
5455
+	//	}
5456
+	//	err = site_service.AddDefaultData(&sgjPatientNavigationthree)
5457
+	//	fmt.Println(err)
5458
+     //   fmt.Println(sgjPatientNavigationthree)
5459
+	//
5460
+	//	navigations, err := site_service.GetDefaultNavigation(userOrgID)
5461
+	//	fmt.Println(err)
5462
+	//	if err !=nil{
5463
+	//		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5464
+	//		return
5465
+	//	}
5466
+	//	this.ServeSuccessJSON(map[string]interface{}{
5467
+	//		"sgjPatientNavigation":sgjPatientNavigation,
5468
+	//		"navigations":navigations,
5469
+	//	})
5470
+	//}
5373 5471
 
5374 5472
 	navigations, err := site_service.GetDefaultNavigation(userOrgID)
5375 5473
 	if err !=nil{
@@ -5601,6 +5699,103 @@ func (this *Microwebsite) UpdatedRolinkAddress()  {
5601 5699
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
5602 5700
 		return
5603 5701
 	}
5604
-	id := int64(dataBody["id"].(float64))
5702
+	//id := int64(dataBody["id"].(float64))
5703
+	id,_ := this.GetInt64("id")
5704
+	fmt.Println("id是什么",id)
5705
+	defineaddress :=dataBody["defineaddress"].(string)
5706
+	fmt.Println("defineaddress",defineaddress)
5707
+	conlinkaddress := models.SgjPatientConlinkaddress{
5708
+		Defineaddress: defineaddress,
5709
+	}
5710
+	err = site_service.UpdatedConlinkAddress(id, userOrgID, conlinkaddress)
5711
+	if err !=nil{
5712
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5713
+		return
5714
+	}
5715
+	this.ServeSuccessJSON(map[string]interface{}{
5716
+		"conlinkaddress":conlinkaddress,
5717
+	})
5718
+}
5719
+
5720
+func (this *Microwebsite) UpdatedConrotation(){
5721
+	adminUserInfo := this.GetAdminUserInfo()
5722
+	userOrgID := adminUserInfo.CurrentOrgId
5723
+	fmt.Println("机构id",userOrgID)
5724
+	dataBody := make(map[string]interface{}, 0)
5725
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
5726
+	if err != nil {
5727
+		utils.ErrorLog(err.Error())
5728
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
5729
+		return
5730
+	}
5731
+	id, _ := this.GetInt64("id")
5732
+	fmt.Println("id是什么",id)
5733
+	images := dataBody["images"].(string)
5734
+	fmt.Println("images是什么",images)
5735
+	sort := int64(dataBody["sort"].(float64))
5736
+	fmt.Println("sort",sort)
5737
+	piclink := int64(dataBody["piclink"].(float64))
5738
+	fmt.Println("piclink",piclink)
5739
+	linkaddress := dataBody["linkaddress"].(string)
5740
+	fmt.Println("linkaddress",linkaddress)
5741
+	conrotation := models.SgjPatientConrotation{
5742
+		Images:      images,
5743
+		Sort:        sort,
5744
+		Piclink:     piclink,
5745
+		Linkaddress: linkaddress,
5746
+	}
5747
+	err = site_service.UpdatedConrotation(id, userOrgID, conrotation)
5748
+	if err !=nil{
5749
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5750
+		return
5751
+	}
5752
+	this.ServeSuccessJSON(map[string]interface{}{
5753
+		"conrotation":conrotation,
5754
+	})
5755
+}
5756
+
5757
+func (this *Microwebsite) GetRotationVisibleByLinkId()  {
5758
+	adminUserInfo := this.GetAdminUserInfo()
5759
+	userOrgID := adminUserInfo.CurrentOrgId
5760
+	fmt.Println("机构id",userOrgID)
5761
+	id, _ := this.GetInt64("id")
5605 5762
 	fmt.Println("id是什么",id)
5763
+	conlinkaddress, err := site_service.GetRotationVisibleByLinkId(id, userOrgID)
5764
+	fmt.Println("错误",err)
5765
+	fmt.Println("conlinkaddress",conlinkaddress)
5766
+	if err !=nil{
5767
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5768
+		return
5769
+	}
5770
+	this.ServeSuccessJSON(map[string]interface{}{
5771
+		"conlinkaddress":conlinkaddress,
5772
+	})
5773
+}
5774
+
5775
+func (this *Microwebsite)  AddRotationVisibleForm(){
5776
+	adminUserInfo := this.GetAdminUserInfo()
5777
+	userOrgID := adminUserInfo.CurrentOrgId
5778
+	fmt.Println("机构id",userOrgID)
5779
+	id, _ := this.GetInt64("id")
5780
+	fmt.Println("id是设么",id)
5781
+	dataBody := make(map[string]interface{}, 0)
5782
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
5783
+	if err != nil {
5784
+		utils.ErrorLog(err.Error())
5785
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
5786
+		return
5787
+	}
5788
+	defineaddress := dataBody["defineaddress"].(string)
5789
+	fmt.Println("defineaddrss",defineaddress)
5790
+	linkaddress := models.SgjPatientLinkaddress{
5791
+		Defineaddress: defineaddress,
5792
+	}
5793
+	err = site_service.UpdatedRotationVisble(id, userOrgID, linkaddress)
5794
+	if err !=nil{
5795
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
5796
+		return
5797
+	}
5798
+	this.ServeSuccessJSON(map[string]interface{}{
5799
+		"linkaddress":linkaddress,
5800
+	})
5606 5801
 }

+ 16 - 3
models/site_models.go View File

@@ -38,12 +38,24 @@ type SgjPatientModel struct {
38 38
 	Editmargin  []SgjPatientEditmargin `gorm:"ForeignKey:Modeid"`
39 39
 	Enviroimages  []SgjPatientEnviroimages `gorm:"ForeignKey:Modeid"`
40 40
 	PatientEditpiclink  []SgjPatientEditpiclink `gorm:"ForeignKey:Modeid"`
41
+}
42
+func (SgjPatientModel) TableName() string{
43
+	return "sgj_patient_model"
44
+}
41 45
 
42 46
 
43
-
44
-
47
+type PatientModel struct {
48
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
49
+	Title string `gorm:"column:title" json:"title" form:"title"`
50
+	Sort int64 `gorm:"column:sort" json:"sort" form:"sort"`
51
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
52
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
53
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
54
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
55
+	ModeType int64 `gorm:"column:mode_type" json:"mode_type" form:"mode_type"`
45 56
 }
46
-func (SgjPatientModel) TableName() string{
57
+
58
+func (PatientModel) TableName() string{
47 59
 	return "sgj_patient_model"
48 60
 }
49 61
 
@@ -229,6 +241,7 @@ type SgjPatientNavigation struct {
229 241
 	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
230 242
 	Linkid int64 `gorm:"column:linkid" json:"linkid" form:"linkid"`
231 243
 	Nonavimages string `gorm:"column:nonavimages" json:"nonavimages" form:"nonavimages"`
244
+	Linktype int64 `gorm:"column:linktype" json:"linktype" form:"linktype"`
232 245
 }
233 246
 
234 247
 func (SgjPatientNavigation) TableName() string  {

+ 1 - 1
service/article_service/article_category_service.go View File

@@ -311,7 +311,7 @@ func AddComment(comment *models.Comment)(error)  {
311 311
 }
312 312
 
313 313
 func GetReplyAllComents(orgid int64,page int64,limit int64)(comment []*models.Comment,total int64,err error)  {
314
-	db := service.PatientReadDB().Table("sgj_patient_articles_comment as a").Where("a.status = ?,a.user_org_id = ?",1,orgid)
314
+	db := service.PatientReadDB().Table("sgj_patient_articles_comment as a").Where("a.status = ? AND a.user_org_id = ?",1,orgid)
315 315
 	offset := (page - 1) * limit
316 316
 	err = db.Where("parent_id = ?",0).Count(&total).Order("a.ctime desc").Offset(offset).Limit(limit).
317 317
 		Select("a.id,a.article_id,a.comment_user_id,a.parent_id,a.content,a.ctime,a.status,a.star_num,a.comment_num,a.comment_id,a.comment_user_name,a.comment_user_avater,a.source,a.ttid,a.tuser_id,a.taid,a.tpid,a.tcid").Find(&comment).Error

+ 6 - 0
service/micro_service/micro_service.go View File

@@ -146,4 +146,10 @@ func GetRotationLinkAddress(orgid int64,linkid int64)(models.SgjPatientLinkaddre
146 146
 	linkaddress := models.SgjPatientLinkaddress{}
147 147
 	err := service.PatientReadDB().Model(&linkaddress).Where("user_org_id = ? AND id = ? AND status = ?", orgid, linkid, 1).Find(&linkaddress).Error
148 148
 	return linkaddress,err
149
+}
150
+
151
+func GetNavigationLinkAddressById(id int64,orgid int64)(models.SgjPatientEditmargin,error)  {
152
+	editmargin := models.SgjPatientEditmargin{}
153
+	err := service.PatientReadDB().Model(&editmargin).Where("id=? and user_org_id = ?", id, orgid).Find(&editmargin).Error
154
+	return editmargin,err
149 155
 }

+ 73 - 7
service/site_service/site_microwebsite_service.go View File

@@ -261,6 +261,11 @@ func DeleteConrotation(mid int64,orgID int64)(error)  {
261 261
 	return err
262 262
 }
263 263
 
264
+func DeletePatentEditMargin(mid int64,orgID int64)(error)  {
265
+	err := service.PatientWriteDB().Model(models.SgjPatientEditmargin{}).Where("modeid = ? AND user_org_id = ?", mid, orgID).Update(map[string]interface{}{"status": 0, "img_show": 0, "mtime": time.Now().Unix()}).Error
266
+	return  err
267
+}
268
+
264 269
 
265 270
 func UpdateOffices(id int64,orgID int64,offices models.SgjPatientOffices) error {
266 271
 	err := service.PatientWriteDB().Model(offices).Where("id = ? AND user_org_id = ? AND status = ?", id, orgID, 1).Update(map[string]interface{}{"title": offices.Title, "sort": offices.Sort, "introduction": offices.Introduction, "mtime": time.Now().Unix()}).Error
@@ -285,6 +290,15 @@ func GetData(orgid int64)(model []*models.SgjPatientModel,err error)  {
285 290
 		return
286 291
 }
287 292
 
293
+func GetPatientNavigation(orgid int64)(navigation []*models.SgjPatientNavigation,err error)  {
294
+	err = service.PatientReadDB().Where("user_org_id = ? AND status = ?", orgid,1).Find(&navigation).Error
295
+	return navigation,err
296
+}
297
+
298
+func AddNavgation(navigation *models.SgjPatientNavigation) error  {
299
+	err := service.PatientReadDB().Create(&navigation).Error
300
+	return err
301
+}
288 302
 
289 303
 
290 304
 func UpdateDoctorsInfo(orgID int64,ids[] int64,editdoctor models.SgjPatientEditdoctor)(err error)  {
@@ -414,7 +428,7 @@ func GetShareInfo(orgid int64)(models.SgjPatientShare,error)  {
414 428
 }
415 429
 
416 430
 func DeleteNavitionById(orgID int64,id int64)(error)  {
417
-	err := service.PatientWriteDB().Model(models.PatientNavgationlink{}).Where("user_org_id = ? AND id = ?", orgID, id).Update(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()}).Error
431
+	err := service.PatientWriteDB().Model(models.SgjPatientNavigation{}).Where("user_org_id = ? AND id = ?", orgID, id).Update(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()}).Error
418 432
 	return  err
419 433
 }
420 434
 
@@ -571,7 +585,7 @@ func EditNavigation(orgid int64,id int64)(models.SgjPatientNavigation,error){
571 585
 }
572 586
 
573 587
 func UpdateNavtion(id int64,orgid int64,navigation models.SgjPatientNavigation) error {
574
-	err := service.PatientWriteDB().Model(navigation).Where("id = ? AND user_org_id = ? AND status = ?", id, orgid, 1).Update(map[string]interface{}{"navtitle": navigation.Navtitle, "navimages": navigation.Navimages,"nonavimages":navigation.Nonavimages, "jumpset": navigation.Jumpset, "navaddress": navigation.Navaddress, "mtime": time.Now().Unix()}).Error
588
+	err := service.PatientWriteDB().Model(navigation).Where("id = ? AND user_org_id = ? AND status = ?", id, orgid, 1).Update(map[string]interface{}{"navtitle": navigation.Navtitle, "navimages": navigation.Navimages,"nonavimages":navigation.Nonavimages, "jumpset": navigation.Jumpset, "navaddress": navigation.Navaddress,"linkid":navigation.Linkid,"linktype":navigation.Linktype, "mtime": time.Now().Unix()}).Error
575 589
 	return err
576 590
 }
577 591
 
@@ -868,10 +882,10 @@ func AddLinkAddress(linkaddress *models.SgjPatientLinkaddress)  error {
868 882
 	return err
869 883
 }
870 884
 
871
-func GetLinkAddress(orgid int64)(models.SgjPatientLinkaddress,error)  {
885
+func GetLinkAddress(orgid int64,id int64)(models.SgjPatientLinkaddress,error)  {
872 886
 
873 887
 	linkaddress := models.SgjPatientLinkaddress{}
874
-	err := service.PatientReadDB().Model(&linkaddress).Where("user_org_id = ? AND status = ? ", orgid, 1).Last(&linkaddress).Error
888
+	err := service.PatientReadDB().Model(&linkaddress).Where("user_org_id = ? AND id = ? AND status = ? ", orgid,id, 1).Find(&linkaddress).Error
875 889
 	return linkaddress,err
876 890
 }
877 891
 
@@ -941,9 +955,9 @@ func GetConLinkAddressById(orgid int64)(models.SgjPatientConlinkaddress,error)
941 955
 	return conlinkaddress,err
942 956
 }
943 957
 
944
-func GetLinkAddressDetail(orgid int64,conid int64)(models.SgjPatientConlinkaddress,error)  {
958
+func GetLinkAddressDetail(orgid int64,id int64)(models.SgjPatientConlinkaddress,error)  {
945 959
 	conlinkaddress := models.SgjPatientConlinkaddress{}
946
-	err := service.PatientReadDB().Where("user_org_id = ? AND con_id = ? AND status = ?", orgid, conid, 1).Find(&conlinkaddress).Error
960
+	err := service.PatientReadDB().Where("user_org_id = ? AND id = ? AND status = ?", orgid, id, 1).Find(&conlinkaddress).Error
947 961
 	return conlinkaddress,err
948 962
 }
949 963
 
@@ -969,6 +983,12 @@ func AddMagiclinkData(magiclink *models.SgjPatientMagiclink)error  {
969 983
 	return err
970 984
 }
971 985
 
986
+func GetPatienModelByModelId(id int64,orgid int64)(models.PatientModel,error)  {
987
+	model := models.PatientModel{}
988
+	err := service.PatientReadDB().Model(&model).Where("id=? AND user_org_id = ?", id, orgid).Find(&model).Error
989
+	return model,err
990
+}
991
+
972 992
 func GetMacLinkAddressTwo (orgid int64)(patientMagiclink []models.SgjPatientMagiclink,err error) {
973 993
 	err = service.PatientReadDB().Model(&patientMagiclink).Where("user_org_id = ? AND status = ?", orgid, 1).Find(&patientMagiclink).Error
974 994
 	return patientMagiclink,err
@@ -1105,6 +1125,28 @@ func GetNavgationlinkAddressBylinkId(orgid int64,linkid int64)(models.PatientNav
1105 1125
 	return navgationlink,err
1106 1126
 }
1107 1127
 
1128
+func GetNavgationLinkById(id int64,orgid int64)(*models.PatientNavgationlink,error)  {
1129
+	 var pat  models.PatientNavgationlink
1130
+	 var err error
1131
+	 err = service.PatientReadDB().Model(&models.PatientNavgationlink{}).Where(" id = ? AND user_org_id = ?", id, orgid).Find(&pat).Error
1132
+
1133
+	if err == gorm.ErrRecordNotFound{
1134
+		return nil,err
1135
+
1136
+	}
1137
+	if err != nil {
1138
+		return nil, err
1139
+	}
1140
+   return &pat,nil
1141
+
1142
+}
1143
+
1144
+func AddNavigationlink(navgationlink *models.PatientNavgationlink) error {
1145
+
1146
+	err := service.PatientWriteDB().Create(&navgationlink).Error
1147
+	return err
1148
+}
1149
+
1108 1150
 func UpdateditnavigationLink(id int64,orgid int64,navgationlink models.PatientNavgationlink) error {
1109 1151
 
1110 1152
 	err := service.PatientWriteDB().Model(&navgationlink).Where("id = ? AND user_org_id =?", id, orgid).Update(map[string]interface{}{"linktype": navgationlink.Linktype, "navitionlinktype": navgationlink.Navitionlinktype,  "phone": navgationlink.Phone, "outstationlink":
@@ -1233,4 +1275,28 @@ func GetOutRotationLink(orgid int64,linkid int64)(models.SgjPatientConlinkaddres
1233 1275
 	conlinkaddress := models.SgjPatientConlinkaddress{}
1234 1276
 	err := service.PatientReadDB().Where("user_org_id = ? AND id = ?", orgid, linkid).Find(&conlinkaddress).Error
1235 1277
 	return  conlinkaddress,err
1236
-}
1278
+}
1279
+
1280
+func UpdatedConlinkAddress(id int64,orgid int64,conlinkaddress models.SgjPatientConlinkaddress) error {
1281
+
1282
+	err := service.PatientReadDB().Model(&conlinkaddress).Where("id=? AND user_org_id = ?", id, orgid).Update(map[string]interface{}{"defineaddress": conlinkaddress.Defineaddress, "mtime": time.Now().Unix()}).Error
1283
+	return  err
1284
+}
1285
+
1286
+func UpdatedConrotation(id int64,orgid int64,conrotation models.SgjPatientConrotation) error {
1287
+	err := service.PatientReadDB().Model(&conrotation).Where("id=? AND user_org_id = ?", id, orgid).Update(map[string]interface{}{"images": conrotation.Images, "sort": conrotation.Sort, "piclink": conrotation.Piclink, "linkaddress": conrotation.Linkaddress, "mtime": time.Now().Unix()}).Error
1288
+	return  err
1289
+}
1290
+
1291
+func GetRotationVisibleByLinkId(id int64,orgid int64)(models.SgjPatientLinkaddress,error)   {
1292
+	conlinkaddress := models.SgjPatientLinkaddress{}
1293
+	err := service.PatientReadDB().Where("id = ? AND user_org_id = ?", id, orgid).Find(&conlinkaddress).Error
1294
+	return  conlinkaddress,err
1295
+}
1296
+
1297
+func UpdatedRotationVisble(id int64,orgid int64,linkaddress models.SgjPatientLinkaddress)error  {
1298
+
1299
+	err := service.PatientReadDB().Model(&linkaddress).Where("id = ? AND user_org_id = ?", id, orgid).Update(map[string]interface{}{"defineaddress": linkaddress.Defineaddress, "mtime": time.Now().Unix()}).Error
1300
+	return err
1301
+}
1302
+