Browse Source

体积小

XMLWAN 3 years ago
parent
commit
35d62ef290

+ 65 - 65
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

@@ -254,71 +254,71 @@ func (this *XcxApiController) GetScheduleInfo() {
254 254
 		return
255 255
 	}
256 256
 	array := []interface{}{
257
-		map[string]string{"schedule_type": "1", "schedule_date": "1630252800", "schedule_week": "", "mode_id": ""},
258
-		map[string]string{"schedule_type": "2", "schedule_date": "1630252800", "schedule_week": "", "mode_id": ""},
259
-		map[string]string{"schedule_type": "3", "schedule_date": "1630252800", "schedule_week": "", "mode_id": ""},
260
-		map[string]string{"schedule_type": "1", "schedule_date": "1630339200", "schedule_week": "", "mode_id": ""},
261
-		map[string]string{"schedule_type": "2", "schedule_date": "1630339200", "schedule_week": "", "mode_id": ""},
262
-		map[string]string{"schedule_type": "3", "schedule_date": "1630339200", "schedule_week": "", "mode_id": ""},
263
-		map[string]string{"schedule_type": "1", "schedule_date": "1630425600", "schedule_week": "", "mode_id": ""},
264
-		map[string]string{"schedule_type": "2", "schedule_date": "1630425600", "schedule_week": "", "mode_id": ""},
265
-		map[string]string{"schedule_type": "3", "schedule_date": "1630425600", "schedule_week": "", "mode_id": ""},
266
-		map[string]string{"schedule_type": "1", "schedule_date": "1630512000", "schedule_week": "", "mode_id": ""},
267
-		map[string]string{"schedule_type": "2", "schedule_date": "1630512000", "schedule_week": "", "mode_id": ""},
268
-		map[string]string{"schedule_type": "3", "schedule_date": "1630512000", "schedule_week": "", "mode_id": ""},
269
-		map[string]string{"schedule_type": "1", "schedule_date": "1630598400", "schedule_week": "", "mode_id": ""},
270
-		map[string]string{"schedule_type": "2", "schedule_date": "1630598400", "schedule_week": "", "mode_id": ""},
271
-		map[string]string{"schedule_type": "3", "schedule_date": "1630598400", "schedule_week": "", "mode_id": ""},
272
-		map[string]string{"schedule_type": "1", "schedule_date": "1630684800", "schedule_week": "", "mode_id": ""},
273
-		map[string]string{"schedule_type": "2", "schedule_date": "1630684800", "schedule_week": "", "mode_id": ""},
274
-		map[string]string{"schedule_type": "3", "schedule_date": "1630684800", "schedule_week": "", "mode_id": ""},
275
-		map[string]string{"schedule_type": "1", "schedule_date": "1630771200", "schedule_week": "", "mode_id": ""},
276
-		map[string]string{"schedule_type": "2", "schedule_date": "1630771200", "schedule_week": "", "mode_id": ""},
277
-		map[string]string{"schedule_type": "3", "schedule_date": "1630771200", "schedule_week": "", "mode_id": ""},
278
-
279
-		map[string]string{"schedule_type": "1", "schedule_date": "1630857600", "schedule_week": "", "mode_id": ""},
280
-		map[string]string{"schedule_type": "2", "schedule_date": "1630857600", "schedule_week": "", "mode_id": ""},
281
-		map[string]string{"schedule_type": "3", "schedule_date": "1630857600", "schedule_week": "", "mode_id": ""},
282
-		map[string]string{"schedule_type": "1", "schedule_date": "1630944000", "schedule_week": "", "mode_id": ""},
283
-		map[string]string{"schedule_type": "2", "schedule_date": "1630944000", "schedule_week": "", "mode_id": ""},
284
-		map[string]string{"schedule_type": "3", "schedule_date": "1630944000", "schedule_week": "", "mode_id": ""},
285
-		map[string]string{"schedule_type": "1", "schedule_date": "1631030400", "schedule_week": "", "mode_id": ""},
286
-		map[string]string{"schedule_type": "2", "schedule_date": "1631030400", "schedule_week": "", "mode_id": ""},
287
-		map[string]string{"schedule_type": "3", "schedule_date": "1631030400", "schedule_week": "", "mode_id": ""},
288
-		map[string]string{"schedule_type": "1", "schedule_date": "1631116800", "schedule_week": "", "mode_id": ""},
289
-		map[string]string{"schedule_type": "2", "schedule_date": "1631116800", "schedule_week": "", "mode_id": ""},
290
-		map[string]string{"schedule_type": "3", "schedule_date": "1631116800", "schedule_week": "", "mode_id": ""},
291
-		map[string]string{"schedule_type": "1", "schedule_date": "1631203200", "schedule_week": "", "mode_id": ""},
292
-		map[string]string{"schedule_type": "2", "schedule_date": "1631203200", "schedule_week": "", "mode_id": ""},
293
-		map[string]string{"schedule_type": "3", "schedule_date": "1631203200", "schedule_week": "", "mode_id": ""},
294
-		map[string]string{"schedule_type": "1", "schedule_date": "1631289600", "schedule_week": "", "mode_id": ""},
295
-		map[string]string{"schedule_type": "2", "schedule_date": "1631289600", "schedule_week": "", "mode_id": ""},
296
-		map[string]string{"schedule_type": "3", "schedule_date": "1631289600", "schedule_week": "", "mode_id": ""},
297
-		map[string]string{"schedule_type": "1", "schedule_date": "1631376000", "schedule_week": "", "mode_id": ""},
298
-		map[string]string{"schedule_type": "2", "schedule_date": "1631376000", "schedule_week": "", "mode_id": ""},
299
-		map[string]string{"schedule_type": "3", "schedule_date": "1631376000", "schedule_week": "", "mode_id": ""},
300
-
301
-		map[string]string{"schedule_type": "1", "schedule_date": "1631462400", "schedule_week": "", "mode_id": ""},
302
-		map[string]string{"schedule_type": "2", "schedule_date": "1631462400", "schedule_week": "", "mode_id": ""},
303
-		map[string]string{"schedule_type": "3", "schedule_date": "1631462400", "schedule_week": "", "mode_id": ""},
304
-		map[string]string{"schedule_type": "1", "schedule_date": "1631548800", "schedule_week": "", "mode_id": ""},
305
-		map[string]string{"schedule_type": "2", "schedule_date": "1631548800", "schedule_week": "", "mode_id": ""},
306
-		map[string]string{"schedule_type": "3", "schedule_date": "1631548800", "schedule_week": "", "mode_id": ""},
307
-		map[string]string{"schedule_type": "1", "schedule_date": "1631635200", "schedule_week": "", "mode_id": ""},
308
-		map[string]string{"schedule_type": "2", "schedule_date": "1631635200", "schedule_week": "", "mode_id": ""},
309
-		map[string]string{"schedule_type": "3", "schedule_date": "1631635200", "schedule_week": "", "mode_id": ""},
310
-		map[string]string{"schedule_type": "1", "schedule_date": "1631721600", "schedule_week": "", "mode_id": ""},
311
-		map[string]string{"schedule_type": "2", "schedule_date": "1631721600", "schedule_week": "", "mode_id": ""},
312
-		map[string]string{"schedule_type": "3", "schedule_date": "1631721600", "schedule_week": "", "mode_id": ""},
313
-		map[string]string{"schedule_type": "1", "schedule_date": "1631808000", "schedule_week": "", "mode_id": ""},
314
-		map[string]string{"schedule_type": "2", "schedule_date": "1631808000", "schedule_week": "", "mode_id": ""},
315
-		map[string]string{"schedule_type": "3", "schedule_date": "1631808000", "schedule_week": "", "mode_id": ""},
316
-		map[string]string{"schedule_type": "1", "schedule_date": "1631894400", "schedule_week": "", "mode_id": ""},
317
-		map[string]string{"schedule_type": "2", "schedule_date": "1631894400", "schedule_week": "", "mode_id": ""},
318
-		map[string]string{"schedule_type": "3", "schedule_date": "1631894400", "schedule_week": "", "mode_id": ""},
319
-		map[string]string{"schedule_type": "1", "schedule_date": "1631980800", "schedule_week": "", "mode_id": ""},
320
-		map[string]string{"schedule_type": "2", "schedule_date": "1631980800", "schedule_week": "", "mode_id": ""},
321
-		map[string]string{"schedule_type": "3", "schedule_date": "1631980800", "schedule_week": "", "mode_id": ""},
257
+		map[string]string{"schedule_type": "1", "schedule_date": "1630252800", "schedule_week": "1", "mode_id": "", "name": ""},
258
+		map[string]string{"schedule_type": "2", "schedule_date": "1630252800", "schedule_week": "1", "mode_id": "", "name": ""},
259
+		map[string]string{"schedule_type": "3", "schedule_date": "1630252800", "schedule_week": "1", "mode_id": "", "name": ""},
260
+		map[string]string{"schedule_type": "1", "schedule_date": "1630339200", "schedule_week": "2", "mode_id": "", "name": ""},
261
+		map[string]string{"schedule_type": "2", "schedule_date": "1630339200", "schedule_week": "2", "mode_id": "", "name": ""},
262
+		map[string]string{"schedule_type": "3", "schedule_date": "1630339200", "schedule_week": "2", "mode_id": "", "name": ""},
263
+		map[string]string{"schedule_type": "1", "schedule_date": "1630425600", "schedule_week": "3", "mode_id": "", "name": ""},
264
+		map[string]string{"schedule_type": "2", "schedule_date": "1630425600", "schedule_week": "3", "mode_id": "", "name": ""},
265
+		map[string]string{"schedule_type": "3", "schedule_date": "1630425600", "schedule_week": "3", "mode_id": "", "name": ""},
266
+		map[string]string{"schedule_type": "1", "schedule_date": "1630512000", "schedule_week": "4", "mode_id": "", "name": ""},
267
+		map[string]string{"schedule_type": "2", "schedule_date": "1630512000", "schedule_week": "4", "mode_id": "", "name": ""},
268
+		map[string]string{"schedule_type": "3", "schedule_date": "1630512000", "schedule_week": "4", "mode_id": "", "name": ""},
269
+		map[string]string{"schedule_type": "1", "schedule_date": "1630598400", "schedule_week": "5", "mode_id": "", "name": ""},
270
+		map[string]string{"schedule_type": "2", "schedule_date": "1630598400", "schedule_week": "5", "mode_id": "", "name": ""},
271
+		map[string]string{"schedule_type": "3", "schedule_date": "1630598400", "schedule_week": "5", "mode_id": "", "name": ""},
272
+		map[string]string{"schedule_type": "1", "schedule_date": "1630684800", "schedule_week": "6", "mode_id": "", "name": ""},
273
+		map[string]string{"schedule_type": "2", "schedule_date": "1630684800", "schedule_week": "6", "mode_id": "", "name": ""},
274
+		map[string]string{"schedule_type": "3", "schedule_date": "1630684800", "schedule_week": "6", "mode_id": "", "name": ""},
275
+		map[string]string{"schedule_type": "1", "schedule_date": "1630771200", "schedule_week": "7", "mode_id": "", "name": ""},
276
+		map[string]string{"schedule_type": "2", "schedule_date": "1630771200", "schedule_week": "7", "mode_id": "", "name": ""},
277
+		map[string]string{"schedule_type": "3", "schedule_date": "1630771200", "schedule_week": "7", "mode_id": "", "name": ""},
278
+
279
+		map[string]string{"schedule_type": "1", "schedule_date": "1630857600", "schedule_week": "1", "mode_id": "", "name": ""},
280
+		map[string]string{"schedule_type": "2", "schedule_date": "1630857600", "schedule_week": "1", "mode_id": "", "name": ""},
281
+		map[string]string{"schedule_type": "3", "schedule_date": "1630857600", "schedule_week": "1", "mode_id": "", "name": ""},
282
+		map[string]string{"schedule_type": "1", "schedule_date": "1630944000", "schedule_week": "2", "mode_id": "", "name": ""},
283
+		map[string]string{"schedule_type": "2", "schedule_date": "1630944000", "schedule_week": "2", "mode_id": "", "name": ""},
284
+		map[string]string{"schedule_type": "3", "schedule_date": "1630944000", "schedule_week": "2", "mode_id": "", "name": ""},
285
+		map[string]string{"schedule_type": "1", "schedule_date": "1631030400", "schedule_week": "3", "mode_id": "", "name": ""},
286
+		map[string]string{"schedule_type": "2", "schedule_date": "1631030400", "schedule_week": "3", "mode_id": "", "name": ""},
287
+		map[string]string{"schedule_type": "3", "schedule_date": "1631030400", "schedule_week": "3", "mode_id": "", "name": ""},
288
+		map[string]string{"schedule_type": "1", "schedule_date": "1631116800", "schedule_week": "4", "mode_id": "", "name": ""},
289
+		map[string]string{"schedule_type": "2", "schedule_date": "1631116800", "schedule_week": "4", "mode_id": "", "name": ""},
290
+		map[string]string{"schedule_type": "3", "schedule_date": "1631116800", "schedule_week": "4", "mode_id": "", "name": ""},
291
+		map[string]string{"schedule_type": "1", "schedule_date": "1631203200", "schedule_week": "5", "mode_id": "", "name": ""},
292
+		map[string]string{"schedule_type": "2", "schedule_date": "1631203200", "schedule_week": "5", "mode_id": "", "name": ""},
293
+		map[string]string{"schedule_type": "3", "schedule_date": "1631203200", "schedule_week": "5", "mode_id": "", "name": ""},
294
+		map[string]string{"schedule_type": "1", "schedule_date": "1631289600", "schedule_week": "6", "mode_id": "", "name": ""},
295
+		map[string]string{"schedule_type": "2", "schedule_date": "1631289600", "schedule_week": "6", "mode_id": "", "name": ""},
296
+		map[string]string{"schedule_type": "3", "schedule_date": "1631289600", "schedule_week": "6", "mode_id": "", "name": ""},
297
+		map[string]string{"schedule_type": "1", "schedule_date": "1631376000", "schedule_week": "7", "mode_id": "", "name": ""},
298
+		map[string]string{"schedule_type": "2", "schedule_date": "1631376000", "schedule_week": "7", "mode_id": "", "name": ""},
299
+		map[string]string{"schedule_type": "3", "schedule_date": "1631376000", "schedule_week": "7", "mode_id": "", "name": ""},
300
+
301
+		map[string]string{"schedule_type": "1", "schedule_date": "1631462400", "schedule_week": "1", "mode_id": "", "name": ""},
302
+		map[string]string{"schedule_type": "2", "schedule_date": "1631462400", "schedule_week": "1", "mode_id": "", "name": ""},
303
+		map[string]string{"schedule_type": "3", "schedule_date": "1631462400", "schedule_week": "1", "mode_id": "", "name": ""},
304
+		map[string]string{"schedule_type": "1", "schedule_date": "1631548800", "schedule_week": "2", "mode_id": "", "name": ""},
305
+		map[string]string{"schedule_type": "2", "schedule_date": "1631548800", "schedule_week": "2", "mode_id": "", "name": ""},
306
+		map[string]string{"schedule_type": "3", "schedule_date": "1631548800", "schedule_week": "2", "mode_id": "", "name": ""},
307
+		map[string]string{"schedule_type": "1", "schedule_date": "1631635200", "schedule_week": "3", "mode_id": "", "name": ""},
308
+		map[string]string{"schedule_type": "2", "schedule_date": "1631635200", "schedule_week": "3", "mode_id": "", "name": ""},
309
+		map[string]string{"schedule_type": "3", "schedule_date": "1631635200", "schedule_week": "3", "mode_id": "", "name": ""},
310
+		map[string]string{"schedule_type": "1", "schedule_date": "1631721600", "schedule_week": "4", "mode_id": "", "name": ""},
311
+		map[string]string{"schedule_type": "2", "schedule_date": "1631721600", "schedule_week": "4", "mode_id": "", "name": ""},
312
+		map[string]string{"schedule_type": "3", "schedule_date": "1631721600", "schedule_week": "4", "mode_id": "", "name": ""},
313
+		map[string]string{"schedule_type": "1", "schedule_date": "1631808000", "schedule_week": "5", "mode_id": "", "name": ""},
314
+		map[string]string{"schedule_type": "2", "schedule_date": "1631808000", "schedule_week": "5", "mode_id": "", "name": ""},
315
+		map[string]string{"schedule_type": "3", "schedule_date": "1631808000", "schedule_week": "5", "mode_id": "", "name": ""},
316
+		map[string]string{"schedule_type": "1", "schedule_date": "1631894400", "schedule_week": "6", "mode_id": "", "name": ""},
317
+		map[string]string{"schedule_type": "2", "schedule_date": "1631894400", "schedule_week": "6", "mode_id": "", "name": ""},
318
+		map[string]string{"schedule_type": "3", "schedule_date": "1631894400", "schedule_week": "6", "mode_id": "", "name": ""},
319
+		map[string]string{"schedule_type": "1", "schedule_date": "1631980800", "schedule_week": "7", "mode_id": "", "name": ""},
320
+		map[string]string{"schedule_type": "2", "schedule_date": "1631980800", "schedule_week": "7", "mode_id": "", "name": ""},
321
+		map[string]string{"schedule_type": "3", "schedule_date": "1631980800", "schedule_week": "7", "mode_id": "", "name": ""},
322 322
 	}
