|
@@ -27,6 +27,7 @@ func AddUsePerson(this *entmanageapplication.AddUsePersonReq) *entmanageapplicat
|
|
|
if sourceData != nil && len(*sourceData) > 0 {
|
|
|
empower_count := common.IntAll((*sourceData)["empower_count"])
|
|
|
use_count := common.IntAll((*sourceData)["use_count"])
|
|
|
+ end_time := common.ObjToString((*sourceData)["end_time"])
|
|
|
if empower_count-use_count < len(UserArr) {
|
|
|
msg = "购买数量不足"
|
|
|
code = int64(-1)
|
|
@@ -39,9 +40,14 @@ func AddUsePerson(this *entmanageapplication.AddUsePersonReq) *entmanageapplicat
|
|
|
if dataStatus == -1 {
|
|
|
ok = JyMysql.Update(EntnichePower, map[string]interface{}{"ent_user_id": entUserId}, map[string]interface{}{"wait_empower_id": this.WaitEmpowerId, "status": 1, "update_time": timeStr})
|
|
|
} else {
|
|
|
- msg = "人员已经拥有权限,请先删除原有权限"
|
|
|
- code = int64(-1)
|
|
|
- break
|
|
|
+ res, _ := time.ParseInLocation("2006-01-02 15:04:05", end_time, time.Local)
|
|
|
+ if res.Unix() > time.Now().Unix() {
|
|
|
+ msg = "人员已经拥有权限,请先删除原有权限"
|
|
|
+ code = int64(-1)
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ ok = JyMysql.Update(EntnichePower, map[string]interface{}{"ent_user_id": entUserId}, map[string]interface{}{"wait_empower_id": this.WaitEmpowerId, "status": 1, "update_time": timeStr})
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
id = JyMysql.Insert(EntnichePower, map[string]interface{}{
|