|
@@ -1,8 +1,10 @@
|
|
|
package entity
|
|
|
|
|
|
import (
|
|
|
- "time"
|
|
|
+ "encoding/json"
|
|
|
"jy/src/jfw/modules/subscribepay/src/util"
|
|
|
+ "log"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
//打赏
|
|
@@ -11,12 +13,39 @@ type reWardStruct struct{}
|
|
|
|
|
|
var JyReWardStruct reWardStruct
|
|
|
|
|
|
-//打赏回调方法
|
|
|
+// 打赏回调方法
|
|
|
func (r *reWardStruct) PayCallBack(param *CallBackParam) bool {
|
|
|
query := map[string]interface{}{
|
|
|
"s_tradeno": param.OutTradeno,
|
|
|
"i_status": 0,
|
|
|
}
|
|
|
+ filterMap := map[string]interface{}{
|
|
|
+ "contractStatus": 0,
|
|
|
+ "product": "",
|
|
|
+ "remark": "用户打赏收入",
|
|
|
+ "source": "qmx",
|
|
|
+ }
|
|
|
+ filter, _ := json.Marshal(filterMap)
|
|
|
+ //生成订单
|
|
|
+ if util.Mysql.Insert("dataexport_order", map[string]interface{}{
|
|
|
+ "order_code": param.OrderCode,
|
|
|
+ "order_money": param.TotalFee,
|
|
|
+ "pay_money": param.CashFee,
|
|
|
+ "pay_time": time.Now().Format("2006-01-02 15:04:05"),
|
|
|
+ "filter": string(filter),
|
|
|
+ "order_status": 1,
|
|
|
+ "service_status": 0,
|
|
|
+ "product_type": "打赏",
|
|
|
+ "create_time": time.Now().Format("2006-01-02 15:04:05"),
|
|
|
+ "distribution_channel": "x01", //销售渠道
|
|
|
+ "order_channel": "xdqd01", //下单渠道
|
|
|
+ "saleDep": "040000",
|
|
|
+ "audit_status": 3, //默认审核通过
|
|
|
+ "buy_subject": 1,
|
|
|
+ "pay_way": "wx_pc",
|
|
|
+ }) < 0 {
|
|
|
+ log.Println("生成订单出错")
|
|
|
+ }
|
|
|
return util.MQFW.Update("reward", query, map[string]interface{}{
|
|
|
"$set": map[string]interface{}{
|
|
|
"i_status": 1,
|