|
@@ -348,7 +348,7 @@ func (srv *OrderService) AddOrder(orderItem *entity.Order, city_id int, city str
|
|
|
}
|
|
|
if orderItem.IsNeedPay != "N" {
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
client.HSet("order_unpay", orderItem.Id, fmt.Sprintf("%s;%d", orderItem.CreatedAt, orderItem.MaterialId))
|
|
|
}
|
|
|
//update sale num of product
|
|
@@ -357,7 +357,7 @@ func (srv *OrderService) AddOrder(orderItem *entity.Order, city_id int, city str
|
|
|
go func() {
|
|
|
if util.SourceCheck(orderItem.Source) && orderItem.Source != "lianren" {
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
msg := map[string]interface{}{
|
|
|
"user": "system",
|
|
|
"orderid": orderItem.Id,
|
|
@@ -483,7 +483,7 @@ func (srv *OrderService) AddOrderInner(orderItem *entity.Order, city_id int, cit
|
|
|
fmt.Println(err)
|
|
|
}
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
client.HSet("order_unpay", orderItem.Id, fmt.Sprintf("%s;%d", orderItem.CreatedAt, orderItem.MaterialId))
|
|
|
//update sale num of product
|
|
|
db.Exec("update t_product set sale_num = sale_num + 1 where id in (" + util.IntJoin(productIds, ",") + ");")
|
|
@@ -731,8 +731,6 @@ func (srv *OrderService) AddOrderFCode(orderItem *entity.Order, city_id int, cit
|
|
|
return orderItem, nil
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
// 20240122 创建普通订单以后创建普通非支付订单可以调用次方法
|
|
|
func AddOrderNormal(orderItem *entity.Order) (string, error) {
|
|
|
db := util.GetWriteSqlDB()
|
|
@@ -1070,7 +1068,7 @@ func (srv *OrderService) Pay(orderItem *entity.Order, extra map[string]string) (
|
|
|
srv.firstGiveTicket(orderDb.CustomMobile)
|
|
|
//inform admin
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
msg := map[string]interface{}{
|
|
|
"user": "system",
|
|
|
"orderid": orderItem.Id,
|
|
@@ -1110,7 +1108,7 @@ AFTERPAY:
|
|
|
go func() {
|
|
|
if util.SourceCheck(orderDb.Source) {
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
msg := map[string]interface{}{
|
|
|
"user": "system",
|
|
|
"orderid": orderDb.Id,
|
|
@@ -1124,11 +1122,10 @@ AFTERPAY:
|
|
|
return payResult, nil
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 从redis删除该订单未支付状态并发布消息通知订单状态变更
|
|
|
func delUnpayFromRedis(orderId string) {
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
client.HDel("order_unpay", orderId)
|
|
|
}
|
|
|
|
|
@@ -1227,7 +1224,7 @@ func (srv *OrderService) wxPay(orderItem *entity.Order, extra map[string]string)
|
|
|
//小程序支付时保存prepare_id 到redis,用于后续支付成功发送模板消息
|
|
|
if extra["wx_type"] == "mp" {
|
|
|
rclient := util.GetRedis()
|
|
|
- rclient.Select(2)
|
|
|
+ rclient.Select(12)
|
|
|
rclient.HSet("mp_prepare_id", orderItem.Id, rel.PrepayId)
|
|
|
}
|
|
|
resultItem["sign"] = wxJsSdk.ComputePaySignature(resultItem, config.IniConf.Section("weixin").Key("wx.apikey").Value())
|
|
@@ -1615,7 +1612,7 @@ func (srv *OrderService) WxPayCB(payResult map[string]string) {
|
|
|
JUMPSMS:
|
|
|
//inform admin
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
msg := map[string]interface{}{
|
|
|
"user": "system",
|
|
|
"orderid": orderItem[0].Id,
|
|
@@ -1743,7 +1740,7 @@ func (srv *OrderService) AliPayCB(payResult map[string]string) {
|
|
|
}
|
|
|
//inform admin
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
msg := map[string]interface{}{
|
|
|
"user": "system",
|
|
|
"orderid": orderItem[0].Id,
|
|
@@ -1847,7 +1844,7 @@ func (srv *OrderService) SendWxPaySuccessMsg(params map[string]string) (interfac
|
|
|
if params["wx_type"] == "mp" {
|
|
|
|
|
|
rclient := util.GetRedis()
|
|
|
- rclient.Select(2)
|
|
|
+ rclient.Select(12)
|
|
|
strCmd := rclient.HGet("mp_prepare_id", nameList[0].OrderId)
|
|
|
if terr := strCmd.Err(); terr != nil {
|
|
|
log.Println(terr)
|
|
@@ -2220,7 +2217,7 @@ func (srv *OrderService) DelOrder(oid string) (bool, error) {
|
|
|
func pushOrderStatus(orderId, source string, status int) {
|
|
|
if util.SourceCheck(source) {
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
msg := map[string]interface{}{
|
|
|
"user": "system",
|
|
|
"orderid": orderId,
|
|
@@ -2619,7 +2616,7 @@ func UpdateOrderCase4(oitem *entity.Order) (bool, error) {
|
|
|
tx.Commit()
|
|
|
if util.SourceCheck(old.Source) {
|
|
|
client := util.GetRedis()
|
|
|
- client.Select(2)
|
|
|
+ client.Select(12)
|
|
|
msg := map[string]interface{}{
|
|
|
"user": "system",
|
|
|
"orderid": old.Id,
|
|
@@ -2719,7 +2716,6 @@ func (srv *OrderService) GetOrderInfoByCode(code string) (interface{}, error) {
|
|
|
return srv.IOrder.GetByCode(code)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
func (srv *OrderService) GetOrderInfoByNurse(orderId string, deliverUserId int) (interface{}, error) {
|
|
|
db := util.GetSqlDB()
|
|
|
var oid string
|
|
@@ -3070,8 +3066,6 @@ func lianRenPrice(list []*entity.ProductDB, shopId int) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
// 20230830 拆分历史表
|
|
|
// 提取 addorder addorderFcode addorderFcodeYuanyi addGenorder 的库存检查
|
|
|
func Stocklimit(mobile string, productIds []int, productQuantityMap map[int]int, isZFB bool) ([]*entity.ProductDB, error) {
|