Browse Source

联系我们模块更新

xiaoming_global 5 years ago
parent
commit
dab549d8ea

+ 335 - 12
controllers/site/site_controller.go View File

70
 	beego.Router("/api/site/deletenavition",&Microwebsite{},"Get:DeleteNavition")
70
 	beego.Router("/api/site/deletenavition",&Microwebsite{},"Get:DeleteNavition")
71
 	beego.Router("/api/site/deletemodle",&Microwebsite{},"Get:DeleteModle")
71
 	beego.Router("/api/site/deletemodle",&Microwebsite{},"Get:DeleteModle")
72
 	beego.Router("/api/site/getordermodel",&Microwebsite{},"Post:GetOrderModel")
72
 	beego.Router("/api/site/getordermodel",&Microwebsite{},"Post:GetOrderModel")
73
+	beego.Router("/api/site/addrotationpic",&Microwebsite{},"Post:AddRotationpic")
74
+	beego.Router("/api/site/getrotationimages",&Microwebsite{},"Post:GetRotationimages")
75
+	beego.Router("/api/site/addrotationimage",&Microwebsite{},"Post:AddrotationImage")
76
+	beego.Router("/api/site/addimageslink",&Microwebsite{},"Post:AddImageslink")
77
+	beego.Router("/api/site/geteditimages",&Microwebsite{},"Post:GetEditImages")
78
+	beego.Router("/api/site/addmagicnavi",&Microwebsite{},"Post:AddMagicNavi")
79
+	beego.Router("/api/site/getmagicimages",&Microwebsite{},"Post:GetMagicImages")
80
+	beego.Router("/api/site/addmarginchart",&Microwebsite{},"Post:AddMarginChart")
73
 }
81
 }
74
 
82
 
75
 type Microwebsite struct {
83
 type Microwebsite struct {
95
 		return
103
 		return
96
 	}
104
 	}
97
 	fmt.Println("姓名:",title)
105
 	fmt.Println("姓名:",title)
98
-	sort := dataBody["sort"].(string)
99
-	if len(sort) == 0 {
106
+	sort := int64(dataBody["sort"].(float64))
107
+	if sort <= 0 {
100
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
108
 		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
101
 		return
109
 		return
102
 	}
110
 	}
103
-	sortt, err := strconv.ParseInt(sort, 10, 64)
104
-	fmt.Println("排序:",sortt)
111
+
105
 	rotationImages := dataBody["rotationImages"]
112
 	rotationImages := dataBody["rotationImages"]
106
 	//图片数组转为字符串保存到数据库
113
 	//图片数组转为字符串保存到数据库
107
-	replace := strings.Replace(strings.Trim(fmt.Sprint(rotationImages), "[]"), " ", ",", -1)
114
+	images := strings.Replace(strings.Trim(fmt.Sprint(rotationImages), "[]"), " ", ",", -1)
108
 	fmt.Println("姓名:",rotationImages)
115
 	fmt.Println("姓名:",rotationImages)
109
-	fmt.Println("字符串",replace)
110
-
111
-
116
+	fmt.Println("字符串",images)
112
 
117
 
