Explorar el Código

Merge branch 'crm_15.9' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai hace 8 meses
padre
commit
66d5114134
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      models/rai_serve/rai_serve_company.go

+ 4 - 3
models/rai_serve/rai_serve_company.go

@@ -58,7 +58,7 @@ func AddCygxRaiServeCompanyMulti(items, itemsUpdate []*CygxRaiServeCompany, delC
 	}
 
 	if len(itemsUpdate) > 0 {
-		p, errUpdate := o.Raw("UPDATE cygx_rai_serve_company SET company_name = ? ,seller_id =? ,seller_name = ?  ,start_date = ? ,end_date = ? ,share_seller = ? ,share_seller_id = ? ,share_group_id = ?  WHERE company_id = ?").Prepare()
+		p, errUpdate := o.Raw("UPDATE cygx_rai_serve_company SET company_name = ? ,seller_id =? ,seller_name = ?  ,start_date = ? ,end_date = ? ,share_seller = ? ,share_seller_id = ? ,group_id = ? ,share_group_id = ?  WHERE company_id = ?").Prepare()
 		if errUpdate != nil {
 			err = errUpdate
 			return
@@ -66,8 +66,9 @@ func AddCygxRaiServeCompanyMulti(items, itemsUpdate []*CygxRaiServeCompany, delC
 		defer func() {
 			_ = p.Close() // 别忘记关闭 statement
 		}()
-		for _, v := range items {
-			_, err = p.Exec(v.CompanyName, v.SellerId, v.SellerName, v.StartDate, v.EndDate, v.ShareSeller, v.ShareSellerId, v.ShareGroupId, v.CompanyId)
+
+		for _, v := range itemsUpdate {
+			_, err = p.Exec(v.CompanyName, v.SellerId, v.SellerName, v.StartDate, v.EndDate, v.ShareSeller, v.ShareSellerId, v.GroupId, v.ShareGroupId, v.CompanyId)
 			if err != nil {
 				return
 			}