Bladeren bron

耗材参数

XMLWAN 4 jaren geleden
bovenliggende
commit
b9eb49fef0

+ 6 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go Bestand weergeven

@@ -4740,7 +4740,12 @@ func (c *DialysisAPIController) BatchAdviceExecution() {
4740 4740
 	fmt.Println("dis22222222", ids)
4741 4741
 	idArray := strings.Split(ids, ",")
4742 4742
 	creator := c.GetAdminUserInfo().AdminUser.Id
4743
-	err := service.BatchAdviceExecution(idArray, creator)
4743
+	executionTime := c.GetString("execution_time")
4744
+	timeLayout := "2006-01-02 15:04:05"
4745
+	loc, _ := time.LoadLocation("Local")
4746
+
4747
+	theTime, _ := time.ParseInLocation(timeLayout, executionTime, loc)
4748
+	err := service.BatchAdviceExecution(idArray, creator, theTime.Unix())
4744 4749
 	fmt.Println(err)
4745 4750
 	c.ServeSuccessJSON(map[string]interface{}{
4746 4751
 		"msg": "批量删除成功",

+ 2 - 2
service/mobile_dialysis_service.go Bestand weergeven

@@ -2013,9 +2013,9 @@ func BatchAdviceCheck(ids []string, creator int64) error {
2013 2013
 	return err
2014 2014
 }
2015 2015
 
2016
-func BatchAdviceExecution(ids []string, creator int64) error {
2016
+func BatchAdviceExecution(ids []string, creator int64, execution_state int64) error {
2017 2017
 
2018 2018
 	advice := models.XtDoctorAdvice{}
2019
-	err := XTWriteDB().Model(&advice).Where("id IN(?) and status = 1", ids).Updates(map[string]interface{}{"execution_state": 1, "execution_staff": creator, "execution_time": time.Now().Unix()}).Error
2019
+	err := XTWriteDB().Model(&advice).Where("id IN(?) and status = 1", ids).Updates(map[string]interface{}{"execution_state": 1, "execution_staff": creator, "execution_time": execution_state}).Error
2020 2020
 	return err
2021 2021
 }