Browse Source

no message

xingzai 1 year ago
parent
commit
b08c76203e
3 changed files with 53 additions and 2 deletions
  1. 14 0
      controllers/cygx/apply_record.go
  2. 36 2
      models/cygx/apply_record.go
  3. 3 0
      utils/config.go

+ 14 - 0
controllers/cygx/apply_record.go

@@ -7,6 +7,7 @@ import (
 	"hongze/hz_crm_api/models"
 	"hongze/hz_crm_api/models/cygx"
 	"hongze/hz_crm_api/utils"
+	"strconv"
 )
 
 // 权益小程序
@@ -122,6 +123,19 @@ func (this *ApplyRecordController) ListSysRole() {
 		case 2:
 			list[i].ApplicationSource += "(络町)"
 		}
+
+		switch v.Source {
+		case "article": //文章详情
+			list[i].HttpUrl = utils.CYGX_WEB_URL + "/material/info/" + strconv.Itoa(v.SourceId)
+		case "activity": //活动详情
+			list[i].HttpUrl = utils.CYGX_WEB_URL + "/activity/detail/" + strconv.Itoa(v.SourceId)
+		case "activityvoice": //活动音频详情
+			list[i].HttpUrl = utils.CYGX_WEB_URL + "/activity/detail/" + strconv.Itoa(v.SourceId)
+		case "activityvideo": //活动视频详情
+			list[i].HttpUrl = utils.CYGX_WEB_URL + "/activity/detail/" + strconv.Itoa(v.SourceId)
+		case "productinterior": //产品内测
+			list[i].HttpUrl = utils.CYGX_WEB_URL + "//internal/article/" + strconv.Itoa(v.SourceId)
+		}
 	}
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp := new(cygx.CygxApplyRecordListResp)

+ 36 - 2
models/cygx/apply_record.go

@@ -30,9 +30,43 @@ type CygxApplyRecord struct {
 	RegisterPlatform         int    `description:"来源 1小程序,2:网页"`
 	InviteCompanySource      int    `description:"三方来源 ,1:弘则本身,2:络町"`
 	ApplicationSource        string `description:"申请来源"`
+	SourceId                 int    `description:"资源ID"`
+	Source                   string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
+	Title                    string `description:"标题"`
 }
 
-func GetCygxApplyRecord(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxApplyRecord, err error) {
+type CygxApplyRecordResp struct {
+	ApplyRecordId            int    `orm:"column(apply_record_id);pk" description:"申请试用id"`
+	BusinessCardUrl          string `description:"名片地址"`
+	RealName                 string `description:"姓名"`
+	CompanyName              string `description:"公司名称"`
+	Mobile                   string `description:"手机号"`
+	CreateTime               string `description:"创建时间"`
+	ApplyMethod              int    `description:"1:已付费客户申请试用,2:非客户申请试用"`
+	Status                   int    `description:"0:未处理,1:已处理"`
+	DealTime                 string `description:"处理时间"`
+	Email                    string `description:"邮箱"`
+	SellerName               string `description:"销售"`
+	CompanyIdPay             int    `description:"1:为潜在客户,大于1现有客户"`
+	InviteeMobile            string `description:"邀请人手机号"`
+	InviteeCompany           string `description:"邀请人公司名称"`
+	InviteeCompanyId         string `description:"邀请人公司ID"`
+	ApplySource              string `description:"申请来源"`
+	InviteeEmail             string `description:"邀请人邮箱"`
+	IsInviteeComanyExistence bool   `description:"邀请公司是否还存在"`
+	InviteeCompanyNum        int    `description:"邀请公司是否还存在(辅助字段)"`
+	CompanyIdType            int    `description:"用户状态,1:潜在客户 、2:现有客户 、3:FICC客户 、4:现有客户(正式,无对应权限) 、5:现有客户(试用,无对应权限)  、6:现有客户(试用暂停) 、7:现有客户(冻结) 、8:现有客户(流失) "`
+	CompanyIdTypeName        string `description:"用户状态,1:潜在客户 、2:现有客户 、3:FICC客户 、4:现有客户(正式,无对应权限) 、5:现有客户(试用,无对应权限)  、6:现有客户(试用暂停) 、7:现有客户(冻结) 、8:现有客户(流失) "`
+	RegisterPlatform         int    `description:"来源 1小程序,2:网页"`
+	InviteCompanySource      int    `description:"三方来源 ,1:弘则本身,2:络町"`
+	ApplicationSource        string `description:"申请来源"`
+	SourceId                 int    `description:"资源ID"`
+	Source                   string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
+	Title                    string `description:"标题"`
+	HttpUrl                  string `description:"跳转地址"`
+}
+
+func GetCygxApplyRecord(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxApplyRecordResp, err error) {
 	o := orm.NewOrm()
 
 	sql := ` SELECT DISTINCT a.*,i.invitee_mobile,i.invitee_company,i.invitee_email,invitee_company_id, GROUP_CONCAT(b.seller_name ORDER BY b.product_id ASC SEPARATOR '/') AS seller_name,c.email,(SELECT COUNT(1) FROM company WHERE company_id =invitee_company_id ) as invitee_company_num
@@ -71,7 +105,7 @@ GROUP_CONCAT(b.seller_name ORDER BY b.product_id ASC SEPARATOR '/') AS seller_na
 }
 
 type CygxApplyRecordListResp struct {
-	List   []*CygxApplyRecord
+	List   []*CygxApplyRecordResp
 	Paging *paging.PagingItem `description:"分页数据"`
 }
 

+ 3 - 0
utils/config.go

@@ -60,6 +60,7 @@ var (
 	WxMsgTemplateIdWithRoadshowPending       string //路演->研究员收到待处理的申请
 	WxMsgTemplateIdWithRoadshowDetailResult  string //路演->销售收到处理结果
 	WxMsgTemplateIdWithRoadshowDeleteNotice  string //路演->研究员收到活动删除通知
+	CYGX_WEB_URL                             string //查研观向web端网址
 
 	WxMsgTemplateIdWithYbCommunityQuestion string // 研报小程序->问答社区回复通知
 	WxMsgTemplateIdWithSealApplyFinished   string // 用印申请-已签回通知
@@ -242,6 +243,7 @@ ZwIDAQAB
 		IndexName = "cygx_article_v03_23"
 		IndexNameArticleHistory = "cygx_article_history_v07_08"
 		IndexNameComprehensive = "cygx_comprehensive"
+		CYGX_WEB_URL = "https://web.hzinsights.com"
 		TemplateCompanyApplyRedirectUrl = "https://ficc.hzinsights.com/approval/approval/list"
 
 		//同花顺正式地址
@@ -281,6 +283,7 @@ ZwIDAQAB
 		IndexName = "cygx_article_v1"
 		IndexNameArticleHistory = "cygx_article_history_v1"
 		IndexNameComprehensive = "cygx_comprehensive_test"
+		CYGX_WEB_URL = "https://clpttest.hzinsights.com"
 
 		//同花顺测试地址
 		THS_SendUrl = `https://mtest.10jqka.com.cn/gateway/ps/syncNews`