zwxi 1 yıl önce
ebeveyn
işleme
c29d5617d7
2 değiştirilmiş dosya ile 11 ekleme ve 1 silme
  1. 1 1
      controllers/user.go
  2. 10 0
      models/seller.go

+ 1 - 1
controllers/user.go

@@ -1114,7 +1114,7 @@ func (this *UserController) ApplyTryOut() {
 	}
 
 	//获取销售信息
-	sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
+	sellerItem, err := models.GetShareSellerByCompanyIdCheckFicc(user.CompanyId, 2)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "申请失败"
 		br.ErrMsg = "获取销售信息失败,Err:" + err.Error()

+ 10 - 0
models/seller.go

@@ -75,3 +75,13 @@ func GetSelleridWhichGroup(companyId, productId int) (adminId string, err error)
 	err = o.Raw(sql, companyId, productId).QueryRow(&adminId)
 	return
 }
+
+func GetShareSellerByCompanyIdCheckFicc(companyId, productId int) (item *AdminItem, err error) {
+	o := orm.NewOrmUsingDB("weekly_report")
+	sql := ` SELECT b.*,c.open_id,c.user_id,a.company_name FROM company_product AS a
+			INNER JOIN admin AS b ON a.share_seller_id=b.admin_id
+			LEFT JOIN wx_user AS c ON b.mobile=c.mobile
+			WHERE a.company_id=? AND a.product_id=?`
+	err = o.Raw(sql, companyId, productId).QueryRow(&item)
+	return
+}