113
 	model := models.SgjPatientModel{
118
 	model := models.SgjPatientModel{
114
 		Title:     title,
119
 		Title:     title,
115
-		Sort:      sortt,
120
+		Sort:      sort,
116
 		UserOrgId: userOrgID,
121
 		UserOrgId: userOrgID,
117
 		Status:    1,
122
 		Status:    1,
118
 		Ctime:     time.Now().Unix(),
123
 		Ctime:     time.Now().Unix(),
125
 	fmt.Println("patientModel是什麽",patientModel)
130
 	fmt.Println("patientModel是什麽",patientModel)
126
 	rotation := models.SgjPatientRotation{
131
 	rotation := models.SgjPatientRotation{
127
 		Title:          title,
132
 		Title:          title,
128
-		Sort:           sortt,
129
-		RotationImages: replace,
133
+		Sort:           sort,
134
+		RotationImages: images,
130
 		UserOrgId:      userOrgID,
135
 		UserOrgId:      userOrgID,
131
 		Status:         1,
136
 		Status:         1,
132
 		Ctime:          time.Now().Unix(),
137
 		Ctime:          time.Now().Unix(),
1876
 	adminUserInfo := this.GetAdminUserInfo()
1881
 	adminUserInfo := this.GetAdminUserInfo()
1877
 	userOrgID := int64(adminUserInfo.CurrentOrgId)
1882
 	userOrgID := int64(adminUserInfo.CurrentOrgId)
1878
 	ordmodel, err := site_service.GetOrederModel(userOrgID)
1883
 	ordmodel, err := site_service.GetOrederModel(userOrgID)
1879
-	fmt.Println("马文强错误是什么",err)
1884
+
1880
 	if err !=nil{
1885
 	if err !=nil{
1881
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
1886
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
1882
 		return
1887
 		return
1886
 	})
1891
 	})
1887
 }
1892
 }
1888
 
1893
 
