Kaynağa Gözat

rebuid 精简 app.conf

abiao 5 yıl önce
ebeveyn
işleme
36bdcfa595

+ 0 - 17
go/gopath/src/fohow.com/apps/controllers/balance_controller/balance_controller.go

@@ -14,7 +14,6 @@ import (
 	// 	"fohow.com/apps/models/activity_model"
 	// 	"fohow.com/apps/models/address_model"
 	"fohow.com/apps/models/balance_model"
-	"fohow.com/apps/models/exchange_model"
 	"fohow.com/apps/models/user_model"
 	"time"
 )
@@ -248,19 +247,3 @@ func (self *BalanceController) GetTakeCashOrders() {
 	self.Data["json"] = &Ret{ListCount: listCount, List: retList}
 	self.ServeJSON()
 }
-
-//给内部人员调用查询前一天兑换代金券总数
-func (self *BalanceController) GetYesterdayTotalPaiedCount() {
-	cache, _ := self.GetBool("cache", false)
-	now := time.Now()
-	yesterday, _ := time.Parse("2006-01-02", now.AddDate(0, 0, -1).Format("2006-01-02"))
-	today, _ := time.Parse("2006-01-02", now.Format("2006-01-02"))
-
-	total := exchange_model.GetYesterdayTotalPaiedCount(yesterday, today, cache)
-
-	type Ret struct {
-		TotalPaiedCount int64 `json:"total_paied_count"`
-	}
-	self.Data["json"] = &Ret{TotalPaiedCount: total}
-	self.ServeJSON()
-}

+ 0 - 222
go/gopath/src/fohow.com/apps/controllers/railsadmin_controller/tmpl_controller.go

