Ver código fonte

Merge branch 'CRM_14.7.2' into debug

# Conflicts:
#	models/seller.go
zwxi 1 ano atrás
pai
commit
a73b041843
2 arquivos alterados com 11 adições e 1 exclusões
  1. 1 1
      controllers/user.go
  2. 10 0
      models/seller.go

+ 1 - 1
controllers/user.go

@@ -1117,7 +1117,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

@@ -92,3 +92,13 @@ func GetRaiSellerByCompanyId(companyId int) (item *AdminItem, err error) {
 	err = o.Raw(sql, companyId).QueryRow(&item)
 	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
+}