|
@@ -744,7 +744,6 @@ func UpdateCompanyProductSellerUnexpiredInitinit16_1_05(sellerId int, sellerName
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
func GetCompanyNameByShareSellerId(shareSellerIds []int) (companyName []string, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT distinct c.company_name FROM company_product cp left join company c on cp.company_id = c.company_id WHERE cp.share_seller_id IN (` + utils.GetOrmInReplace(len(shareSellerIds)) + `)`
|
|
@@ -760,10 +759,10 @@ func GetCompanyNameByShareSellerIdStr(shareSellerIds []string) (companyName []st
|
|
|
}
|
|
|
|
|
|
type CompanyShareSeller struct {
|
|
|
- CompanyName string
|
|
|
- ProductId int
|
|
|
- ShareSellerId int
|
|
|
- ShareSeller string
|
|
|
+ CompanyName string
|
|
|
+ ProductId int
|
|
|
+ ShareSellerId int
|
|
|
+ ShareSeller string
|
|
|
}
|
|
|
|
|
|
func GetShareSellerByCompanyName(companyNames []string) (items []*CompanyShareSeller, err error) {
|
|
@@ -772,3 +771,18 @@ func GetShareSellerByCompanyName(companyNames []string) (items []*CompanyShareSe
|
|
|
_, err = o.Raw(sql, companyNames).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// 取消共享销售
|
|
|
+func UpdateCompanyProductCancelisShare(companyId, productId int) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `UPDATE company_product SET
|
|
|
+ is_share = 0 ,
|
|
|
+ share_seller = '',
|
|
|
+ share_group_id = 0,
|
|
|
+ share_seller_id = 0 ,
|
|
|
+ share_seller_id_last = 0 ,
|
|
|
+ share_seller_last = ''
|
|
|
+ WHERE company_id = ? AND product_id= ? `
|
|
|
+ _, err = o.Raw(sql, companyId, productId).Exec()
|
|
|
+ return
|
|
|
+}
|