1894
+func  (this *Microwebsite) AddRotationpic()  {
1895
+	adminUserInfo := this.GetAdminUserInfo()
1896
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
1897
+	fmt.Println("机构ID",userOrgID)
1898
+	dataBody := make(map[string]interface{}, 0)
1899
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
1900
+	if err != nil {
1901
+		utils.ErrorLog(err.Error())
1902
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
1903
+		return
1904
+	}
1905
+	images := dataBody["Images"].(string)
1906
+	fmt.Println("图片",images)
1907
+	if len(images) == 0 {
1908
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片不能为空")
1909
+		return
1910
+	}
1911
+
1912
+	sort := int64(dataBody["sort"].(float64))
1913
+	if sort <= 0 {
1914
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序不能为空")
1915
+		return
1916
+	}
1917
+    fmt.Println("排序",sort)
1918
+	piclink := int64(dataBody["piclink"].(float64))
1919
+	if piclink <= 0 {
1920
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片链接不能为空")
1921
+		return
1922
+	}
1923
+    fmt.Println("图片链接",piclink)
1924
+	linkaddress := dataBody["linkaddress"].(string)
1925
+	if len(linkaddress) == 0 {
1926
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "链接地址不能为空")
1927
+		return
1928
+	}
1929
+	fmt.Println("链接地址",piclink)
1930
+
1931
+	conrotation := models.SgjPatientConrotation{
1932
+		Images:      images,
1933
+		Sort:        sort,
1934
+		Piclink:     piclink,
1935
+		Linkaddress: linkaddress,
1936
+		Status:      1,
1937
+		Ctime:       time.Now().Unix(),
1938
+		UserOrgId:   userOrgID,
1939
+	}
1940
+
1941
+	err = site_service.AddRotationpic(conrotation)
1942
+	if err !=nil{
1943
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
1944
+		return
1945
+	}
1946
+	this.ServeSuccessJSON(map[string]interface{}{
1947
+		"conrotation":conrotation,
1948
+	})
1949
+}
1950
+
1951
+func (this *Microwebsite) GetRotationimages()  {
1952
+	adminUserInfo := this.GetAdminUserInfo()
1953
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
1954
+	conrotations, err := site_service.GetRotationImages(userOrgID)
1955
+	if err !=nil{
1956
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
1957
+		return
1958
+	}
1959
+	this.ServeSuccessJSON(map[string]interface{}{
1960
+		"conrotations":conrotations,
1961
+	})
1962
+}
1963
+
1964
+func (this *Microwebsite) AddrotationImage()  {
1965
+	adminUserInfo := this.GetAdminUserInfo()
1966
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
1967
+	dataBody := make(map[string]interface{}, 0)
1968
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
1969
+	if err != nil {
1970
+		utils.ErrorLog(err.Error())
1971
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
1972
+		return
1973
+	}
1974
+	title := dataBody["title"].(string)
1975
+	fmt.Println("模块标题",title)
1976
+	if len(title) == 0 {
1977
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
1978
+		return
1979
+	}
1980
+
1981
+	sort := int64(dataBody["sort"].(float64))
1982
+	if sort<=0{
1983
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong,"排序不能为空")
1984
+		return
1985
+	}
1986
+    fmt.Println("排序",sort)
1987
+	rotationImages := dataBody["rotationImages"]
1988
+	fmt.Println("图片",rotationImages)
1989
+	images := strings.Replace(strings.Trim(fmt.Sprint(rotationImages), "[]"), " ", ",", -1)
1990
+	fmt.Println("images",images)
1991
+	ordmodel := models.SgjPatientOrdmodel{
1992
+		Title:    title,
1993
+		Sort:     sort,
1994
+		ModeType: 1,
1995
+		Ctime:time.Now().Unix(),
1996
+		Status:1,
1997
+		UserOrgId:userOrgID,
1998
+	}
1999
+	err = site_service.AddOrdModel(&ordmodel)
2000
+	patientOrdmodel, err := site_service.QueryOrdeModelByID(userOrgID)
2001
+	oldrotation := models.SgjPatientOldrotation{
2002
+		Title:          title,
2003
+		Sort:           sort,
2004
+		RotationImages: images,
2005
+		ModeId:         patientOrdmodel.ID,
2006
+		Status:         1,
2007
+		UserOrgId:      userOrgID,
2008
+		Ctime:          time.Now().Unix(),
2009
+	}
2010
+	err = site_service.AddrotationImage(&oldrotation)
2011
+	if err !=nil{
2012
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
2013
+		return
2014
+	}
2015
+	this.ServeSuccessJSON(map[string]interface{}{
2016
+		"oldrotation":oldrotation,
2017
+	})
2018
+}
2019
+
2020
+func (this *Microwebsite)  AddImageslink()  {
2021
+	adminUserInfo := this.GetAdminUserInfo()
2022
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
2023
+	dataBody := make(map[string]interface{}, 0)
2024
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
2025
+	if err != nil {
2026
+		utils.ErrorLog(err.Error())
2027
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
2028
+		return
2029
+	}
2030
+	imageUrl := dataBody["imageUrl"].(string)
2031
+	fmt.Println("图片编辑",imageUrl)
2032
+	if len(imageUrl) == 0 {
2033
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
2034
+		return
2035
+	}
2036
+	sort := int64(dataBody["sort"].(float64))
2037
+	fmt.Println("排序",sort)
2038
+	if sort <= 0 {
2039
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序不能为空")
2040
+		return
2041
+	}
2042
+	imagelink :=int64(dataBody["imagelink"].(float64))
2043
+	if imagelink <= 0 {
2044
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片链接不能为空")
2045
+		return
2046
+	}
2047
+	fmt.Println("图片链接",imagelink)
2048
+	linkaddress := dataBody["linkaddress"].(string)
2049
+	if len(linkaddress) == 0 {
2050
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "链接地址不能为空")
2051
+		return
2052
+	}
2053
+
2054
+	editpiclink := models.SgjPatientEditpiclink{
2055
+		Images:      imageUrl,
2056
+		Sort:        sort,
2057
+		Piclink:     imagelink,
2058
+		Linkaddress: linkaddress,
2059
+		Status:      1,
2060
+		Ctime:       time.Now().Unix(),
2061
+		UserOrgId:   userOrgID,
2062
+	}
2063
+
2064
+	err = site_service.AddImageslink(&editpiclink)
2065
+	if err !=nil{
2066
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
2067
+		return
2068
+	}
2069
+	this.ServeSuccessJSON(map[string]interface{}{
2070
+		"editpiclink":editpiclink,
2071
+	})
2072
+}
2073
+
2074
+func (this *Microwebsite) GetEditImages()  {
2075
+	adminUserInfo := this.GetAdminUserInfo()
2076
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
2077
+	editpiclinks, err := site_service.GetEditImages(userOrgID)
2078
+	fmt.Println("查询到的数据",editpiclinks,err)
2079
+	if err !=nil{
2080
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
2081
+		return
2082
+	}
2083
+	this.ServeSuccessJSON(map[string]interface{}{
2084
+		"editpiclinks":editpiclinks,
2085
+	})
2086
+}
2087
+
2088
+func (this *Microwebsite) AddMagicNavi()  {
2089
+	adminUserInfo := this.GetAdminUserInfo()
2090
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
2091
+	fmt.Println("这个是",userOrgID)
2092
+	dataBody := make(map[string]interface{}, 0)
2093
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
2094
+	if err != nil {
2095
+		utils.ErrorLog(err.Error())
2096
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
2097
+		return
2098
+	}
2099
+	margtitle := dataBody["margtitle"].(string)
2100
+	fmt.Println("导航标题",margtitle)
2101
+	if len(margtitle) == 0 {
2102
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "导航标题不能为空")
2103
+		return
2104
+	}
2105
+	margImage := dataBody["margImage"].(string)
2106
+	fmt.Println("导航图标",margImage)
2107
+	if len(margtitle) == 0 {
2108
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "导航图标不能为空")
2109
+		return
2110
+	}
2111
+	jumpset := int64(dataBody["jumpset"].(float64))
2112
+	fmt.Println("跳转设置",jumpset)
2113
+	if len(margtitle) == 0 {
2114
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "跳转设置不能为空")
2115
+		return
2116
+	}
2117
+	marginaddress := dataBody["marginaddress"].(string)
2118
+	fmt.Println("链接地址",marginaddress)
2119
+	if len(marginaddress) == 0 {
2120
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "导航图标不能为空")
2121
+		return
2122
+	}
2123
+
2124
+	editmargin := models.SgjPatientEditmargin{
2125
+		Margtitle:     margtitle,
2126
+		Margimage:     margImage,
2127
+		Jumpset:       jumpset,
2128
+		Marginaddress: marginaddress,
2129
+		Status:        1,
2130
+		Ctime:         time.Now().Unix(),
2131
+		UserOrgId:     userOrgID,
2132
+	}
2133
+
2134
+	err = site_service.AddMagicNavi(&editmargin)
2135
+	if err !=nil{
2136
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
2137
+		return
2138
+	}
2139
+	this.ServeSuccessJSON(map[string]interface{}{
2140
+		"editmargin":editmargin,
2141
+	})
2142
+}
2143
+
2144
+func (this *Microwebsite) GetMagicImages()  {
2145
+	adminUserInfo := this.GetAdminUserInfo()
2146
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
2147
+	editmargins, err := site_service.GetMagicImages(userOrgID)
2148
+	if err !=nil{
2149
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
2150
+		return
2151
+	}
2152
+	this.ServeSuccessJSON(map[string]interface{}{
2153
+		"editmargins":editmargins,
2154
+	})
2155
+}
2156
+
2157
+func (this *Microwebsite) AddMarginChart()  {
2158
+	adminUserInfo := this.GetAdminUserInfo()
2159
+	userOrgID := int64(adminUserInfo.CurrentOrgId)
2160
+	fmt.Println(userOrgID)
2161
+	dataBody := make(map[string]interface{}, 0)
2162
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
2163
+	if err != nil {
2164
+		utils.ErrorLog(err.Error())
2165
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
2166
+		return
2167
+	}
2168
+	title := dataBody["title"].(string)
2169
+	fmt.Println("图片编辑",title)
2170
+	if len(title) == 0 {
2171
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
2172
+		return
2173
+	}
2174
+	sort := int64(dataBody["sort"].(float64))
2175
+	fmt.Println("排序",sort)
2176
+	if  sort <= 0 {
2177
+		this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
2178
+		return
2179
+	}
2180
+	macimages := dataBody["marginImages"]
2181
+	images := strings.Replace(strings.Trim(fmt.Sprint(macimages), "[]"), " ", ",", -1)
2182
+	fmt.Println("images",images)
2183
+	model := models.SgjPatientModel{
2184
+		Title:     title,
2185
+		Sort:      sort,
2186
+		UserOrgId: userOrgID,
2187
+		Status:    1,
2188
+		Ctime:     time.Now().Unix(),
2189
+		ModeType:  8,
2190
+	}
2191
+	site_service.AddPatientModel(&model)
2192
+	fmt.Println("rotation是什么",model)
2193
+	patientModel, err := site_service.QueryModel(userOrgID)
2194
+	macnavigation := models.SgjPatientMacnavigation{
2195
+		Title:     title,
2196
+		Sort:      sort,
2197
+		MacImages: images,
2198
+		Modeid:    patientModel.ID,
2199
+		Status:    1,
2200
+		Ctime:     time.Now().Unix(),
2201
+		UserOrgId: userOrgID,
2202
+	}
1889
 
2203
 
2204
+	err = site_service.AddMarginChart(&macnavigation)
2205
+	if err !=nil{
2206
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
2207
+		return
2208
+	}
2209
+	this.ServeSuccessJSON(map[string]interface{}{
2210
+		"macnavigation":macnavigation,
2211
+	})
2212
+}

