|
@@ -68,9 +68,7 @@ func AddUsePerson(this *entmanageapplication.AddUsePersonReq) *entmanageapplicat
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- log.Println("------------1")
|
|
|
if JyMysql.CountBySql(`select count(1) as count from `+EntnichePower+` where wait_empower_id=? and ent_id=? and ent_user_id=? and status=?`, this.WaitEmpowerId, this.EntId, entUserId, 1) == 0 {
|
|
|
- log.Println("------------2")
|
|
|
id = JyMysql.Insert(EntnichePower, map[string]interface{}{
|
|
|
"wait_empower_id": this.WaitEmpowerId,
|
|
|
"ent_id": this.EntId,
|
|
@@ -79,9 +77,7 @@ func AddUsePerson(this *entmanageapplication.AddUsePersonReq) *entmanageapplicat
|
|
|
"create_time": timeStr,
|
|
|
"update_time": timeStr,
|
|
|
})
|
|
|
- log.Println("------------3")
|
|
|
JyMysql.UpdateOrDeleteBySql(`update `+EntnicheWaitEmpower+` set use_count = use_count + 1 where id = ?`, this.WaitEmpowerId)
|
|
|
- log.Println("------------4")
|
|
|
addPower(this.WaitEmpowerId, entUserId, this.EntId)
|
|
|
}
|
|
|
}
|
|
@@ -159,7 +155,9 @@ func UsePersonList(this *entmanageapplication.UsePersonListReq) *entmanageapplic
|
|
|
|
|
|
func BuyProductList(this *entmanageapplication.BuyProductListReq) *entmanageapplication.BuyProductListResp {
|
|
|
nowTime := time.Now().Format("2006-01-02 15:04:05")
|
|
|
- data := JyMysql.SelectBySql(`select * from `+EntnicheWaitEmpower+` where ent_id = ? and end_time >= ? order by create_time desc`, this.EntId, nowTime)
|
|
|
+ data := JyMysql.SelectBySql(`select a.id,sum(1) as use_count,a.empower_count,a.province_count,a.end_time,a.product_type from `+EntnicheWaitEmpower+` a
|
|
|
+ inner join `+EntnichePower+` b on (a.ent_id=? and a.end_time>=? and a.id=b.wait_empower_id and b.status=1)
|
|
|
+ group by a.id order by a.create_time desc`, this.EntId, nowTime)
|
|
|
arr := []*entmanageapplication.BuyProductList{}
|
|
|
if data != nil && len(*data) > 0 {
|
|
|
for _, v := range *data {
|
|
@@ -598,17 +596,14 @@ func delRedisByPowerCheck(positionId string) bool {
|
|
|
//
|
|
|
func ResourcePowerHandle(identity *usercenter.Identity, waitEmpowerId, t int64) {
|
|
|
//如果是运营商数据定制及分析产品,调用资源中台,取消对应菜单权限
|
|
|
- log.Println("------------5")
|
|
|
if JyMysql.CountBySql(`select count(1) as count from `+EntnicheWaitEmpower+` where id=? and product_type=?`, waitEmpowerId, YYSSJDZYFX) > 0 {
|
|
|
- log.Println("-------", identity.EntId, waitEmpowerId, t)
|
|
|
if t == 1 {
|
|
|
- cc, err := entity.ResourceRpc.Empower(context.Background(), &pb.EmpowerReq{
|
|
|
+ entity.ResourceRpc.Empower(context.Background(), &pb.EmpowerReq{
|
|
|
Appid: "10000",
|
|
|
FunctionCode: "bi_sj_yyszs",
|
|
|
EntId: identity.EntId,
|
|
|
EntUserId: []int64{identity.EntUserId},
|
|
|
})
|
|
|
- log.Println(err, fmt.Sprintf("%+v", cc))
|
|
|
} else {
|
|
|
entity.ResourceRpc.CancelEmpower(context.Background(), &pb.EmpowerReq{
|
|
|
Appid: "10000",
|