|
@@ -137,14 +137,14 @@ type LoginResp struct {
|
|
|
}
|
|
|
|
|
|
type UserDetailResp struct {
|
|
|
- UserId int `description:"用户id"`
|
|
|
- UserName string `description:"用户名称"`
|
|
|
- Headimgurl string `description:"用户头像"`
|
|
|
- Mobile string `description:"手机号"`
|
|
|
- Email string `description:"邮箱"`
|
|
|
- CompanyName string `description:"客户名称"`
|
|
|
- OutboundMobile string `description:"外呼手机号"`
|
|
|
- OutboundCountryCode string `description:"外呼手机号区号"`
|
|
|
+ UserId int `description:"用户id"`
|
|
|
+ UserName string `description:"用户名称"`
|
|
|
+ Headimgurl string `description:"用户头像"`
|
|
|
+ Mobile string `description:"手机号"`
|
|
|
+ Email string `description:"邮箱"`
|
|
|
+ CompanyName string `description:"客户名称"`
|
|
|
+ OutboundMobile string `description:"外呼手机号"`
|
|
|
+ OutboundCountryCode string `description:"外呼手机号区号"`
|
|
|
PermissionName []string `description:"拥有权限分类"`
|
|
|
}
|
|
|
|
|
@@ -175,7 +175,7 @@ type CountryCodeItem struct {
|
|
|
CountryCode string `description:"区号"`
|
|
|
}
|
|
|
|
|
|
-//修改外呼手机号
|
|
|
+// 修改外呼手机号
|
|
|
type OutboundMobileItem struct {
|
|
|
OutboundMobile string `description:"外呼手机号"`
|
|
|
OutboundCountryCode string `description:"外呼手机号区号"`
|
|
@@ -221,6 +221,21 @@ func GetCompanyPermission(companyId int) (permission string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func GetCompanyPermissionRemark(companyId int) (permission string, err error) {
|
|
|
+ sql := ` SELECT GROUP_CONCAT(DISTINCT b.remark ORDER BY b.sort ASC SEPARATOR ',') AS permission
|
|
|
+ FROM company_report_permission AS a
|
|
|
+ INNER JOIN chart_permission AS b ON a.chart_permission_id=b.chart_permission_id
|
|
|
+ INNER JOIN company_product AS c ON a.company_id=c.company_id AND a.product_id=c.product_id
|
|
|
+ WHERE a.company_id=?
|
|
|
+ AND c.is_suspend=0
|
|
|
+ AND b.cygx_auth=1
|
|
|
+ AND c.status IN('正式','试用','永续')
|
|
|
+ AND a.status IN('正式','试用','永续') `
|
|
|
+ o := orm.NewOrm()
|
|
|
+ err = o.Raw(sql, companyId).QueryRow(&permission)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func GetCompanyPermissionId(companyId int) (permissionId string, err error) {
|
|
|
sql := ` SELECT GROUP_CONCAT(DISTINCT b.chart_permission_id ORDER BY b.sort ASC SEPARATOR ',') AS permissionId
|
|
|
FROM company_report_permission AS a
|
|
@@ -236,7 +251,7 @@ func GetCompanyPermissionId(companyId int) (permissionId string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//用户绑定手机号时同时绑定外呼手机号
|
|
|
+// 用户绑定手机号时同时绑定外呼手机号
|
|
|
func BindUserOutboundMobile(mobile, countryCode string, userId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `UPDATE wx_user SET outbound_mobile=? ,outbound_country_code = ?, country_code= ? WHERE user_id=? `
|
|
@@ -252,7 +267,7 @@ type UserPermissionAuthInfo struct {
|
|
|
PopupMsg string `description:"权限弹窗信息"`
|
|
|
}
|
|
|
|
|
|
-//修改用户是否绑定外呼手机号弹窗
|
|
|
+// 修改用户是否绑定外呼手机号弹窗
|
|
|
func ModifyWxUserIsMsgOutboundMobile(userId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `UPDATE wx_user SET is_msg_outbound_mobile=1 WHERE user_id=? `
|
|
@@ -260,7 +275,7 @@ func ModifyWxUserIsMsgOutboundMobile(userId int) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//已经绑定手机号,没有绑定外呼手机号的的用户,预约外呼的时候,将外呼手机号同步成手机号
|
|
|
+// 已经绑定手机号,没有绑定外呼手机号的的用户,预约外呼的时候,将外呼手机号同步成手机号
|
|
|
func BindUserOutboundMobileByMobile(mobile, countryCode string, userId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `UPDATE wx_user SET outbound_mobile=? ,outbound_country_code = ? WHERE user_id=? `
|
|
@@ -329,7 +344,7 @@ type Headimgurl struct {
|
|
|
Headimgurl string `description:"用户头像"`
|
|
|
}
|
|
|
|
|
|
-//更改用户头像
|
|
|
+// 更改用户头像
|
|
|
func UpdateUserHeadimgurl(headimgurl string, userId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `UPDATE wx_user SET headimgurl = ? WHERE user_id=? `
|
|
@@ -375,4 +390,3 @@ func GetUserMicroRoadshowCollectList(userId int) (items []*CygxArticleCollect, e
|
|
|
_, err = orm.NewOrm().Raw(sql, userId).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
-
|