+ 91 - 2
models/site_models.go View File

29
 	Hospitals     SgjPatientHospital `gorm:"ForeignKey:Modleid"`
29
 	Hospitals     SgjPatientHospital `gorm:"ForeignKey:Modleid"`
30
 	Offices     SgjPatientOffices `gorm:"ForeignKey:Modleid"`
30
 	Offices     SgjPatientOffices `gorm:"ForeignKey:Modleid"`
31
 	Doctors     SgjPatientDocinfo `gorm:"ForeignKey:Modelid"`
31
 	Doctors     SgjPatientDocinfo `gorm:"ForeignKey:Modelid"`
32
-	OfficeEnviroment   []SgjPatientOffenvironment  `gorm:"ForeignKey:Modelid"`
32
+	OfficeEnviroment   SgjPatientOffenvironment  `gorm:"ForeignKey:Modelid"`
33
 	Editdoctor   []SgjPatientEditdoctor  `gorm:"ForeignKey:Modleid"`
33
 	Editdoctor   []SgjPatientEditdoctor  `gorm:"ForeignKey:Modleid"`
34
+	Rotation     SgjPatientRotation  `gorm:"ForeignKey:ModelId"`
35
+	Macnavigation  SgjPatientMacnavigation `gorm:"ForeignKey:Modeid"`
34
 