@@ -2,14 +2,9 @@ package railsadmin_controller
 
 import (
 	"fmt"
-	"fohow.com/apps"
 	"fohow.com/apps/helpers"
-	"fohow.com/apps/models/granary_model"
-	"fohow.com/apps/models/product_model"
 	"fohow.com/apps/models/push_tmpl_model"
-	"fohow.com/apps/models/subject_model"
 	"fohow.com/apps/models/user_model"
-	"fohow.com/libs/tool"
 	"fohow.com/libs/wx_mp"
 	"github.com/astaxie/beego"
 	"strconv"
@@ -17,51 +12,6 @@ import (
 	"time"
 )
 
-//销售专题开奖发送消息
-func (self *RailsadminController) SendOpenPrizeTmpl() {
-
-	id, _ := strconv.ParseInt(self.Ctx.Input.Param(":id"), 10, 64)
-
-	saleSubject := subject_model.GetProductSaleSubjectById(id, false)
-
-	awardedList := subject_model.GetSaleDrawCodeIsAwardedList(id, false)
-
-	beego.BeeLogger.Warn("SendOpenPrizeTmpl:%d", saleSubject.Id)
-	if saleSubject == nil || !saleSubject.IsPrizeAct || time.Now().Unix() < saleSubject.OpenPrizeTime.Unix() || saleSubject.PrizeNumber == "" || len(awardedList) == 0 {
-		self.ReturnError(403, apps.NoExist, "", nil)
-	}
-
-	joinList := subject_model.GetSaleDrawCodeAllBySubjectId(id, false)
-
-	awardedcount := subject_model.GetSaleDrawCodeIsAdwardedCount(id, false)
-
-	for _, join := range joinList {
-		wxUserGzh := user_model.GetWxUserGzhByWxUIdAndAppId(join.WxUserId, beego.AppConfig.String("WxMPAppId"), true)
-		url := fmt.Sprintf("%s/activity/project/%d", beego.AppConfig.String("WxHost"), id)
-		title := "开奖啦!再接再厉~ 你与大奖就差一根头发的距离!"
-		remark := "备注:别灰心~ 敬请期待下一期。"
-		for _, awarded := range awardedList {
-			if awarded.WxUserId == join.WxUserId {
-				title = fmt.Sprintf("恭喜你!你被大奖%s砸到了!", saleSubject.PrizeName)
-				remark = "备注:奖品将在5个工作日内寄出。请登录小程序查询物流状态,谢谢!"
-				break
-			}
-		}
-		name := fmt.Sprintf("第%d期", saleSubject.Id)
-		openTime := saleSubject.OpenPrizeTime.Format("2006-01-02 15:04:05")
-
-		var codeList []string
-		codes := subject_model.GetSaleDrawCodesBySubjectIdAndWxUid(id, join.WxUserId, true)
-		for _, code := range codes {
-			codeList = append(codeList, tool.GetAssignLengthStr(code.Code, 6))
-		}
-		wx_mp.TmplmsgOpenPrize(wxUserGzh.GzhOpenId, url, title, name, openTime, fmt.Sprintf("%d", awardedcount), strings.Join(codeList, ","), saleSubject.PrizeNumber, remark)
-	}
-
-	// self.Data["json"] = pcms
-	self.ServeJSON()
-}
-
 // 推送模板消息给指定的用户
 func (self *RailsadminController) SendTemplate() {
 	id, _ := strconv.ParseInt(self.Ctx.Input.Param(":id"), 10, 64)
@@ -257,175 +207,3 @@ func getWxUsersBySql(key string) (list []*user_model.WxUser) {
 	}
 	return list
 }
-
-// 粮仓单独推送自用消息,先小程序通知,失败则公众号消息
-func (self *RailsadminController) NonAutoNoticeSelfUseByGranaryId() {
-
-	_id := self.Ctx.Input.Param(":id")
-	id, _ := strconv.ParseInt(_id, 10, 64)
-	useCache, _ := self.GetBool("cache")
-	granary := granary_model.GetGranaryById(id, useCache)
-	wxUser := user_model.GetWxUserByUserId(granary.UserId, useCache)
-	if wxUser == nil {
-		self.ServeJSON()
-		self.StopRun()
-	}
-	var tmpl *push_tmpl_model.XcxPushTmpl
-	if beego.BConfig.RunMode == beego.DEV {
-		tmpl = push_tmpl_model.GetXcxPushTmplById(3)
-	} else {
-		tmpl = push_tmpl_model.GetXcxPushTmplById(5)
-	}
-	if tmpl == nil {
-		self.ServeJSON()
-		self.StopRun()
-	}
-	product := product_model.GetProductById(granary.ProductId, useCache)
-	if product == nil {
-		self.ServeJSON()
-		self.StopRun()
-	}
-	//粮仓剩余自用份数
-	zyCount := granary.SelfUseMin - granary.SelfUseCount
-	if zyCount <= 0 {
-		self.ServeJSON()
-		self.StopRun()
-	}
-
-	var remark string
-	kw2 := fmt.Sprintf("自用")
-	page := fmt.Sprintf("pages/start/start?url=packageUser/pages/user/granary/granary")
-	emphasisKw := tmpl.EmphasisKw
-	if tmpl.EmphasisKw == "-" {
-		emphasisKw = ""
-	}
-	if tmpl.PushForce == 1 {
-		remark = tmpl.Keyword3
-	} else {
-		remark = fmt.Sprintf("您还有%d份商品未提货自用,请在规定时间内填写地址邮寄自用。", zyCount)
-	}
-	isSuccess := helpers.DeliveryNotify(*wxUser, product.Name, kw2, remark, emphasisKw, page)
-	if !isSuccess {
-		gzhTmpl := push_tmpl_model.GetPushTmplById(5)
-		if gzhTmpl == nil {
-			self.ServeJSON()
-			self.StopRun()
-		}
-		if gzhTmpl.PushForce == 1 {
-			remark = gzhTmpl.Remark
-		} else {
-			remark = fmt.Sprintf("请在规定时间内填写地址邮寄自用,点击前往。")
-		}
-		url := fmt.Sprintf("https://api.labitumall.com/v1/cfc/43")
-		first := fmt.Sprintf("提货方式:自用")
-		kw1 := fmt.Sprintf("FOHOW玖玖")
-		kw2 := product.Name
-		kw3 := fmt.Sprintf("您还有%d份未提货自用", zyCount)
-		kw4 := fmt.Sprintf("共收成%d份", granary.TotalCount)
-		kw5 := fmt.Sprintf("从%s开始", granary.CreatedAt.Format("2006年01月02日"))
-		uGzh := user_model.GetWxUserGzhByWxUIdAndAppId(wxUser.Id, beego.AppConfig.String("WxMPAppId"), false)
-		err := wx_mp.TmplmsgEventPickUpNotifyHandle(uGzh.GzhOpenId, url, first, kw1, kw2, kw3, kw4, kw5, remark)
-		if err == nil {
-			granary.LastZyRemindAt = time.Now().Unix()
-			granary.Save()
-		}
-	} else {
-		granary.LastZyRemindAt = time.Now().Unix()
-		granary.Save()
-	}
-
-	self.ServeJSON()
-}
-
-// 粮仓单独推送挂单消息,先小程序通知,失败则公众号消息
-func (self *RailsadminController) NonAutoNoticeApplyForSaleByGranaryId() {
-	_id := self.Ctx.Input.Param(":id")
-	id, _ := strconv.ParseInt(_id, 10, 64)
-	useCache, _ := self.GetBool("cache")
-	granary := granary_model.GetGranaryById(id, useCache)
-	wxUser := user_model.GetWxUserByUserId(granary.UserId, useCache)
-	if wxUser == nil {
-		self.ServeJSON()
-		self.StopRun()
-	}
-	var tmpl *push_tmpl_model.XcxPushTmpl
-	if beego.BConfig.RunMode == beego.DEV {
-		tmpl = push_tmpl_model.GetXcxPushTmplById(4)
-	} else {
-		tmpl = push_tmpl_model.GetXcxPushTmplById(6)
-	}
-	if tmpl == nil {
-		self.ServeJSON()
-		self.StopRun()
-	}
-	product := product_model.GetProductById(granary.ProductId, useCache)
-	if product == nil {
-		self.ServeJSON()
-		self.StopRun()
-	}
-	selfUse := int64(0)
-	if granary.SelfUseCount > granary.SelfUseMin {
-		selfUse = granary.SelfUseCount
-	} else {
-		selfUse = granary.SelfUseMin
-	}
-	//粮仓剩余可挂单份数
-	gdCount := granary.TotalCount - selfUse - granary.BuybackCount
-	saleOrder := granary_model.GetSaleOrderByGId(id, false)
-	//如果有代销订单,减除代销订单的数量
-	if saleOrder != nil {
-		if saleOrder.State == granary_model.ORDER_STATE_ONLINE ||
-			saleOrder.State == granary_model.ORDER_STATE_SELL_UP {
-			gdCount = gdCount - saleOrder.TotalCount
-		} else {
-			gdCount = gdCount - granary.SoldCount
-		}
-	}
-	if gdCount <= 0 {
-		self.ServeJSON()
-		self.StopRun()
-	}
-	var remark string
-	kw2 := fmt.Sprintf("挂单代销")
-	page := fmt.Sprintf("pages/start/start?url=packageUser/pages/user/granary/granary")
-	emphasisKw := tmpl.EmphasisKw
-	if tmpl.EmphasisKw == "-" {
-		emphasisKw = ""
-	}
-	if tmpl.PushForce == 1 {
-		remark = tmpl.Keyword3
-	} else {
-		remark = fmt.Sprintf("您还有%d份商品未挂单代销,请及时到会员中心-我的粮仓配置挂单数量,平台才会帮您进行代销售。", gdCount)
-	}
-	isSuccess := helpers.DeliveryNotify(*wxUser, product.Name, kw2, remark, emphasisKw, page)
-	if !isSuccess {
-		gzhTmpl := push_tmpl_model.GetPushTmplById(6)
-		if gzhTmpl == nil {
-			self.ServeJSON()
-			self.StopRun()
-		}
-		if gzhTmpl.PushForce == 1 {
-			remark = gzhTmpl.Remark
-		} else {
-			remark = fmt.Sprintf("请及时到会员中心-我的粮仓配置挂单数量,平台才会帮您进行代销售。")
-		}
-		url := fmt.Sprintf("https://api.labitumall.com/v1/cfc/43")
-		first := fmt.Sprintf("提货方式:挂单代销")
-		kw1 := fmt.Sprintf("FOHOW玖玖")
-		kw2 := product.Name
-		kw3 := fmt.Sprintf("您还有%d份未挂单代销", gdCount)
-		kw4 := fmt.Sprintf("共收成%d份", granary.TotalCount)
-		kw5 := fmt.Sprintf("从%s开始", granary.CreatedAt.Format("2006年01月02日"))
-		uGzh := user_model.GetWxUserGzhByWxUIdAndAppId(wxUser.Id, beego.AppConfig.String("WxMPAppId"), false)
-		err := wx_mp.TmplmsgEventPickUpNotifyHandle(uGzh.GzhOpenId, url, first, kw1, kw2, kw3, kw4, kw5, remark)
-		if err == nil {
-			granary.LastGdRemindAt = time.Now().Unix()
-			granary.Save()
-		}
-	} else {
-		granary.LastGdRemindAt = time.Now().Unix()
-		granary.Save()
-	}
-
-	self.ServeJSON()
-}

+ 0 - 1
go/gopath/src/fohow.com/apps/controllers/user_controller/one_click_binding_controller.go

@@ -3,7 +3,6 @@ package user_controller
 import (
 	"fohow.com/apps"
 	"fohow.com/apps/models/user_model"
-	"fohow.com/libs/regist"
 )
 
 //绑定手机

+ 0 - 134
go/gopath/src/fohow.com/libs/wx_mp/text.go

@@ -18,8 +18,6 @@ import (
 	"fohow.com/apps/models/wx_gongzhonghao_model"
 	// "fohow.com/libs/tool"
 	// "fohow.com/libs/wps"
-	"fohow.com/apps/models/subject_model"
-	"fohow.com/libs/tool"
 )
 
 // 处理文本消息
@@ -72,20 +70,6 @@ func HandleWithText(server, openid string, mixedMessage *mp.MixedMessage,
 	// 	}
 	// 	return nil
 	// }
-	//查询最新的参与抽奖的商品销售专题活动
-	if content == "我的抽奖号码" || content == "抽奖号码" {
-
-		productSaleSubject := subject_model.GetLastJoinPrizeActProductSaleSubject(false)
-		wxUserGzh := user_model.GetWxUserGzhByOpenId(openid, false)
-		if productSaleSubject != nil && productSaleSubject.IsPrizeAct {
-			go productSaleSubjectGetDrawCodesHandler(productSaleSubject, openid, wxUserGzh, gzh)
-			return nil
-		} else {
-			SendCustomMsgText(gzh.AppId, gzh.AppSecret, openid, "专题抽奖活动很快就会更新,敬请期待。", "")
-			return nil
-		}
-
-	}
 
 	// 搜索关键字回复
 	keyWordItem := key_word_push_model.GetPushTmplByKey(content)
@@ -166,121 +150,3 @@ func getWxUserByOpenidAndGzh(openid string, gzh *wx_gongzhonghao_model.WxGongzho
 	}
 	return wxUser
 }
-
-func productSaleSubjectGetDrawCodesHandler(subject *subject_model.ProductSaleSubject, openid string, wxUserGzh *user_model.WxUserGongzhonghao, gzh *wx_gongzhonghao_model.WxGongzhonghao) {
-
-	if gzh.AppId != beego.AppConfig.String("WxMPAppId") {
-		return
-	}
-
-	if subject == nil || wxUserGzh == nil || openid == "" {
-		return
-	}
-
-	var list []string
-	curList := subject_model.GetSaleDrawCodesBySubjectIdAndWxUid(subject.Id, wxUserGzh.WxUserId, false)
-	for _, item := range curList {
-		list = append(list, tool.GetAssignLengthStr(item.Code, 6))
-	}
-
-	if len(list) == 0 {
-		if time.Now().Unix() < subject.OpenPrizeTime.Unix() {
-			SendCustomMsgText(gzh.AppId, gzh.AppSecret, openid, fmt.Sprintf("专题抽奖活动最新一期为第%d期,您有一个%s的抽奖码待领取哟。机不可失时不再来!\n<a href='%s'>立即点击参与</a>", subject.Id, subject.PrizeName, fmt.Sprintf("%s/activity/project/%d", beego.AppConfig.String("WxHost"), subject.Id)), "")
-			return
-		} else {
-			SendCustomMsgText(gzh.AppId, gzh.AppSecret, openid, "专题抽奖活动很快就会更新,敬请期待。", "")
-			return
-		}
-	}
-
-	var codes string
-	for i, item := range list {
-		codes = codes + item
-		if (i+1)%3 == 0 {
-			codes = fmt.Sprintf("%s%s", codes, "\n")
-		} else if i != len(list)-1 {
-			codes = fmt.Sprintf("%s%s", codes, ",")
-		}
-	}
-	SendCustomMsgText(gzh.AppId, gzh.AppSecret, openid, fmt.Sprintf("专题抽奖活动最新一期为第%d期,您拥有的抽奖码:\n%s\n<a href='%s'>点击详情</a>", subject.Id, codes, fmt.Sprintf("%s/activity/project/%d", beego.AppConfig.String("WxHost"), subject.Id)), "")
-	return
-}
-
-// func CheckUserWantTo(appId, appSecret string, uId int64, openId string) {
-// func CheckUserWantTo(uId int64, openId string) {
-// 	var user *user_model.User
-// 	if openId != "" {
-// 		user = user_model.GetByOpenid(openId, true)
-// 		if user == nil {
-// 			// beego.BeeLogger.Warn("check user want to ,user is not exist")
-// 			return
-// 		}
-// 		uId = user.Id
-// 	} else {
-// 		user = user_model.GetByUid(uId, true)
-// 		if user == nil {
-// 			// beego.BeeLogger.Warn("check user want to ,user is not exist")
-// 			return
-// 		}
-// 		openId = user.Openid
-// 	}
-// 	uwt := user_model.GetUserWantTo(uId)
-// 	if uwt == nil {
-// 		// beego.BeeLogger.Warn("check user want to ,uwt is not exist")
-// 		return
-// 	}
-// 	wantTo := uwt.WantTo
-// 	relateId := uwt.RelateId
-// 	user_model.DeleteAll(uId)
-// 	var url, noticeContent string
-// 	if wantTo == "activity_create_order" {
-// 		url = fmt.Sprintf("%s/activity/show/%s",
-// 			beego.AppConfig.String("RailsHost"), relateId)
-// 		noticeContent = "感谢您的到来,点击进入发起挑战"
-// 	}
-// 	if wantTo == "activity_reduce_order" {
-// 		url = fmt.Sprintf("%s/activity/order/%s",
-// 			beego.AppConfig.String("RailsHost"), relateId)
-// 		noticeContent = "感谢您的到来,点击进入继续完成帮砍"
-// 	}
-// 	if wantTo == "duobao" {
-// 		url = fmt.Sprintf("%s/mall/duobao/detail/%s",
-// 			beego.AppConfig.String("WxHost"), relateId)
-// 		noticeContent = "感谢您的到来,点击进入夺宝"
-// 	}
-// 	// content := fmt.Sprintf("<a href='%s'>%s</a>", url, noticeContent)
-// 	// go SendCustomMsgText(appId, appSecret, openId, content, "")
-// 	go TmplmsgWaitingTask(openId, url, "", noticeContent, "希客商城", "")
-// }
-
-// func afterEventSCAN(sId int64, openid string) {
-// 	cq := channel_qrcode_model.GetBySceneId(sId)
-// 	if cq != nil {
-// 		cst := true
-// 		if cq.State != 1 {
-// 			if cq.ExpiredAt.Unix() < time.Now().Unix() {
-// 				cst = false
-// 			}
-// 		}
-// 		if cst {
-// 			cq.ScanTimes = cq.ScanTimes + 1
-// 			go cq.Save()
-// 		}
-// 		go new(channel_qrcode_model.ChannelQrcodeResult).Create(cq.Id, openid)
-// 	}
-// }
-
-// func call(url string) string {
-// 	connTimeout := 2 * time.Second
-// 	readTimeout := 10 * time.Second
-
-// 	var s string
-// 	var err error
-
-// 	s, err = httplib.Get(url).Debug(true).SetTimeout(connTimeout, readTimeout).String()
-
-// 	if err != nil {
-// 		beego.BeeLogger.Error("call '%s' err=[%s]", url, err)
-// 	}
-// 	return s
-// }

+ 1 - 0
go/gopath/src/github.com/GiterLab/aliyun-sms-go-sdk

@@ -0,0 +1 @@
+Subproject commit fcc9f11de968b3470ec55298e8a7f8f21588cd21

+ 1 - 0
go/gopath/src/github.com/GiterLab/urllib

@@ -0,0 +1 @@
+Subproject commit ea0e875f90303d1469067f22ccda69f903380a87

+ 1 - 0
go/gopath/src/github.com/tobyzxj/uuid

@@ -0,0 +1 @@
+Subproject commit aa0153c14395f4431fe668071eeda5d4a0290f95