瀏覽代碼

时间选择更新

XMLWAN 4 年之前
父節點
當前提交
fbcd979593

+ 20 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

@@ -1606,8 +1606,11 @@ func (this *NewDialysisApiController) SaveFeed() {
1606 1606
 	fmt.Print("phone", phone)
1607 1607
 	times, _ := this.GetInt64("time")
1608 1608
 	fmt.Print("time", times)
1609
+	adminuserid, _ := this.GetInt64("admin_user_id")
1610
+	fmt.Println("admin", adminuserid)
1609 1611
 	adminUser := this.GetMobileAdminUserInfo()
1610 1612
 	orgid := adminUser.Org.Id
1613
+	appid := adminUser.App.Id
1611 1614
 	feedback := models.XtPatientFeedback{
1612 1615
 		ProblemType: question,
1613 1616
 		Title:       title,
@@ -1617,6 +1620,8 @@ func (this *NewDialysisApiController) SaveFeed() {
1617 1620
 		UserOrgId:   orgid,
1618 1621
 		Ctime:       time.Now().Unix(),
1619 1622
 		Status:      1,
1623
+		AdminUserId: adminuserid,
1624
+		AppId:       appid,
1620 1625
 	}
1621 1626
 	err := service.CreateFeedBack(&feedback)
1622 1627
 	if err != nil {
@@ -1640,3 +1645,18 @@ func (this *NewDialysisApiController) DeleteInspection() {
1640 1645
 	this.ServeSuccessJSON(returnData)
1641 1646
 	return
1642 1647
 }
1648
+
1649
+func (this *NewDialysisApiController) DeleteChildInspection() {
1650
+	admininfo := this.GetMobileAdminUserInfo()
1651
+	orgid := admininfo.Org.Id
1652
+	name := this.GetString("name")
1653
+	fmt.Println("name", name)
1654
+	date, _ := this.GetInt64("date")
1655
+	fmt.Println("date", date)
1656
+	err := service.DeleteChildInspection(name, date, orgid)
1657
+	fmt.Println("删除失败", err)
1658
+	returnData := make(map[string]interface{}, 0)
1659
+	returnData["msg"] = "手机号码已存在"
1660
+	this.ServeSuccessJSON(returnData)
1661
+	return
1662
+}

+ 1 - 0
controllers/new_mobile_api_controllers/new_mobile_api_router_register.go 查看文件

@@ -100,4 +100,5 @@ func NewMobileAPIControllersRegisterRouters() {
100 100
 	beego.Router("/m/api/patient/savefeed", &NewDialysisApiController{}, "Get:SaveFeed")
101 101
 	beego.Router("/m/api/patient/deletechild", &NewDialysisApiController{}, "Delete:DeleteChild")
102 102
 	beego.Router("/m/api/patient/deleteinspection", &NewDialysisApiController{}, "Delete:DeleteInspection")
103
+	beego.Router("/m/api/patient/deletechildinspection", &NewDialysisApiController{}, "Delete:DeleteChildInspection")
103 104
 }

+ 6 - 0
service/patientmanage_service.go 查看文件

@@ -979,3 +979,9 @@ func DeleteInspection(date int64, orgid int64) error {
979 979
 	err := XTWriteDB().Model(models.Inspection{}).Where("inspect_date = ? and org_id = ?", date, orgid).Update(map[string]interface{}{"status": 0, "updated_time": time.Now().Unix()}).Error
980 980
 	return err
981 981
 }
982
+
983
+func DeleteChildInspection(name string, date int64, orgid int64) error {
984
+
985
+	err := XTWriteDB().Model(models.Inspection{}).Where("project_name = ? and inspect_date = ? and org_id = ?", name, date, orgid).Update(map[string]interface{}{"status": 0, "updated_time": time.Now().Unix()}).Error
986
+	return err
987
+}