36
 
35
 }
37
 }
36
 func (SgjPatientModel) TableName() string{
38
 func (SgjPatientModel) TableName() string{
233
 	Connectway     []SgjPatientConnectway `gorm:"ForeignKey:ModeId"`
235
 	Connectway     []SgjPatientConnectway `gorm:"ForeignKey:ModeId"`
234
 	Worktime     SgjPatientWorktime `gorm:"ForeignKey:ModeId"`
236
 	Worktime     SgjPatientWorktime `gorm:"ForeignKey:ModeId"`
235
 	Rideway  SgjPatientRideway `gorm:"ForeignKey:ModeId"`
237
 	Rideway  SgjPatientRideway `gorm:"ForeignKey:ModeId"`
238
+	Oldration  SgjPatientOldrotation `gorm:"ForeignKey:ModeId"`
236
 
239
 
237
 }
240
 }
238
 
241
 
290
 func (SgjPatientRideway)TableName() string{
293
 func (SgjPatientRideway)TableName() string{
291
 
294
 
292
 	return "sgj_patient_rideway"
295
 	return "sgj_patient_rideway"
293
-}
296
+}
297
+
298
+type SgjPatientConrotation struct {
299
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
300
+	Images string `gorm:"column:images" json:"images" form:"images"`
301
+	Sort int64 `gorm:"column:sort" json:"sort" form:"sort"`
302
+	Piclink int64 `gorm:"column:piclink" json:"piclink" form:"piclink"`
303
+	Linkaddress string `gorm:"column:linkaddress" json:"linkaddress" form:"linkaddress"`
304
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
305
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
306
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
307
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
308
+}
309
+
310
+func (SgjPatientConrotation) TableName() string  {
311
+
312
+	return "sgj_patient_conrotation"
313
+}
314
+
315
+type SgjPatientOldrotation struct {
316
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
317
+	Title string `gorm:"column:title" json:"title" form:"title"`
318
+	Sort int64 `gorm:"column:sort" json:"sort" form:"sort"`
319
+	RotationImages string `gorm:"column:rotation_images" json:"rotation_images" form:"rotation_images"`
320
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
321
+	ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
322
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
323
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
324
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
325
+}
326
+
327
+func (SgjPatientOldrotation) TableName() string {
328
+
329
+	return "sgj_patient_oldrotation"
330
+}
331
+
332
+type SgjPatientEditpiclink struct {
333
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
334
+	Images string `gorm:"column:images" json:"images" form:"images"`
335
+	Sort int64 `gorm:"column:sort" json:"sort" form:"sort"`
336
+	Piclink int64 `gorm:"column:piclink" json:"piclink" form:"piclink"`
337
+	Linkaddress string `gorm:"column:linkaddress" json:"linkaddress" form:"linkaddress"`
338
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
339
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
340
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
341
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
342
+}
343
+
344
+func (SgjPatientEditpiclink) TableName() string  {
345
+
346
+	return "sgj_patient_editpiclink"
347
+}
348
+
349
+type SgjPatientEditmargin struct {
350
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
351
+	Margtitle string `gorm:"column:margtitle" json:"margtitle" form:"margtitle"`
352
+	Margimage string `gorm:"column:margimage" json:"margimage" form:"margimage"`
353
+	Marginaddress string `gorm:"column:marginaddress" json:"marginaddress" form:"marginaddress"`
354
+	Jumpset int64 `gorm:"column:jumpset" json:"jumpset" form:"jumpset"`
355
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
356
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
357
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
358
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
359
+}
360
+
361
+func (SgjPatientEditmargin) TableName() string {
362
+
363
+	return "sgj_patient_editmargin"
364
+}
365
+
366
+type SgjPatientMacnavigation struct {
367
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
368
+	Title string `gorm:"column:title" json:"title" form:"title"`
369
+	Sort int64 `gorm:"column:sort" json:"sort" form:"sort"`
370
+	MacImages string `gorm:"column:mac_images" json:"mac_images" form:"mac_images"`
371
+	Modeid int64 `gorm:"column:modeid" json:"modeid" form:"modeid"`
372
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
373
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
374
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
375
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
376
+}
377
+
378
+func (SgjPatientMacnavigation) TableName() string {
379
+
380
+	return "sgj_patient_macnavigation"
381
+}
382
+

