feat: 修改部署乱七八糟的
This commit is contained in:
@@ -3,7 +3,7 @@ FROM golang:1.22 AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY ./ /build/
|
||||
COPY .. /build/
|
||||
|
||||
ARG USE_PROXY
|
||||
# 根据USE_PROXY参数设置环境变量
|
||||
@@ -40,8 +40,9 @@ COPY --from=builder /build/main /app/
|
||||
COPY --from=builder /build/conf/ /app/conf/
|
||||
COPY --from=builder /build/views/ /app/views/
|
||||
COPY --from=builder /build/static/ /app/static/
|
||||
COPY --from=builder /build/deploy/wait-for-it.sh /app/
|
||||
|
||||
# 启动服务
|
||||
CMD ["./main"]
|
||||
CMD ["sh", "wait-for-it.sh", "mysql:3306" , "./main"]
|
||||
|
||||
EXPOSE 12307
|
||||
19
deploy/docker-compose-local.yaml
Normal file
19
deploy/docker-compose-local.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
shop_kami:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ./deploy/Dockerfile
|
||||
args:
|
||||
- USE_PROXY=1
|
||||
container_name: kami_shop
|
||||
image: kami_shop:latest
|
||||
ports:
|
||||
- "12307:12307"
|
||||
networks:
|
||||
- 1panel-network
|
||||
labels:
|
||||
createdBy: Developer
|
||||
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
19
deploy/wait-for-it.sh
Normal file
19
deploy/wait-for-it.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# $1 = host to connect to (e.g. localhost)
|
||||
# $2 = port to connect to (e.g. 3306)
|
||||
# $3 = timeout in seconds, after which the script will exit with status 1 (optional)
|
||||
# Example usage:
|
||||
# wait-for-it.sh localhost:3306 -- /usr/bin/python app.py
|
||||
#
|
||||
set -x
|
||||
host="${1%:*}"
|
||||
port="${1#*:}"
|
||||
shift
|
||||
# shellcheck disable=SC2124
|
||||
cmd="$@"
|
||||
until nc -z "$host" "$port"; do
|
||||
>&2 echo "Waiting for $host:$port to be available..."
|
||||
sleep 1
|
||||
done
|
||||
>&2 echo "$host:$port is available!"
|
||||
exec "$cmd"
|
||||
@@ -1,21 +0,0 @@
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
container_name: kami_merchant-test
|
||||
image: kami_merchant_test:0.11
|
||||
restart:
|
||||
always
|
||||
ports:
|
||||
- "127.0.0.1:22307:12307"
|
||||
volumes:
|
||||
- /data/kami/merchant/conf/:/app/conf/
|
||||
- /data/kami/merchant/logs/:/app/logs/
|
||||
networks:
|
||||
- 1panel-network
|
||||
labels:
|
||||
createdBy: Developer
|
||||
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
2
cache/redis.go → internal/cache/redis.go
vendored
2
cache/redis.go → internal/cache/redis.go
vendored
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/go-redis/redis"
|
||||
"github.com/pkg/errors"
|
||||
"merchant/config"
|
||||
"merchant/internal/config"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
package controllers
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for 账户变动
|
||||
** @Time : 19.12.10 10:42
|
||||
** @Author : Joker
|
||||
** @File : account_history
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.10 10:42
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"merchant/models/account"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/order"
|
||||
"merchant/sys/enum"
|
||||
"merchant/internal/models/account"
|
||||
"merchant/internal/models/merchant"
|
||||
"merchant/internal/models/order"
|
||||
"merchant/internal/sys/enum"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
@@ -14,11 +14,11 @@ import (
|
||||
"fmt"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/tealeg/xlsx"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/order"
|
||||
"merchant/models/payfor"
|
||||
"merchant/sys/enum"
|
||||
"merchant/utils"
|
||||
"merchant/internal/models/merchant"
|
||||
order2 "merchant/internal/models/order"
|
||||
"merchant/internal/models/payfor"
|
||||
"merchant/internal/sys/enum"
|
||||
"merchant/internal/utils"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -74,7 +74,7 @@ func (c *DealExcel) MakeOrderExcel() {
|
||||
)
|
||||
|
||||
// 数据获取
|
||||
list := order.GetOrderProfitByMap(in, -1, 0)
|
||||
list := order2.GetOrderProfitByMap(in, -1, 0)
|
||||
if len(list) <= 0 {
|
||||
msg = "没有检索到数据!"
|
||||
goto stopRun
|
||||
@@ -223,7 +223,7 @@ func (c *DealExcel) MakeComplaintExcel() {
|
||||
)
|
||||
|
||||
// 数据获取
|
||||
list := order.GetOrderByMap(in, -1, 0)
|
||||
list := order2.GetOrderByMap(in, -1, 0)
|
||||
if len(list) <= 0 {
|
||||
msg = "没有检索到数据!"
|
||||
goto stopRun
|
||||
@@ -1,6 +1,8 @@
|
||||
package controllers
|
||||
|
||||
import "merchant/sys/enum"
|
||||
import (
|
||||
"merchant/internal/sys/enum"
|
||||
)
|
||||
|
||||
type DownloadController struct {
|
||||
KeepSession
|
||||
@@ -2,16 +2,15 @@ package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"merchant/internal/models/merchant"
|
||||
"merchant/internal/models/order"
|
||||
"merchant/internal/sys/enum"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"github.com/rs/xid"
|
||||
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/order"
|
||||
"merchant/sys/enum"
|
||||
)
|
||||
|
||||
type GenLink struct {
|
||||
@@ -11,11 +11,11 @@ package controllers
|
||||
****************************************************/
|
||||
import (
|
||||
"fmt"
|
||||
"merchant/models/account"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/order"
|
||||
"merchant/models/road"
|
||||
"merchant/sys/enum"
|
||||
"merchant/internal/models/account"
|
||||
merchant2 "merchant/internal/models/merchant"
|
||||
order2 "merchant/internal/models/order"
|
||||
"merchant/internal/models/road"
|
||||
"merchant/internal/sys/enum"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ type Index struct {
|
||||
// ShowUI 首页
|
||||
func (c *Index) ShowUI() {
|
||||
us := c.GetSession(enum.UserSession)
|
||||
u := us.(merchant.MerchantInfo)
|
||||
u := us.(merchant2.MerchantInfo)
|
||||
c.Data["userName"] = u.MerchantName
|
||||
|
||||
c.TplName = "index.html"
|
||||
@@ -35,7 +35,7 @@ func (c *Index) ShowUI() {
|
||||
// LoadUserAccountInfo 加载用户账户金额信息
|
||||
func (c *Index) LoadUserAccountInfo() {
|
||||
us := c.GetSession(enum.UserSession)
|
||||
u := us.(merchant.MerchantInfo)
|
||||
u := us.(merchant2.MerchantInfo)
|
||||
|
||||
ac := account.GetAccountByUid(u.MerchantUid)
|
||||
|
||||
@@ -60,9 +60,9 @@ func (c *Index) LoadUserAccountInfo() {
|
||||
// LoadCountOrder 加载总订单信息
|
||||
func (c *Index) LoadCountOrder() {
|
||||
us := c.GetSession(enum.UserSession)
|
||||
u := us.(merchant.MerchantInfo)
|
||||
u := us.(merchant2.MerchantInfo)
|
||||
|
||||
md := merchant.GetMerchantDeployByUid(u.MerchantUid)
|
||||
md := merchant2.GetMerchantDeployByUid(u.MerchantUid)
|
||||
|
||||
type orderInPayWay struct {
|
||||
PayWayName string // 支付方式名
|
||||
@@ -80,10 +80,10 @@ func (c *Index) LoadCountOrder() {
|
||||
ways[k].PayWayName = road.GetRoadInfoByRoadUid(v.SingleRoadUid).ProductName
|
||||
|
||||
in["road_uid"] = v.SingleRoadUid
|
||||
ways[k].OrderCount = order.GetOrderLenByMap(in)
|
||||
ways[k].OrderCount = order2.GetOrderLenByMap(in)
|
||||
|
||||
in["status"] = enum.SUCCESS
|
||||
ways[k].SucOrderCount = order.GetOrderLenByMap(in)
|
||||
ways[k].SucOrderCount = order2.GetOrderLenByMap(in)
|
||||
|
||||
if ways[k].OrderCount == 0 {
|
||||
ways[k].SucRate = "0"
|
||||
@@ -100,16 +100,16 @@ func (c *Index) LoadCountOrder() {
|
||||
// LoadOrderCount 加载总订单数
|
||||
func (c *Index) LoadOrderCount() {
|
||||
us := c.GetSession(enum.UserSession)
|
||||
u := us.(merchant.MerchantInfo)
|
||||
u := us.(merchant2.MerchantInfo)
|
||||
|
||||
out := make(map[string]interface{})
|
||||
|
||||
in := make(map[string]string)
|
||||
in["merchant_uid"] = u.MerchantUid
|
||||
out["orders"] = order.GetOrderLenByMap(in)
|
||||
out["orders"] = order2.GetOrderLenByMap(in)
|
||||
|
||||
in["status"] = enum.SUCCESS
|
||||
out["suc_orders"] = order.GetOrderLenByMap(in)
|
||||
out["suc_orders"] = order2.GetOrderLenByMap(in)
|
||||
|
||||
{
|
||||
supplierAll := 0.0
|
||||
@@ -117,7 +117,7 @@ func (c *Index) LoadOrderCount() {
|
||||
agentAll := 0.0
|
||||
allAmount := 0.0
|
||||
TadaySuccessNum := 0
|
||||
datainfo := order.GetOrderProfitByMap(in, -1, 0)
|
||||
datainfo := order2.GetOrderProfitByMap(in, -1, 0)
|
||||
|
||||
for _, v := range datainfo {
|
||||
if v.Status != "success" {
|
||||
@@ -154,7 +154,7 @@ func (c *Index) LoadOrderCount() {
|
||||
// LoadUserPayWayUI 加载用户支付配置
|
||||
func (c *Index) LoadUserPayWayUI() {
|
||||
us := c.GetSession(enum.UserSession)
|
||||
u := us.(merchant.MerchantInfo)
|
||||
u := us.(merchant2.MerchantInfo)
|
||||
|
||||
c.Data["userName"] = u.MerchantName
|
||||
c.TplName = "pay_way.html"
|
||||
@@ -162,9 +162,9 @@ func (c *Index) LoadUserPayWayUI() {
|
||||
|
||||
func (c *Index) LoadUserPayWay() {
|
||||
us := c.GetSession(enum.UserSession)
|
||||
u := us.(merchant.MerchantInfo)
|
||||
u := us.(merchant2.MerchantInfo)
|
||||
|
||||
md := merchant.GetMerchantDeployByUid(u.MerchantUid)
|
||||
md := merchant2.GetMerchantDeployByUid(u.MerchantUid)
|
||||
|
||||
type payConfig struct {
|
||||
No string // 通道编号
|
||||
@@ -1,17 +1,8 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 保持会话
|
||||
** @Time : 19.11.29 13:55
|
||||
** @Author : Joker
|
||||
** @File : keep_session
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.11.29 13:55
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package controllers
|
||||
|
||||
import (
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"merchant/sys/enum"
|
||||
"merchant/internal/sys/enum"
|
||||
)
|
||||
|
||||
type KeepSession struct {
|
||||
@@ -4,13 +4,13 @@ import (
|
||||
"fmt"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"github.com/dchest/captcha"
|
||||
"merchant/config"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/user"
|
||||
"merchant/sys"
|
||||
"merchant/sys/enum"
|
||||
"merchant/utils"
|
||||
"merchant/utils/mfa"
|
||||
"merchant/internal/config"
|
||||
"merchant/internal/models/merchant"
|
||||
"merchant/internal/models/user"
|
||||
"merchant/internal/sys"
|
||||
"merchant/internal/sys/enum"
|
||||
"merchant/internal/utils"
|
||||
"merchant/internal/utils/mfa"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
@@ -4,12 +4,12 @@ import (
|
||||
"fmt"
|
||||
"github.com/rs/xid"
|
||||
"github.com/tealeg/xlsx"
|
||||
"merchant/consts"
|
||||
"merchant/models/account"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/payfor"
|
||||
"merchant/sys/enum"
|
||||
"merchant/utils"
|
||||
"merchant/internal/consts"
|
||||
"merchant/internal/models/account"
|
||||
"merchant/internal/models/merchant"
|
||||
"merchant/internal/models/payfor"
|
||||
"merchant/internal/sys/enum"
|
||||
"merchant/internal/utils"
|
||||
"path"
|
||||
"regexp"
|
||||
"strconv"
|
||||
@@ -1,11 +1,11 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"merchant/models/account"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/order"
|
||||
"merchant/service"
|
||||
"merchant/sys/enum"
|
||||
"merchant/internal/models/account"
|
||||
"merchant/internal/models/merchant"
|
||||
order2 "merchant/internal/models/order"
|
||||
"merchant/internal/service"
|
||||
"merchant/internal/sys/enum"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
@@ -66,20 +66,20 @@ func (c *TradeRecord) TradeQueryAndListPage() {
|
||||
}
|
||||
|
||||
// 计算分页数
|
||||
count := order.GetOrderLenByMap(in)
|
||||
count := order2.GetOrderLenByMap(in)
|
||||
totalPage := count / limit // 计算总页数
|
||||
if count%limit != 0 { // 不满一页的数据按一页计算
|
||||
totalPage++
|
||||
}
|
||||
|
||||
// 数据获取
|
||||
var list []order.OrderInfo
|
||||
var list []order2.OrderInfo
|
||||
if page <= totalPage {
|
||||
list = order.GetOrderByMap(in, limit, (page-1)*limit)
|
||||
list = order2.GetOrderByMap(in, limit, (page-1)*limit)
|
||||
}
|
||||
|
||||
type resDataStruct struct {
|
||||
order.OrderProfitInfo
|
||||
order2.OrderProfitInfo
|
||||
ExValue string
|
||||
CreateTime string
|
||||
}
|
||||
@@ -90,7 +90,7 @@ func (c *TradeRecord) TradeQueryAndListPage() {
|
||||
for _, info := range list {
|
||||
bankIdList = append(bankIdList, info.BankOrderId)
|
||||
}
|
||||
orderProfitInfo := order.GetOrderProfitListByBankOrderIdList(bankIdList)
|
||||
orderProfitInfo := order2.GetOrderProfitListByBankOrderIdList(bankIdList)
|
||||
|
||||
for _, info := range list {
|
||||
for _, profitInfo := range orderProfitInfo {
|
||||
@@ -174,16 +174,16 @@ func (c *TradeRecord) ComplaintQueryAndListPage() {
|
||||
}
|
||||
|
||||
// 计算分页数
|
||||
count := order.GetOrderLenByMap(in)
|
||||
count := order2.GetOrderLenByMap(in)
|
||||
totalPage := count / limit // 计算总页数
|
||||
if count%limit != 0 { // 不满一页的数据按一页计算
|
||||
totalPage++
|
||||
}
|
||||
|
||||
// 数据获取
|
||||
var list []order.OrderInfo
|
||||
var list []order2.OrderInfo
|
||||
if page <= totalPage {
|
||||
list = order.GetOrderByMap(in, limit, (page-1)*limit)
|
||||
list = order2.GetOrderByMap(in, limit, (page-1)*limit)
|
||||
}
|
||||
|
||||
// 数据回显
|
||||
@@ -3,13 +3,13 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"merchant/datas"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/road"
|
||||
"merchant/service"
|
||||
"merchant/sys/enum"
|
||||
"merchant/utils/mfa"
|
||||
"merchant/utils/response"
|
||||
"merchant/internal/datas"
|
||||
"merchant/internal/models/merchant"
|
||||
"merchant/internal/models/road"
|
||||
"merchant/internal/service"
|
||||
"merchant/internal/sys/enum"
|
||||
"merchant/internal/utils/mfa"
|
||||
"merchant/internal/utils/response"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
@@ -3,12 +3,12 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/rs/xid"
|
||||
"merchant/consts"
|
||||
"merchant/models/account"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/payfor"
|
||||
"merchant/sys/enum"
|
||||
"merchant/utils"
|
||||
"merchant/internal/consts"
|
||||
"merchant/internal/models/account"
|
||||
"merchant/internal/models/merchant"
|
||||
"merchant/internal/models/payfor"
|
||||
"merchant/internal/sys/enum"
|
||||
"merchant/internal/utils"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -1,12 +1,3 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/9/19 14:41
|
||||
** @Author : yuebin
|
||||
** @File : agent_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/9/19 14:41
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package agent
|
||||
|
||||
import (
|
||||
@@ -5,15 +5,15 @@ import (
|
||||
"github.com/beego/beego/v2/adapter/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"merchant/models/account"
|
||||
"merchant/models/agent"
|
||||
"merchant/models/menu"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/notify"
|
||||
"merchant/models/order"
|
||||
"merchant/models/payfor"
|
||||
"merchant/models/road"
|
||||
"merchant/models/user"
|
||||
"merchant/internal/models/account"
|
||||
"merchant/internal/models/agent"
|
||||
menu2 "merchant/internal/models/menu"
|
||||
merchant2 "merchant/internal/models/merchant"
|
||||
"merchant/internal/models/notify"
|
||||
order2 "merchant/internal/models/order"
|
||||
"merchant/internal/models/payfor"
|
||||
road2 "merchant/internal/models/road"
|
||||
user2 "merchant/internal/models/user"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -30,23 +30,23 @@ func init() {
|
||||
_ = orm.RegisterDriver("mysql", orm.DRMySQL)
|
||||
_ = orm.RegisterDataBase("default", "mysql", link, 30, 30)
|
||||
orm.RegisterModel(
|
||||
new(user.UserInfo),
|
||||
new(menu.MenuInfo),
|
||||
new(menu.SecondMenuInfo),
|
||||
new(menu.PowerInfo),
|
||||
new(user.RoleInfo),
|
||||
new(user2.UserInfo),
|
||||
new(menu2.MenuInfo),
|
||||
new(menu2.SecondMenuInfo),
|
||||
new(menu2.PowerInfo),
|
||||
new(user2.RoleInfo),
|
||||
new(account.BankCardInfo),
|
||||
new(road.RoadInfo),
|
||||
new(road.RoadPoolInfo),
|
||||
new(road2.RoadInfo),
|
||||
new(road2.RoadPoolInfo),
|
||||
new(agent.AgentInfo),
|
||||
new(merchant.MerchantInfo),
|
||||
new(merchant.MerchantDeployInfo),
|
||||
new(merchant2.MerchantInfo),
|
||||
new(merchant2.MerchantDeployInfo),
|
||||
new(account.AccountInfo),
|
||||
new(account.AccountHistoryInfo),
|
||||
new(order.OrderInfo),
|
||||
new(order.OrderProfitInfo),
|
||||
new(order.OrderSettleInfo),
|
||||
new(order2.OrderInfo),
|
||||
new(order2.OrderProfitInfo),
|
||||
new(order2.OrderSettleInfo),
|
||||
new(notify.NotifyInfo),
|
||||
new(merchant.MerchantLoadInfo),
|
||||
new(merchant2.MerchantLoadInfo),
|
||||
new(payfor.PayForInfo))
|
||||
}
|
||||
@@ -1,14 +1,5 @@
|
||||
package order
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/10/28 10:15
|
||||
** @Author : yuebin
|
||||
** @File : order_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/10/28 10:15
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"merchant/utils"
|
||||
"merchant/internal/utils"
|
||||
)
|
||||
|
||||
type Params struct {
|
||||
@@ -1,19 +1,9 @@
|
||||
package order
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/10/30 11:44
|
||||
** @Author : yuebin
|
||||
** @File : order_profit_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/10/30 11:44
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"merchant/models/account"
|
||||
"merchant/internal/models/account"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
package order
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/10/30 11:41
|
||||
** @Author : yuebin
|
||||
** @File : order_settle_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/10/30 11:41
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"fmt"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"merchant/consts"
|
||||
account2 "merchant/models/account"
|
||||
"merchant/utils"
|
||||
"merchant/internal/consts"
|
||||
"merchant/internal/models/account"
|
||||
"merchant/internal/utils"
|
||||
)
|
||||
|
||||
type PayForInfo struct {
|
||||
@@ -172,7 +172,7 @@ func ForUpdatePayFor(payFor PayForInfo) bool {
|
||||
if payFor.Status == consts.PAYFOR_SOLVING && tmp.Status == consts.PAYFOR_COMFRIM &&
|
||||
payFor.GiveType == consts.PAYFOR_HAND && payFor.Type != consts.SELF_HELP {
|
||||
|
||||
var account account2.AccountInfo
|
||||
var account account.AccountInfo
|
||||
if err := txOrm.Raw("select * from account_info where account_uid = ? for update", payFor.MerchantUid).QueryRow(&account); err != nil || account.AccountUid == "" {
|
||||
logs.Error("for update payfor select account info,fail:", err)
|
||||
return err
|
||||
@@ -1,12 +1,3 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/9/9 16:35
|
||||
** @Author : yuebin
|
||||
** @File : road_pool_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/9/9 16:35
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package road
|
||||
|
||||
import (
|
||||
@@ -3,7 +3,7 @@ package routers
|
||||
import (
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"github.com/dchest/captcha"
|
||||
"merchant/controllers"
|
||||
"merchant/internal/controllers"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -2,14 +2,14 @@ package service
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"merchant/models/merchant"
|
||||
"merchant/models/road"
|
||||
merchant2 "merchant/internal/models/merchant"
|
||||
"merchant/internal/models/road"
|
||||
)
|
||||
|
||||
// QueryAllowedDeployInfoMM 获取指定商户的允许面额信息
|
||||
func QueryAllowedDeployInfoMM(merchantUid, roadUid string) []merchant.ProfitMargin {
|
||||
resInfo := make([]merchant.ProfitMargin, 0)
|
||||
merchantInfoList := merchant.GetMerchantDeployByUid(merchantUid)
|
||||
func QueryAllowedDeployInfoMM(merchantUid, roadUid string) []merchant2.ProfitMargin {
|
||||
resInfo := make([]merchant2.ProfitMargin, 0)
|
||||
merchantInfoList := merchant2.GetMerchantDeployByUid(merchantUid)
|
||||
if len(merchantInfoList) == 0 {
|
||||
return resInfo
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func QueryAllowedDeployInfoMM(merchantUid, roadUid string) []merchant.ProfitMarg
|
||||
// QueryAllowedRoad 获取商户允许通道信息
|
||||
func QueryAllowedRoad(merchantUid string) []road.SimpleRoadInfo {
|
||||
var resInfo []road.SimpleRoadInfo
|
||||
merchantInfoList := merchant.GetMerchantDeployByUid(merchantUid)
|
||||
merchantInfoList := merchant2.GetMerchantDeployByUid(merchantUid)
|
||||
if len(merchantInfoList) == 0 {
|
||||
return resInfo
|
||||
}
|
||||
@@ -2,14 +2,14 @@ package service
|
||||
|
||||
import (
|
||||
"math"
|
||||
"merchant/consts"
|
||||
"merchant/models/account"
|
||||
"merchant/models/order"
|
||||
"merchant/internal/consts"
|
||||
"merchant/internal/models/account"
|
||||
order2 "merchant/internal/models/order"
|
||||
"time"
|
||||
)
|
||||
|
||||
func QueryTotalSummary(params map[string]string) account.Summary {
|
||||
orderInfoList := order.GetOrderByMap(params, -1, 0)
|
||||
orderInfoList := order2.GetOrderByMap(params, -1, 0)
|
||||
|
||||
bankOrderIdList := make([]string, 0)
|
||||
|
||||
@@ -17,7 +17,7 @@ func QueryTotalSummary(params map[string]string) account.Summary {
|
||||
bankOrderIdList = append(bankOrderIdList, info.BankOrderId)
|
||||
}
|
||||
|
||||
orderProfitList := order.GetOrderProfitListByBankOrderIdList(bankOrderIdList)
|
||||
orderProfitList := order2.GetOrderProfitListByBankOrderIdList(bankOrderIdList)
|
||||
|
||||
supplierAll := 0.0
|
||||
platformAll := 0.0
|
||||
@@ -60,11 +60,11 @@ func QueryTotalSummary(params map[string]string) account.Summary {
|
||||
}
|
||||
}
|
||||
|
||||
func QuerySummaryByOrderInfo(infoInfoList []order.OrderInfo) account.Summary {
|
||||
orderProfitInfoList := make([]order.OrderProfitInfo, 0)
|
||||
func QuerySummaryByOrderInfo(infoInfoList []order2.OrderInfo) account.Summary {
|
||||
orderProfitInfoList := make([]order2.OrderProfitInfo, 0)
|
||||
|
||||
for _, info := range infoInfoList {
|
||||
orderProfitInfoList = append(orderProfitInfoList, order.GetOrderProfitByBankOrderId(info.BankOrderId))
|
||||
orderProfitInfoList = append(orderProfitInfoList, order2.GetOrderProfitByBankOrderId(info.BankOrderId))
|
||||
}
|
||||
|
||||
totalNum := 0
|
||||
@@ -131,13 +131,13 @@ func QueryTodaySummary(in map[string]string) account.Summary {
|
||||
paramsProfit["create_time__lte"] = end
|
||||
}
|
||||
|
||||
orderInfoList := order.GetOrderByMap(paramsProfit, -1, 0)
|
||||
orderInfoList := order2.GetOrderByMap(paramsProfit, -1, 0)
|
||||
|
||||
bankOrderIDLst := make([]string, 0)
|
||||
for _, info := range orderInfoList {
|
||||
bankOrderIDLst = append(bankOrderIDLst, info.BankOrderId)
|
||||
}
|
||||
dataInfo := order.GetOrderProfitListByBankOrderIdList(bankOrderIDLst)
|
||||
dataInfo := order2.GetOrderProfitListByBankOrderIdList(bankOrderIDLst)
|
||||
|
||||
totalNum := 0
|
||||
todayAllAmount := 0.0
|
||||
@@ -1,12 +1,3 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 银行编码
|
||||
** @Time : 19.12.4 10:42
|
||||
** @Author : Joker
|
||||
** @File : bank_info
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.4 10:42
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package enum
|
||||
|
||||
const (
|
||||
@@ -1,12 +1,3 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 配置常量
|
||||
** @Time : 2019.04.01 11:45
|
||||
** @Author : Joker
|
||||
** @File : strings
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 2019-11-29 11:05:48
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package enum
|
||||
|
||||
// 短信配置
|
||||
@@ -1,12 +1,3 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 支付方式
|
||||
** @Time : 19.12.3 15:24
|
||||
** @Author : Joker
|
||||
** @File : pay_type
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.3 15:24
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package enum
|
||||
|
||||
const (
|
||||
7
internal/sys/enum/regular_expression.go
Normal file
7
internal/sys/enum/regular_expression.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package enum
|
||||
|
||||
const (
|
||||
PasswordReg = `^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){5,19}$`
|
||||
MoneyReg = `^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$`
|
||||
MobileReg = `^[1]([3-9])[0-9]{9}$`
|
||||
)
|
||||
@@ -1,12 +1,3 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 状态常量
|
||||
** @Time : 19.11.30 11:12
|
||||
** @Author : Joker
|
||||
** @File : status
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.11.30 11:12
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package enum
|
||||
|
||||
// 成功与否
|
||||
@@ -1,18 +1,9 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 共有方法
|
||||
** @Time : 2019.04.01 11:48
|
||||
** @Author : Joker
|
||||
** @File : public_method
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 2019-11-29 11:05:28
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package sys
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"merchant/sys/enum"
|
||||
"merchant/internal/sys/enum"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -1,17 +1,8 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for session配置
|
||||
** @Time : 19.11.30 17:44
|
||||
** @Author : Joker
|
||||
** @File : session
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.11.30 17:44
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package sys
|
||||
|
||||
import (
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"merchant/sys/enum"
|
||||
"merchant/internal/sys/enum"
|
||||
)
|
||||
|
||||
func InitSession() {
|
||||
@@ -3,7 +3,7 @@ package utils
|
||||
import (
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"merchant/sys"
|
||||
"merchant/internal/sys"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@ package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"merchant/sys/enum"
|
||||
"merchant/internal/sys/enum"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
8
main.go
8
main.go
@@ -4,10 +4,10 @@ package main
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
_ "merchant/models"
|
||||
_ "merchant/routers"
|
||||
"merchant/sys"
|
||||
"merchant/utils"
|
||||
_ "merchant/internal/models"
|
||||
_ "merchant/internal/routers"
|
||||
"merchant/internal/sys"
|
||||
"merchant/internal/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 正则表达式
|
||||
** @Time : 19.12.5 10:25
|
||||
** @Author : Joker
|
||||
** @File : regular_expression
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.5 10:25
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package enum
|
||||
|
||||
const (
|
||||
PasswordReg = `^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){5,19}$`
|
||||
MoneyReg = `^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$`
|
||||
MobileReg = `^[1]([3-9])[0-9]{9}$`
|
||||
)
|
||||
Reference in New Issue
Block a user