This commit is contained in:
2026-04-29 21:54:02 +08:00
parent c10c205102
commit 612643e568
3 changed files with 93 additions and 31 deletions
+10 -8
View File
@@ -1159,20 +1159,22 @@ func ApiWarehouse(r *gin.RouterGroup) {
models.DB.Where("item_id = ?", from.ID).Find(&customerBinds)
type CustomerInfo struct {
ID uint `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Title string `json:"title"`
ID uint `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Title string `json:"title"`
PrimaryPhone string `json:"primary_phone"`
}
var customers []CustomerInfo
for _, b := range customerBinds {
var c TabCustomer
if models.DB.Where("id = ?", b.CustomerID).First(&c).Error == nil {
customers = append(customers, CustomerInfo{
ID: c.ID,
FirstName: c.FirstName,
LastName: c.LastName,
Title: c.Title,
ID: c.ID,
FirstName: c.FirstName,
LastName: c.LastName,
Title: c.Title,
PrimaryPhone: c.PrimaryPhone,
})
}
}