+ 42 - 11
service/site_service/site_microwebsite_service.go View File

239
 	if(orgid > 0){
239
 	if(orgid > 0){
240
 		db = db.Where("user_org_id = ? ", orgid)
240
 		db = db.Where("user_org_id = ? ", orgid)
241
 	}
241
 	}
242
-	err = db.Preload("Hospitals").Preload("Offices").Preload("Doctors").Preload("OfficeEnviroment").Preload("Editdoctor").
242
+	err = db.Preload("Hospitals").Preload("Offices").Preload("Doctors").Preload("OfficeEnviroment").
243
+		Preload("Editdoctor").Preload("Rotation").Preload("Macnavigation").
243
 		Select("m.id,m.title,m.sort,m.ctime,m.mtime,m.user_org_id,m.status,m.mode_type").Order("sort").Find(&model).Error
244
 		Select("m.id,m.title,m.sort,m.ctime,m.mtime,m.user_org_id,m.status,m.mode_type").Order("sort").Find(&model).Error
244
 	return
245
 	return
245
 }
246
 }
372
 	if(orgid > 0){
373
 	if(orgid > 0){
373
 		db = db.Where("user_org_id = ?", orgid)
374
 		db = db.Where("user_org_id = ?", orgid)
374
 	}
375
 	}
