package card_info_t_mall_game

import (
	"context"
	"kami/internal/dao"
	"kami/internal/model/entity"
	"kami/utility/config"

	"github.com/gogf/gf/v2/text/gstr"

	"kami/api/card_info_t_mall_game/v1"
)

func (c *ControllerV1) TMallGameOrderQueryOrder(ctx context.Context, req *v1.TMallGameOrderQueryOrderReq) (res *v1.TMallGameOrderQueryOrderRes, err error) {
	var data entity.V1RechargeTMallOrderFake
	_ = dao.V1RechargeTMallOrderFake.Ctx(ctx).DB(config.GetDatabaseV1()).
		Where(dao.V1RechargeTMallOrderFake.Columns().Account, gstr.TrimAll(req.Account)).
		Scan(&data)
	res = &v1.TMallGameOrderQueryOrderRes{
		Account:      data.Account,
		Amount:       data.Amount,
		Category:     data.Category,
		Id:           data.Id,
		OrderNo:      data.OrderNo,
		SourceOfShop: data.SourceOfShop,
		Status:       data.Status,
		TopUpTime:    data.TopUpTime,
	}
	return
}
