From 250cbfa1ddcb3cf38e0d0505c1c7e282b940d25b Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 13 十月 2023 10:30:05 +0800
Subject: [PATCH] admin user id 转crm user id
---
model/salesDetails.go | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/model/salesDetails.go b/model/salesDetails.go
index fc3bb80..ed81fab 100644
--- a/model/salesDetails.go
+++ b/model/salesDetails.go
@@ -30,7 +30,7 @@
Conditions string `json:"conditions" gorm:"column:conditions;type:text;comment:鏉′欢"`
CreatorId int `json:"creatorId" gorm:"column:creator_id;type:int;comment:鍒涘缓浜篿d"`
Remark string `json:"remark" gorm:"column:remark;type:text;comment:澶囨敞"`
- Products []*Product `json:"products" gorm:"many2many:sales_details_product;"`
+ Products []*Product `json:"products" gorm:"many2many:SalesDetails_Product;"`
LogisticCompany string `json:"logisticCompany" gorm:"column:logistic_company;type:varchar(255);comment:鐗╂祦鍏徃"`
LogisticNumber string `json:"logisticNumber" gorm:"column:logistic_number;type:varchar(255);comment:鐗╂祦鍗曞彿"`
LogisticCost float64 `json:"logisticCost" gorm:"column:logistic_cost;type:decimal(10,2);comment:鐗╂祦璐圭敤"`
@@ -101,6 +101,12 @@
func (slf *SalesDetailsSearch) Delete() error {
var db = slf.build()
+ return db.Delete(&SalesDetails{}).Error
+}
+
+func (slf *SalesDetailsSearch) DeleteByIds(ids []int) error {
+ var db = slf.build()
+ db = db.Where("id in ?", ids)
return db.Delete(&SalesDetails{}).Error
}
@@ -218,3 +224,8 @@
amount = record.AmountUnInvoiced.Add(amount)
return slf.UpdateByMap(map[string]interface{}{"amount_not_invoiced": amount})
}
+
+func (slf *SalesDetailsSearch) UpdateProducts(record *SalesDetails, newProducts, removedProducts []*Product) error {
+ var db = slf.build()
+ return db.Updates(record).Error
+}
--
Gitblit v1.8.0