|
@@ -1214,11 +1214,15 @@ func ZmUserEquityRecovery(userTable string) {
|
|
23, 59, 59, 0,
|
|
23, 59, 59, 0,
|
|
time.Local)
|
|
time.Local)
|
|
crontab(false, TimeTaskConfig.ZmUserEquityRecovery, func() {
|
|
crontab(false, TimeTaskConfig.ZmUserEquityRecovery, func() {
|
|
|
|
+ queryMap := map[string]interface{}{"i_zhima_number": 1, "i_zhima_status": 1, "_id": 1, "i_zhima_endtime": 1, "i_zhima_starttime": 1}
|
|
|
|
+ if userTable == CollEntUser {
|
|
|
|
+ queryMap["i_userid"] = 1
|
|
|
|
+ }
|
|
sess := util.MQFW.GetMgoConn()
|
|
sess := util.MQFW.GetMgoConn()
|
|
it := sess.DB("qfw").C(userTable).Find(map[string]interface{}{
|
|
it := sess.DB("qfw").C(userTable).Find(map[string]interface{}{
|
|
"i_zhima_status": map[string]interface{}{
|
|
"i_zhima_status": map[string]interface{}{
|
|
"$gt": 0},
|
|
"$gt": 0},
|
|
- }).Select(map[string]interface{}{"i_zhima_number": 1, "i_zhima_status": 1, "i_zhima_endtime": 1, "i_zhima_starttime": 1}).Iter()
|
|
|
|
|
|
+ }).Select(queryMap).Iter()
|
|
for m := make(map[string]interface{}); it.Next(&m); {
|
|
for m := make(map[string]interface{}); it.Next(&m); {
|
|
userId := BsonIdToSId(m["_id"])
|
|
userId := BsonIdToSId(m["_id"])
|
|
if userTable == CollEntUser {
|
|
if userTable == CollEntUser {
|
|
@@ -1249,6 +1253,7 @@ func ZmUserEquityRecovery(userTable string) {
|
|
if number > 0 {
|
|
if number > 0 {
|
|
util.Mysql.Insert("bid_credit_balance_details", map[string]interface{}{
|
|
util.Mysql.Insert("bid_credit_balance_details", map[string]interface{}{
|
|
"user_id": userId,
|
|
"user_id": userId,
|
|
|
|
+ "pack_type": i_zhima_status,
|
|
"operation": 3,
|
|
"operation": 3,
|
|
"number": -number,
|
|
"number": -number,
|
|
"residue_number": 0,
|
|
"residue_number": 0,
|
|
@@ -1258,6 +1263,7 @@ func ZmUserEquityRecovery(userTable string) {
|
|
if newZmTime.Format("2006-01-02") != time.Unix(i_zhima_endtime, 0).Format("2006-01-02") {
|
|
if newZmTime.Format("2006-01-02") != time.Unix(i_zhima_endtime, 0).Format("2006-01-02") {
|
|
util.Mysql.Insert("bid_credit_balance_details", map[string]interface{}{
|
|
util.Mysql.Insert("bid_credit_balance_details", map[string]interface{}{
|
|
"user_id": userId,
|
|
"user_id": userId,
|
|
|
|
+ "pack_type": i_zhima_status,
|
|
"operation": 4,
|
|
"operation": 4,
|
|
"number": i_zhima_number,
|
|
"number": i_zhima_number,
|
|
"residue_number": i_zhima_number,
|
|
"residue_number": i_zhima_number,
|