From d3cf73c4718bc1972565277f038434a34f03907c Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期二, 26 三月 2024 14:23:56 +0800
Subject: [PATCH] 操作明细添加销售明细编码

---
 models/operation.go |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/models/operation.go b/models/operation.go
index 9d34771..c16e13a 100644
--- a/models/operation.go
+++ b/models/operation.go
@@ -43,10 +43,11 @@
 		ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:鑱旂郴鐢佃瘽"`
 		ReceiverAddr  string `json:"receiverAddr" gorm:"type:varchar(255);comment:鏀惰揣鍦板潃"`
 
-		LocationID   int      `json:"locationID"   gorm:"type:int;not null;comment:婧愪綅缃甶d"`          //婧愪綅缃甶d
-		Location     Location `json:"location" gorm:"foreignkey:LocationID;references:Id"`          //婧愪綅缃�
-		ToLocationID int      `json:"toLocationId"    gorm:"type:int;not null;comment:浠撳簱浣嶇疆id"`      //鐩爣浣嶇疆id
-		ToLocation   Location `json:"toLocation"      gorm:"foreignKey:ToLocationID;references:Id"` //鐩爣浣嶇疆
+		LocationID         int      `json:"locationID"   gorm:"type:int;not null;comment:婧愪綅缃甶d"`          //婧愪綅缃甶d
+		Location           Location `json:"location" gorm:"foreignkey:LocationID;references:Id"`          //婧愪綅缃�
+		ToLocationID       int      `json:"toLocationId"    gorm:"type:int;not null;comment:浠撳簱浣嶇疆id"`      //鐩爣浣嶇疆id
+		ToLocation         Location `json:"toLocation"      gorm:"foreignKey:ToLocationID;references:Id"` //鐩爣浣嶇疆
+		SalesDetailsNumber string   `gorm:"type:varchar(191);comment:閿�鍞槑缁嗙紪鐮�" json:"salesDetailsNumber"`
 	}
 
 	OperationSearch struct {
@@ -136,6 +137,11 @@
 	return slf
 }
 
+func (slf *OperationSearch) SetSalesDetailsNumber(salesDetailsNumber string) *OperationSearch {
+	slf.SalesDetailsNumber = salesDetailsNumber
+	return slf
+}
+
 func (slf *OperationSearch) build() *gorm.DB {
 	var db = slf.Orm.Model(&Operation{})
 
@@ -182,6 +188,10 @@
 		db = db.Where("base_operation_type = ?", slf.BaseOperationType)
 	}
 
+	if slf.SalesDetailsNumber != "" {
+		db = db.Where("sales_details_number = ?", slf.SalesDetailsNumber)
+	}
+
 	return db
 }
 

--
Gitblit v1.8.0