323 323
 	this.ServeSuccessJSON(map[string]interface{}{
324 324
 		"list":  schedule,

+ 0 - 1
models/xcx_user_models.go View File

@@ -114,7 +114,6 @@ func (XcxPatients) TableName() string {
114 114
 }
115 115
 
116 116
 type VmBloodSchedule struct {
117
-	PatientId    int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
118 117
 	ScheduleDate int64  `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
119 118
 	ScheduleType int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
120 119
 	ScheduleWeek int64  `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`

+ 1 - 4
service/xcx_mobile_api_service.go View File

@@ -210,9 +210,6 @@ func PKCS7UnPadding(origData []byte) []byte {
210 210
 
211 211
 func GetScheduleInfo(startime int64, endtime int64, patient_id int64) (schedule []*models.VmBloodSchedule, err error) {
212 212
 
213
-	//err = XTReadDB().Model(&schedule).Where("schedule_date >=? and schedule_date<=? and status = 1", startime, endtime, patient_id).Find(&schedule).Error
214
-	//return schedule,err
215
-
216 213
 	db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
217 214
 	table := XTReadDB().Table("xt_patients as t").Where("t.status = 1")
218 215
 	fmt.Println(table)
@@ -227,6 +224,6 @@ func GetScheduleInfo(startime int64, endtime int64, patient_id int64) (schedule
227 224
 		db = db.Where("x.patient_id = ?", patient_id)
228 225
 	}
229 226
 
230
-	err = db.Select("x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,t.name").Joins("left join xt_patients as t on t.id = x.patient_id").Scan(&schedule).Error
227
+	err = db.Select("x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,t.name").Joins("left join xt_patients as t on t.id = x.patient_id").Scan(&schedule).Error
231 228
 	return schedule, err
232 229
 }