mirror of http://gitlab.batiao8.com/yic/film.git
enable
This commit is contained in:
parent
2bfcaf61de
commit
957622016a
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"enable": true,
|
||||||
"bidProfit": 50,
|
"bidProfit": 50,
|
||||||
"couponCost": 3000
|
"couponCost": 3000
|
||||||
}
|
}
|
|
@ -6,6 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Dadi struct {
|
type Dadi struct {
|
||||||
|
Enable bool `json:"enable"`
|
||||||
BidProfit int64 `json:"bidProfit"`
|
BidProfit int64 `json:"bidProfit"`
|
||||||
CouponCost int64 `json:"couponCost"`
|
CouponCost int64 `json:"couponCost"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,16 +65,6 @@ func (w *Worker) processorDadi(order *model.Order) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//hahaProcessor.BidPrice(order.Id, checkInfo.UnitPrice)
|
|
||||||
go func() {
|
|
||||||
/*
|
|
||||||
time.Sleep(60 * time.Second)
|
|
||||||
if err := dadiProcessor.CancelOrder(order, checkInfo); err != nil {
|
|
||||||
log.Errorf("cancel order[%s] error[%s]", order.OrderId, err.Error())
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}()
|
|
||||||
|
|
||||||
bidStatus := false
|
bidStatus := false
|
||||||
realCost := checkInfo.TotalRealPrice + int64(goutil.If(checkInfo.CouponPrice > 0, config.GetDadiConfig().CouponCost, 0))
|
realCost := checkInfo.TotalRealPrice + int64(goutil.If(checkInfo.CouponPrice > 0, config.GetDadiConfig().CouponCost, 0))
|
||||||
realUnitCost := realCost / int64(order.SeatNum)
|
realUnitCost := realCost / int64(order.SeatNum)
|
||||||
|
@ -144,9 +134,12 @@ func (w *Worker) Run() {
|
||||||
if !strings.Contains(order.CinemaName, "大地影院") {
|
if !strings.Contains(order.CinemaName, "大地影院") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
w.processorDadi(order)
|
if config.GetDadiConfig().Enable {
|
||||||
|
w.processorDadi(order)
|
||||||
|
}
|
||||||
|
|
||||||
case updateOrder := <-updateOrderChan:
|
case updateOrder := <-updateOrderChan:
|
||||||
log.Debugf("update:", goutil.EncodeJSON(updateOrder))
|
log.Tracef("%s update", updateOrder.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue