Browse Source

fix:申请单新增ficc销售id字段

Roc 3 years ago
parent
commit
df735361a2
2 changed files with 9 additions and 0 deletions
  1. 6 0
      logic/user/user.go
  2. 3 0
      models/tables/yb_apply_record/yb_apply_record.go

+ 6 - 0
logic/user/user.go

@@ -215,6 +215,7 @@ func GetLastApplyInfo(userId int) (record Record, err error) {
 
 // Apply 客户申请
 func Apply(userId int, companyId int64, mobile, email string, applyInfo userReq.ApplyReq) (ybApplyRecord *yb_apply_record.YbApplyRecord, err error) {
+	ficcSelleriD := 0
 	sellerName := ``
 	status := `潜在客户`
 	companyName := applyInfo.CompanyName
@@ -245,6 +246,10 @@ func Apply(userId int, companyId int64, mobile, email string, applyInfo userReq.
 		for _, companyProduct := range companyProductList {
 			sellerNameList = append(sellerNameList, companyProduct.SellerName)
 			statusList = append(statusList, companyProduct.Status)
+
+			if companyProduct.ProductID == 1 {
+				ficcSelleriD = companyProduct.SellerID
+			}
 		}
 		if len(sellerNameList) > 0 && len(statusList) > 0 {
 			sellerName = strings.Join(sellerNameList, ",")
@@ -259,6 +264,7 @@ func Apply(userId int, companyId int64, mobile, email string, applyInfo userReq.
 		Mobile:          mobile,
 		Email:           email,
 		Permission:      applyInfo.Permission,
+		FiccSellerID:    uint32(ficcSelleriD),
 		SellerName:      sellerName,
 		Status:          status,
 		CompanyIDPay:    int(companyId),

+ 3 - 0
models/tables/yb_apply_record/yb_apply_record.go

@@ -12,6 +12,7 @@ type YbApplyRecord struct {
 	Mobile          string    `gorm:"column:mobile;type:varchar(20);default:''" json:"mobile"`                      // 手机号
 	Email           string    `gorm:"column:email;type:varchar(64);default:''" json:"email"`                        // 邮箱
 	Permission      string    `gorm:"column:permission;type:varchar(255);default:''" json:"permission"`             // 申请权限,多个权限用英文,隔开
+	FiccSellerID    uint32    `gorm:"column:ficc_seller_id;type:int(9) unsigned;default:0" json:"ficcSellerId"`     // ficc销售id,没有开通ficc权限的话,那么所属销售id为0
 	SellerName      string    `gorm:"column:seller_name;type:varchar(64);default:''" json:"sellerName"`             // 销售姓名,多个产品销售用/隔开
 	Status          string    `gorm:"column:status;type:varchar(64);default:''" json:"status"`                      // 用户状态,多个产品状态用/隔开
 	CompanyIDPay    int       `gorm:"column:company_id_pay;type:int(11)" json:"companyIdPay"`                       // 已付费客户公司id
@@ -37,6 +38,7 @@ var YbApplyRecordColumns = struct {
 	Mobile          string
 	Email           string
 	Permission      string
+	FiccSellerID    string
 	SellerName      string
 	Status          string
 	CompanyIDPay    string
@@ -54,6 +56,7 @@ var YbApplyRecordColumns = struct {
 	Mobile:          "mobile",
 	Email:           "email",
 	Permission:      "permission",
+	FiccSellerID:    "ficc_seller_id",
 	SellerName:      "seller_name",
 	Status:          "status",
 	CompanyIDPay:    "company_id_pay",