mirror of http://gitlab.batiao8.com/yic/film.git
cinemabrand
This commit is contained in:
parent
9be23976f9
commit
8c8aa7662e
|
@ -1,7 +1,21 @@
|
|||
package util
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func MoneyFen(money int64) string {
|
||||
return fmt.Sprintf("%.2f", float64(money)/100)
|
||||
}
|
||||
|
||||
func CinemaBrand(name string) string {
|
||||
|
||||
reg, err := regexp.Compile("[^((]*")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
r := reg.Find([]byte(name))
|
||||
return strings.Trim(string(r), "\r\n\t ")
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ type Order struct {
|
|||
ProvinceName string
|
||||
Ting string
|
||||
CinemaName string
|
||||
CinemaBrand string
|
||||
MovieName string
|
||||
Address string
|
||||
Count int
|
||||
|
|
|
@ -3,6 +3,7 @@ package haha
|
|||
import (
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"film/base/util"
|
||||
"film/model"
|
||||
"fmt"
|
||||
"github.com/go-co-op/gocron"
|
||||
|
@ -99,6 +100,7 @@ func (s *SyncOrder) run() {
|
|||
order.Address = cast.ToString(data["address"])
|
||||
order.Ting = cast.ToString(data["ting"])
|
||||
order.CinemaName = cast.ToString(data["cinemaName"])
|
||||
order.CinemaBrand = util.CinemaBrand(order.CinemaName)
|
||||
order.Count = cast.ToInt(data["count"])
|
||||
order.IsSeat = cast.ToInt(data["is_seat"])
|
||||
order.LoverSeat = cast.ToInt(data["loverSeat"])
|
||||
|
|
Loading…
Reference in New Issue