From f45e4cb8045fe60f96f467dc4ea1e2ae57445712 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 03 七月 2024 23:13:40 +0800
Subject: [PATCH] 默认位置parent_id为视图位置id

---
 service/location_forms.go |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/service/location_forms.go b/service/location_forms.go
index f6cf85b..27932a2 100644
--- a/service/location_forms.go
+++ b/service/location_forms.go
@@ -27,7 +27,7 @@
 		resp := new(response.LocationForms)
 		resp.Amount = amount.Amount
 		resp.LocationId = amount.LocationId
-		resp.LocationName = amount.Location.Name
+		resp.LocationName = amount.Location.JointName
 		resp.ProduceId = amount.Product.ID
 		resp.ProductName = amount.Product.Name
 		resp.ProductTypeName = amount.ProductCategory.Name
@@ -46,10 +46,11 @@
 }
 
 func (slf *LocationFormsService) BuildSearch(params request.GetLocationForms) (search *models.LocationProductAmountSearch, err error) {
-	ids := make([]int, 0)
+	ids := params.LocationIds
 	if params.LocationId != 0 {
 		ids = append(ids, params.LocationId)
-	} else {
+	}
+	if len(ids) == 0 {
 		//鏌ヨ浣嶇疆
 		locations, err := models.NewLocationSearch().SetJointName(params.WareHouseCode).SetType(3).FindAll()
 		if err != nil {

--
Gitblit v1.8.0