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