|
@@ -45,7 +45,7 @@ type IndustrialManagementIdResp struct {
|
|
|
ChartPermissionId int `description:"权限id"`
|
|
|
}
|
|
|
|
|
|
-//添加
|
|
|
+// 添加
|
|
|
func AddCygxXzsChooseSend(item *CygxXzsChooseSend, itemsFllow []*CygxIndustryFllow, itemsCategory []*CygxXzsChooseCategory) (err error) {
|
|
|
o, err := orm.NewOrm().Begin()
|
|
|
if err != nil {
|
|
@@ -97,7 +97,7 @@ func AddCygxXzsChooseSend(item *CygxXzsChooseSend, itemsFllow []*CygxIndustryFll
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取数量
|
|
|
+// 获取数量
|
|
|
func GetXzsChooseSendCountByMobile(mobile string) (count int, err error) {
|
|
|
sql := ` SELECT COUNT(1) AS count FROM cygx_xzs_choose_send WHERE mobile = ? `
|
|
|
o := orm.NewOrm()
|
|
@@ -105,7 +105,7 @@ func GetXzsChooseSendCountByMobile(mobile string) (count int, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//添加
|
|
|
+// 添加
|
|
|
func UpdateCygxXzsChooseSend(item *CygxXzsChooseSend, itemsFllow []*CygxIndustryFllow, itemsCategory []*CygxXzsChooseCategory) (err error) {
|
|
|
o, err := orm.NewOrm().Begin()
|
|
|
if err != nil {
|
|
@@ -175,10 +175,35 @@ func UpdateCygxXzsChooseSend(item *CygxXzsChooseSend, itemsFllow []*CygxIndustry
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//根据用户openid获取token
|
|
|
+// 根据用户openid获取token
|
|
|
func GetCygxXzsChooseSendByMobile(mobile string) (item *CygxXzsChooseSend, err error) {
|
|
|
sql := `SELECT * FROM cygx_xzs_choose_send WHERE mobile=? LIMIT 1 `
|
|
|
o := orm.NewOrm()
|
|
|
err = o.Raw(sql, mobile).QueryRow(&item)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+type XzsChooseMapResp struct {
|
|
|
+ Id int `description:"id"`
|
|
|
+ CategoryId int `description:"权益文章对应分类,cygx_article"`
|
|
|
+ CharPpermissionName string `description:"权限名称"`
|
|
|
+ MatchTypeName string `description:"分类名称"`
|
|
|
+}
|
|
|
+
|
|
|
+// 根据手机号获取用户关注的产业
|
|
|
+func GetCygxXzsChooseCategoryMapList() (items []*XzsChooseMapResp, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ r.id,
|
|
|
+ r.chart_permission_name,
|
|
|
+ r.match_type_name,
|
|
|
+ c.category_id
|
|
|
+ FROM
|
|
|
+ cygx_report_mapping_cygx AS r
|
|
|
+ INNER JOIN cygx_report_mapping_group AS p ON p.id_cygx = r.id
|
|
|
+ INNER JOIN cygx_report_mapping_celue AS c ON c.category_id = p.category_id_celue
|
|
|
+ WHERE
|
|
|
+ r.chart_permission_id IN (23,100000)`
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|