375
-	err = db.Preload("Connectway").Preload("Worktime").Preload("Rideway").
376
+	err = db.Preload("Connectway").Preload("Worktime").Preload("Rideway").Preload("Oldration").
376
 		Select("o.id,o.title,o.sort,o.ctime,o.mtime,o.mode_type").Order("sort").Find(&model).Error
377
 		Select("o.id,o.title,o.sort,o.ctime,o.mtime,o.mode_type").Order("sort").Find(&model).Error
377
     fmt.Println("sql错误是什么",err)
378
     fmt.Println("sql错误是什么",err)
378
 	return
379
 	return
379
 
380
 
380
 }
381
 }
381
 
382
 
382
-//func GetData(orgid int64)(model []*models.SgjPatientModel,err error)  {
383
-//	db := service.PatientReadDB().Table("sgj_patient_model as m").Where(" m.status = ?", 1)
384
-//	if(orgid > 0){
385
-//		db = db.Where("user_org_id = ? ", orgid)
386
-//	}
387
-//	err = db.Preload("Hospitals").Preload("Offices").Preload("Doctors").Preload("OfficeEnviroment").Preload("Editdoctor").
388
-//		Select("m.id,m.title,m.sort,m.ctime,m.mtime,m.user_org_id,m.status,m.mode_type").Order("sort").Find(&model).Error
389
-//	return
390
-//}
383
+func AddRotationpic(conrotation models.SgjPatientConrotation) error  {
384
+	err := service.PatientWriteDB().Create(&conrotation).Error
385
+	return  err
386
+}
387
+
388
+func GetRotationImages(orgid int64)(conrotation []models.SgjPatientConrotation,err error)  {
389
+	err = service.PatientReadDB().Model(&conrotation).Where("user_org_id = ? AND status = ?", orgid, 1).Find(&conrotation).Error
390
+	return conrotation,err
391
+}
392
+
393
+func AddrotationImage(oldrotation *models.SgjPatientOldrotation) error {
394
+	err := service.PatientWriteDB().Create(&oldrotation).Error
395
+	return  err
396
+}
397
+
398
+func AddImageslink(editpiclink *models.SgjPatientEditpiclink) error  {
399
+	err := service.PatientWriteDB().Create(&editpiclink).Error
400
+	return  err
401
+}
391
 
402
 
403
+func GetEditImages(orgid int64)(editpiclink []models.SgjPatientEditpiclink,err error)  {
404
+	err = service.PatientReadDB().Model(&editpiclink).Where("user_org_id = ? AND status = ?",orgid,1).Find(&editpiclink).Error
405
+	return editpiclink,err
406
+}
407
+
408
+func AddMagicNavi(editmargin *models.SgjPatientEditmargin) error {
409
+	err := service.PatientWriteDB().Create(&editmargin).Error
410
+	return err
411
+}
412
+
413
+func GetMagicImages(orgid int64)( editmargin []models.SgjPatientEditmargin,err error)  {
414
+	err = service.PatientReadDB().Model(&editmargin).Where("user_org_id = ? AND status = ?", orgid, 1).Find(&editmargin).Error
415
+	return editmargin,err
416
+}
417
+
418
+func AddMarginChart(macnavigation *models.SgjPatientMacnavigation) error  {
419
+
420
+	err := service.PatientWriteDB().Create(&macnavigation).Error
421
+	return err
422
+}