|
@@ -8,6 +8,7 @@ import (
|
|
|
"hongze/hongze_yb/models/tables/company_product"
|
|
|
"hongze/hongze_yb/models/tables/company_report_permission"
|
|
|
"hongze/hongze_yb/models/tables/wx_user"
|
|
|
+ "hongze/hongze_yb/models/tables/yb_apply_record"
|
|
|
"hongze/hongze_yb/utils"
|
|
|
)
|
|
|
|
|
@@ -59,6 +60,7 @@ type CustomerInfo struct {
|
|
|
Name string `json:"name" description:"联系人名称"`
|
|
|
Mobile string `json:"mobile" description:"手机号"`
|
|
|
Status string `json:"status" description:"状态"`
|
|
|
+ HasApply bool `json:"has_apply" description:"是否有申请过"`
|
|
|
}
|
|
|
|
|
|
// CheckPermissionByFicc 权限校验
|
|
@@ -119,6 +121,16 @@ func CheckPermissionByFicc(companyId int64, permissionId int) (ok bool, permissi
|
|
|
|
|
|
// CheckPermissionByPermissionIdList2Ficc 根据权限id集合权限校验
|
|
|
func CheckPermissionByPermissionIdList2Ficc(companyId int64, userId int, permissionIdList []int) (ok bool, permissionCheckInfo PermissionCheckInfo, err error) {
|
|
|
+ defer func() {
|
|
|
+ // 如果无权限,那么就去查询是否申请过
|
|
|
+ if ok == false && permissionCheckInfo.Type == "apply" {
|
|
|
+ _, err = yb_apply_record.GetLastNotOpRecordByUserId(userId)
|
|
|
+ //查询是否有申请过,如果有申请过的话,那么err是nil
|
|
|
+ if err == nil {
|
|
|
+ permissionCheckInfo.CustomerInfo.HasApply = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }()
|
|
|
//非潜在客户
|
|
|
if len(permissionIdList) <= 0 {
|
|
|
err = fmt.Errorf("权限异常,请传入需要校验的权限")
|