浏览代码

rebuid api

abiao 5 年之前
父节点
当前提交
270a46f3a5

+ 0 - 2
go/gopath/src/fohow.com/apps/controllers/cron_controller/init.go

@@ -72,8 +72,6 @@ func exec(name string) {
 		updateUserNicknameAndHead()
 	case "udpate_sold_count": //更新已售数量
 		updateSoldCount()
-	case "sendTopSaleListMonthlyReward": //发放每月销售奖金
-		sendTopSaleListMonthlyReward()
 	case "comb_user_relation": //梳理内部推荐关系
 		combUserRelation()
 	case "test_inser_three": //测试三位关系

+ 1 - 31
go/gopath/src/fohow.com/apps/controllers/cron_controller/sync_balance.go

@@ -6,12 +6,10 @@ import (
 	"io"
 	"time"
 
-	"github.com/astaxie/beego"
-	"github.com/astaxie/beego/orm"
-
 	"fohow.com/apps/models/balance_model"
 	"fohow.com/apps/models/user_model"
 	"fohow.com/libs/wx_mp"
+	"github.com/astaxie/beego"
 )
 
 type SyncData struct {
@@ -28,34 +26,6 @@ func (self *SyncData) Sign() string {
 	return fmt.Sprintf("%x", h.Sum(nil))
 }
 
-// 定期同步红包数据到第五创主数据库
-func syncBalance() {
-	beego.BeeLogger.Warn("********** Cron task - handle syncBalance start at: %s********", time.Now())
-	// 找出50条未同步的记录
-	// 逐条同步,并标记成功记录
-	o := orm.NewOrm()
-
-	var rs []SyncData
-
-	sql := "SELECT `chunjie_lucky_moneys`.`id` AS id,  `wx_uid`, `receive_bonus`, `chunjie_lucky_moneys`.`created_at`, `unionid` FROM `chunjie_lucky_moneys` inner join `wx_users` on `chunjie_lucky_moneys`.`wx_uid`=`wx_users`.`id` WHERE `is_sync25`<>1 AND `wx_users`.`unionid`<>'' order by `is_sync25` ASC LIMIT 300 ;"
-	num, err := o.Raw(sql).QueryRows(&rs)
-	if err == nil {
-		fmt.Println("user nums: ", num)
-	}
-	for _, syncData := range rs {
-		beego.BeeLogger.Info("********** Cron task - handle syncBalance RecordID=[%d] ********", syncData)
-		if result := syncOne(syncData); result {
-			// update chunjie_lucky_moneys set is_sync25=1
-			o.Raw("UPDATE `chunjie_lucky_moneys` SET `is_sync25` = 1 WHERE id=?", syncData.RecordID).Exec()
-			beego.BeeLogger.Info("********** Cron task - handle syncBalance Success: ********", syncData)
-		} else {
-			o.Raw("UPDATE `chunjie_lucky_moneys` SET `is_sync25` = 2 WHERE id=?", syncData.RecordID).Exec()
-			beego.BeeLogger.Error("********** Cron task - handle syncBalance Fail: ********", syncData)
-		}
-	}
-	beego.BeeLogger.Warn("********** Cron task - handle syncBalance end   at: %s********", time.Now())
-}
-
 //提现打款的定时任务
 func takeCash() {
 	//选择出已审批通过的提现中订单