From 33f84142435e4333548deead473b5afccde23fa1 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期日, 27 八月 2023 00:58:01 +0800
Subject: [PATCH] fix

---
 model/work_order.go   |    4 ++--
 crontask/cron_task.go |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/crontask/cron_task.go b/crontask/cron_task.go
index da60256..fd53267 100644
--- a/crontask/cron_task.go
+++ b/crontask/cron_task.go
@@ -11,7 +11,7 @@
 
 func InitTask() error {
 	s := gocron.NewScheduler(time.UTC)
-	_, err := s.Every(2).Seconds().StartImmediately().Do(func() {
+	_, err := s.Every(10).Seconds().StartImmediately().Do(func() {
 		plcConfig, code := service.NewDevicePlcService().GetDevicePlc()
 		if code != ecode.OK {
 			return
diff --git a/model/work_order.go b/model/work_order.go
index 0626042..b453d81 100644
--- a/model/work_order.go
+++ b/model/work_order.go
@@ -23,7 +23,6 @@
 		StartTime   int64           `gorm:"comment:璁″垝寮�濮嬫椂闂�" json:"startTime"`
 		EndTime     int64           `gorm:"comment:璁″垝缁撴潫鏃堕棿" json:"endTime"`
 		Status      OrderStatus
-		StatusList  []OrderStatus
 	}
 
 	OrderSearch struct {
@@ -35,6 +34,7 @@
 		Preload      bool
 		StartTimeMax int64
 		StartTimeMin int64
+		StatusList   []OrderStatus
 	}
 )
 
@@ -126,7 +126,7 @@
 	}
 
 	if len(slf.StatusList) != 0 {
-		db = db.Where("status != ?", slf.StatusList)
+		db = db.Where("status in ?", slf.StatusList)
 	}
 
 	if slf.StartTimeMax != 0 {

--
Gitblit v1.8.0