From d1cb09e7a23e7221b6c090ad33e4481a5b79f615 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 29 十一月 2023 17:44:29 +0800
Subject: [PATCH] 出入库报表搜索增加几个字段

---
 models/operation_type.go |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/models/operation_type.go b/models/operation_type.go
index 4c5f86a..4857259 100644
--- a/models/operation_type.go
+++ b/models/operation_type.go
@@ -36,6 +36,7 @@
 		ReturnOperationType           string                     `json:"returnOperationType" gorm:"-"`                                   //閫�璐х被鍨嬪悕绉�
 		ReadyCount                    int                        `json:"readyCount" gorm:"-"`                                            //灏辩华鏁伴噺
 		FinishCount                   int                        `json:"finishCount" gorm:"-"`                                           //瀹屾垚鏁伴噺
+		CancelCount                   int                        `json:"cancelCount" gorm:"-"`                                           //鍙栨秷鏁伴噺
 	}
 
 	OperationTypeSearch struct {
@@ -133,6 +134,10 @@
 
 	if slf.WarehouseId > 0 {
 		db = db.Where("warehouse_id = ?", slf.WarehouseId)
+	}
+
+	if int(slf.BaseOperationType) != 0 {
+		db = db.Where("base_operation_type = ?", slf.BaseOperationType)
 	}
 
 	return db
@@ -291,7 +296,8 @@
 		records = make([]*OperationTypeByStatus, 0)
 		db      = slf.Orm
 	)
-	db = db.Table("wms_job_type").Select("wms_job_type.id,wms_operation.status,count(wms_operation.id) as count").InnerJoins("inner join wms_operation on wms_operation.operation_type_id=wms_job_type.id").Group("wms_job_type.id,wms_operation.status")
+	db = db.Table("wms_job_type").Select("wms_job_type.id,wms_operation.status,count(wms_operation.id) as count").InnerJoins("inner join wms_operation on wms_operation.operation_type_id=wms_job_type.id").Where("wms_operation.deleted_at is null").
+		Group("wms_job_type.id,wms_operation.status")
 	if len(idList) > 0 {
 		db = db.Where("wms_job_type.id IN ?", idList)
 	}

--
Gitblit v1.8.0