:test:修复时间问题
This commit is contained in:
@@ -1,15 +1,5 @@
|
||||
package controllers
|
||||
|
||||
/***************************************************
|
||||
** @Desc : c file for ...
|
||||
** @Time : 2019/8/19 18:13
|
||||
** @Author : yuebin
|
||||
** @File : add
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/8/19 18:13
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"boss/common"
|
||||
"boss/datas"
|
||||
@@ -18,9 +8,9 @@ import (
|
||||
"boss/models/road"
|
||||
"boss/models/system"
|
||||
"boss/service"
|
||||
"boss/utils"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/rs/xid"
|
||||
@@ -305,8 +295,8 @@ func (c *AddController) AddMerchantPayType() {
|
||||
rollPoolInfo := road.GetRoadPoolByName(rollPoolRoad)
|
||||
merchantDeployInfo.SingleRoadUid = roadInfo.RoadUid
|
||||
merchantDeployInfo.RollRoadCode = rollPoolInfo.RoadPoolCode
|
||||
merchantDeployInfo.CreateTime = utils.GetBasicDateTime()
|
||||
merchantDeployInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
merchantDeployInfo.CreateTime = time.Now()
|
||||
merchantDeployInfo.UpdateTime = time.Now()
|
||||
|
||||
//如果该用户的改支付类型已经存在,那么进行更新,否则进行添加
|
||||
if merchant.IsExistByUidAndPayType(merchantNo, payType) {
|
||||
@@ -323,7 +313,7 @@ func (c *AddController) AddMerchantPayType() {
|
||||
tmpInfo := merchant.GetMerchantDeployByUidAndPayType(merchantNo, payType)
|
||||
merchantDeployInfo.Id = tmpInfo.Id
|
||||
merchantDeployInfo.Status = tmpInfo.Status
|
||||
merchantDeployInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
merchantDeployInfo.UpdateTime = time.Now()
|
||||
merchantDeployInfo.CreateTime = tmpInfo.CreateTime
|
||||
if merchant.UpdateMerchantDeploy(merchantDeployInfo) {
|
||||
keyDataJSON.Code = 200
|
||||
@@ -412,7 +402,7 @@ func (c *AddController) AddSelfPayFor() {
|
||||
selfPayFor := payfor.PayforInfo{PayforUid: "pppp" + xid.New().String(), BankOrderId: "4444" + xid.New().String(), PayforFee: common.ZERO, Type: common.SELF_HELP,
|
||||
PayforAmount: money, PayforTotalAmount: money + common.ZERO, BankCode: bankInfo.BankCode, BankName: bankName, IsSend: common.NO,
|
||||
BankAccountName: bankInfo.AccountName, BankAccountNo: bankInfo.BankNo, BankAccountType: bankInfo.BankAccountType, BankAccountAddress: bankAddress,
|
||||
Status: common.PAYFOR_COMFRIM, CreateTime: utils.GetBasicDateTime(), UpdateTime: utils.GetBasicDateTime()}
|
||||
Status: common.PAYFOR_COMFRIM, CreateTime: time.Now(), UpdateTime: time.Now()}
|
||||
|
||||
if payfor.InsertPayfor(selfPayFor) {
|
||||
keyDataJSON.Code = 200
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
package accounts
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/10/16 11:11
|
||||
** @Author : yuebin
|
||||
** @File : account
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/10/16 11:11
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type AccountInfo struct {
|
||||
@@ -26,9 +17,9 @@ type AccountInfo struct {
|
||||
FreezeAmount float64 //账户冻结金额
|
||||
WaitAmount float64 //待结算资金
|
||||
PayforAmount float64 //代付在途金额
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
//AbleBalance float64 //账户可用金额
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
}
|
||||
|
||||
const ACCOUNT_INFO = "account_info"
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
package accounts
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/10/19 14:56
|
||||
** @Author : yuebin
|
||||
** @File : account_history_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/10/19 14:56
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type AccountHistoryInfo struct {
|
||||
@@ -22,8 +13,8 @@ type AccountHistoryInfo struct {
|
||||
Type string
|
||||
Amount float64
|
||||
Balance float64
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const ACCOUNT_HISTORY_INFO = "account_history_info"
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
/***************************************************
|
||||
** @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 (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type AgentInfo struct {
|
||||
@@ -23,8 +15,8 @@ type AgentInfo struct {
|
||||
AgentRemark string
|
||||
AgentUid string
|
||||
AgentPhone string
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const AGENT_INFO = "agent_info"
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MerchantDeployInfo struct {
|
||||
@@ -36,8 +37,8 @@ type MerchantDeployInfo struct {
|
||||
UnfreezeHour int
|
||||
WaitUnfreezeAmount float64
|
||||
LoanAmount float64
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
type ProfitMargin struct {
|
||||
|
||||
@@ -13,6 +13,7 @@ package merchant
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MerchantInfo struct {
|
||||
@@ -35,8 +36,8 @@ type MerchantInfo struct {
|
||||
RollPayForRoadCode string
|
||||
RollPayForRoadName string
|
||||
PayforFee float64
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const MERCHANT_INFO = "merchant_info"
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
package merchant
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/11/22 13:07
|
||||
** @Author : yuebin
|
||||
** @File : merchant_load_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/11/22 13:07
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MerchantLoadInfo struct {
|
||||
@@ -22,8 +13,8 @@ type MerchantLoadInfo struct {
|
||||
RoadUid string
|
||||
LoadDate string
|
||||
LoadAmount float64
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const MERCHANT_LOAD_INFO = "merchant_load_info"
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
package notify
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/11/20 13:13
|
||||
** @Author : yuebin
|
||||
** @File : notify_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/11/20 13:13
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type NotifyInfo struct {
|
||||
@@ -24,8 +15,8 @@ type NotifyInfo struct {
|
||||
Times int
|
||||
Url string
|
||||
Response string
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const NOTIFYINFO = "notify_info"
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
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 (
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type OrderProfitInfo struct {
|
||||
@@ -41,8 +35,8 @@ type OrderProfitInfo struct {
|
||||
SupplierProfit float64
|
||||
PlatformProfit float64
|
||||
AgentProfit float64
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const ORDER_PROFIT_INFO = "order_profit_info"
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
type OrderSettleInfo struct {
|
||||
@@ -29,8 +20,8 @@ type OrderSettleInfo struct {
|
||||
SettleAmount float64
|
||||
IsAllowSettle string
|
||||
IsCompleteSettle string
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const ORDER_SETTLE_INFO = "order_settle_info"
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
package order
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/12/17 17:50
|
||||
** @Author : yuebin
|
||||
** @File : platform_profit
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/12/17 17:50
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
type PlatformProfit struct {
|
||||
MerchantName string
|
||||
AgentName string
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
package payfor
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/11/25 14:32
|
||||
** @Author : yuebin
|
||||
** @File : payfor_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/11/25 14:32
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"boss/common"
|
||||
"boss/models/accounts"
|
||||
"boss/utils"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PayforInfo struct {
|
||||
@@ -51,12 +41,12 @@ type PayforInfo struct {
|
||||
NotifyUrl string
|
||||
Status string
|
||||
IsSend string
|
||||
RequestTime string
|
||||
RequestTime time.Time
|
||||
ResponseTime string
|
||||
ResponseContent string
|
||||
Remark string
|
||||
CreateTime string
|
||||
UpdateTime string
|
||||
CreateTime time.Time
|
||||
UpdateTime time.Time
|
||||
}
|
||||
|
||||
const PAYFORINFO = "payfor_info"
|
||||
@@ -165,7 +155,7 @@ func ForUpdatePayFor(payFor PayforInfo) bool {
|
||||
ableAmount := account.SettleAmount - account.FreezeAmount - account.PayforAmount - account.LoanAmount
|
||||
if ableAmount >= payFor.PayforAmount+payFor.PayforFee {
|
||||
account.PayforAmount += payFor.PayforFee + payFor.PayforAmount
|
||||
account.UpdateTime = utils.GetBasicDateTime()
|
||||
account.UpdateTime = time.Now()
|
||||
if _, err := txOrm.Update(&account); err != nil {
|
||||
logs.Error("for update payfor update account fail:", err)
|
||||
return err
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
package road
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/9/8 12:09
|
||||
** @Author : yuebin
|
||||
** @File : road_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/9/8 12:09
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type RoadInfo struct {
|
||||
@@ -40,8 +31,8 @@ type RoadInfo struct {
|
||||
Balance float64
|
||||
RequestAll int
|
||||
RequestSuccess int
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const ROAD_INFO = "road_info"
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
/***************************************************
|
||||
** @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 (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type RoadPoolInfo struct {
|
||||
@@ -20,8 +12,8 @@ type RoadPoolInfo struct {
|
||||
RoadPoolName string
|
||||
RoadPoolCode string
|
||||
RoadUidPool string
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const ROAD_POOL_INFO = "road_pool_info"
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/9/6 10:19
|
||||
** @Author : yuebin
|
||||
** @File : bank_card_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/9/6 10:19
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type BankCardInfo struct {
|
||||
@@ -27,8 +19,8 @@ type BankCardInfo struct {
|
||||
CertificateNo string
|
||||
PhoneNo string
|
||||
BankAddress string
|
||||
UpdateTime string
|
||||
CreateTime string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
}
|
||||
|
||||
const BANK_CARD_INFO = "bank_card_info"
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/8/21 9:33
|
||||
** @Author : yuebin
|
||||
** @File : menu_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/8/21 9:33
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MenuInfo struct {
|
||||
@@ -22,8 +14,8 @@ type MenuInfo struct {
|
||||
SecondMenu string
|
||||
Creater string
|
||||
Status string
|
||||
CreateTime string
|
||||
UpdateTime string
|
||||
CreateTime time.Time
|
||||
UpdateTime time.Time
|
||||
}
|
||||
|
||||
// 实现排序的三个接口函数
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/8/28 17:59
|
||||
** @Author : yuebin
|
||||
** @File : power_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/8/28 17:59
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PowerInfo struct {
|
||||
@@ -23,8 +15,8 @@ type PowerInfo struct {
|
||||
PowerItem string
|
||||
Creater string
|
||||
Status string
|
||||
CreateTime string
|
||||
UpdateTime string
|
||||
CreateTime time.Time
|
||||
UpdateTime time.Time
|
||||
}
|
||||
|
||||
const POWER_INFO = "power_info"
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/8/29 14:43
|
||||
** @Author : yuebin
|
||||
** @File : role_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/8/29 14:43
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
type RoleInfo struct {
|
||||
@@ -27,8 +19,8 @@ type RoleInfo struct {
|
||||
Creater string
|
||||
Status string
|
||||
Remark string
|
||||
CreateTime string
|
||||
UpdateTime string
|
||||
CreateTime time.Time
|
||||
UpdateTime time.Time
|
||||
}
|
||||
|
||||
const ROLE_INFO = "role_info"
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/8/26 9:33
|
||||
** @Author : yuebin
|
||||
** @File : second_menu_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/8/26 9:33
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
const SECOND_MENU_INFO = "second_menu_info"
|
||||
@@ -27,8 +19,8 @@ type SecondMenuInfo struct {
|
||||
SecondRouter string
|
||||
Creater string
|
||||
Status string
|
||||
CreateTime string
|
||||
UpdateTime string
|
||||
CreateTime time.Time
|
||||
UpdateTime time.Time
|
||||
}
|
||||
|
||||
type SecondMenuSlice []SecondMenuInfo
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
package models
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/10/19 14:17
|
||||
** @Author : yuebin
|
||||
** @File : transaction
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/10/19 14:17
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"boss/common"
|
||||
"boss/models/accounts"
|
||||
"boss/utils"
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
func OperatorAccount(accountUid, operatorType string, amount float64) (string, bool) {
|
||||
@@ -34,7 +24,7 @@ func OperatorAccount(accountUid, operatorType string, amount float64) (string, b
|
||||
return err
|
||||
}
|
||||
|
||||
accountInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
accountInfo.UpdateTime = time.Now()
|
||||
flag := true
|
||||
|
||||
switch operatorType {
|
||||
@@ -69,7 +59,7 @@ func OperatorAccount(accountUid, operatorType string, amount float64) (string, b
|
||||
}
|
||||
//往account_history表中插入一条动账记录
|
||||
accountHistory := accounts.AccountHistoryInfo{AccountUid: accountUid, AccountName: accountInfo.AccountName, Type: operatorType,
|
||||
Amount: amount, Balance: accountInfo.Balance, CreateTime: utils.GetBasicDateTime(), UpdateTime: utils.GetBasicDateTime()}
|
||||
Amount: amount, Balance: accountInfo.Balance, CreateTime: time.Now(), UpdateTime: time.Now()}
|
||||
|
||||
if _, err := txOrm.Insert(&accountHistory); err != nil {
|
||||
logs.Error("operator account insert account history fail: ", err)
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
package user
|
||||
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 2019/8/9 14:02
|
||||
** @Author : yuebin
|
||||
** @File : user_info
|
||||
** @Last Modified by : yuebin
|
||||
** @Last Modified time: 2019/8/9 14:02
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -29,8 +20,8 @@ type UserInfo struct {
|
||||
Status string
|
||||
Role string
|
||||
RoleName string
|
||||
CreateTime string
|
||||
UpdateTime string
|
||||
CreateTime time.Time
|
||||
UpdateTime time.Time
|
||||
OtpSecret string
|
||||
OtpKey string
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/rs/xid"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type AddService struct {
|
||||
@@ -28,7 +29,7 @@ func (c *AddService) AddMenu(oneMenu, userID string) *datas.BaseDataJSON {
|
||||
FirstMenu: oneMenu,
|
||||
Status: "active",
|
||||
Creater: userID,
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
|
||||
exist := system.FirstMenuIsExists(oneMenu)
|
||||
@@ -78,8 +79,8 @@ func (c *AddService) AddSecondMenu(firstMenuUid, secondRouter, secondMenu, userI
|
||||
SecondMenu: secondMenu,
|
||||
SecondRouter: secondRouter,
|
||||
Creater: userID,
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: time.Now(),
|
||||
UpdateTime: time.Now(),
|
||||
FirstMenuOrder: firstMenuInfo.MenuOrder,
|
||||
}
|
||||
if !system.InsertSecondMenu(secondMenuInfo) {
|
||||
@@ -121,8 +122,8 @@ func (c *AddService) AddPower(powerItem, powerID, firstMenuUid, secondMenuUid, u
|
||||
PowerId: powerID, PowerItem: powerItem,
|
||||
Creater: userID,
|
||||
Status: "active",
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: time.Now(),
|
||||
UpdateTime: time.Now(),
|
||||
FirstMenuUid: firstMenuUid,
|
||||
}
|
||||
|
||||
@@ -160,8 +161,8 @@ func (c *AddService) AddRole(roleName, roleRemark, userID string) *datas.KeyData
|
||||
Creater: userID,
|
||||
Status: "active",
|
||||
Remark: roleRemark,
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: time.Now(),
|
||||
UpdateTime: time.Now(),
|
||||
}
|
||||
|
||||
if !system.InsertRole(roleInfo) {
|
||||
@@ -184,7 +185,7 @@ func (c *AddService) SavePower(roleUid string, firstMenuUids, secondMenuUids, po
|
||||
return dataJSON
|
||||
}
|
||||
|
||||
roleInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
roleInfo.UpdateTime = time.Now()
|
||||
roleInfo.ShowFirstUid = strings.Join(firstMenuUids, "||")
|
||||
roleInfo.ShowSecondUid = strings.Join(secondMenuUids, "||")
|
||||
roleInfo.ShowPowerUid = strings.Join(powerIds, "||")
|
||||
@@ -248,8 +249,8 @@ func (c *AddService) AddOperator(loginAccount, loginPassword, role, status, rema
|
||||
Status: status,
|
||||
Role: role,
|
||||
RoleName: roleInfo.RoleName,
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: time.Now(),
|
||||
UpdateTime: time.Now(),
|
||||
}
|
||||
if !user.InsertUser(userInfo) {
|
||||
keyDataJSON.Code = 200
|
||||
@@ -307,7 +308,7 @@ func (c *AddService) AddBankCard(userName, bankCode, accountName, certificateTyp
|
||||
CertificateNo: certificateNo,
|
||||
PhoneNo: phoneNo,
|
||||
BankAddress: bankAddress,
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: time.Now(),
|
||||
CreateTime: bankCardInfo.CreateTime,
|
||||
Uid: bankCardInfo.Uid,
|
||||
}
|
||||
@@ -327,8 +328,8 @@ func (c *AddService) AddBankCard(userName, bankCode, accountName, certificateTyp
|
||||
CertificateNo: certificateNo,
|
||||
PhoneNo: phoneNo,
|
||||
BankAddress: bankAddress,
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: time.Now(),
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
|
||||
if system.InsertBankCardInfo(bankCardInfo) {
|
||||
@@ -447,8 +448,8 @@ func (c *AddService) AddRoad(startHour, endHour, roadName, productUid,
|
||||
EndHour: endHourTmp,
|
||||
Status: "active",
|
||||
Params: params,
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: time.Now(),
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
|
||||
if road.InsertRoadInfo(roadInfo) {
|
||||
@@ -475,8 +476,8 @@ func (c *AddService) AddRoadPool(roadPoolName, roadPoolCode string) *datas.KeyDa
|
||||
Status: "active",
|
||||
RoadPoolName: roadPoolName,
|
||||
RoadPoolCode: roadPoolCode,
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: time.Now(),
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
|
||||
if road.InsertRoadPool(roadPoolInfo) {
|
||||
@@ -507,7 +508,7 @@ func (c *AddService) SaveRoadUid(roadPoolCode string, roadUids []string) *datas.
|
||||
roadUid := strings.Join(uids, "||")
|
||||
roadPoolInfo.RoadUidPool = roadUid
|
||||
}
|
||||
roadPoolInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
roadPoolInfo.UpdateTime = time.Now()
|
||||
if road.UpdateRoadPool(roadPoolInfo) {
|
||||
dataJSON.Code = 200
|
||||
}
|
||||
@@ -564,8 +565,8 @@ func (c *AddService) AddAgent(agentName, agentPhone, agentLoginPassword,
|
||||
AgentPhone: agentPhone,
|
||||
AgentPassword: utils.GetMD5Upper(agentLoginPassword),
|
||||
AgentUid: agentUid,
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: time.Now(),
|
||||
CreateTime: time.Now(),
|
||||
AgentRemark: agentRemark,
|
||||
}
|
||||
|
||||
@@ -587,8 +588,8 @@ func (c *AddService) AddAgent(agentName, agentPhone, agentLoginPassword,
|
||||
account.PayforAmount = 0.0
|
||||
account.SettleAmount = 0.0
|
||||
account.WaitAmount = 0.0
|
||||
account.UpdateTime = utils.GetBasicDateTime()
|
||||
account.CreateTime = utils.GetBasicDateTime()
|
||||
account.UpdateTime = time.Now()
|
||||
account.CreateTime = time.Now()
|
||||
if accounts.InsetAcount(account) {
|
||||
keyDataJSON.Code = 200
|
||||
keyDataJSON.Msg = "插入成功"
|
||||
@@ -649,8 +650,8 @@ func (c *AddService) AddMerchant(merchantName, phone, loginPassword,
|
||||
LoginPassword: utils.GetMD5Upper(loginPassword),
|
||||
Status: merchantStatus,
|
||||
Remark: remark,
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: time.Now(),
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
|
||||
if merchant.InsertMerchantInfo(merchantInfo) {
|
||||
@@ -671,8 +672,8 @@ func (c *AddService) AddMerchant(merchantName, phone, loginPassword,
|
||||
account.PayforAmount = 0.0
|
||||
account.SettleAmount = 0.0
|
||||
account.WaitAmount = 0.0
|
||||
account.UpdateTime = utils.GetBasicDateTime()
|
||||
account.CreateTime = utils.GetBasicDateTime()
|
||||
account.UpdateTime = time.Now()
|
||||
account.CreateTime = time.Now()
|
||||
if accounts.InsetAcount(account) {
|
||||
keyDataJSON.Code = 200
|
||||
keyDataJSON.Msg = "插入成功"
|
||||
@@ -813,7 +814,7 @@ func (c *AddService) AddMerchantPayType(payType, singleRoad, rollPoolRoad,
|
||||
tmpInfo := merchant.GetMerchantDeployByUidAndPayType(merchantNo, payType)
|
||||
merchantDeployInfo.Id = tmpInfo.Id
|
||||
merchantDeployInfo.Status = tmpInfo.Status
|
||||
merchantDeployInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
merchantDeployInfo.UpdateTime = time.Now()
|
||||
merchantDeployInfo.CreateTime = tmpInfo.CreateTime
|
||||
if merchant.UpdateMerchantDeploy(merchantDeployInfo) {
|
||||
keyDataJSON.Code = 200
|
||||
@@ -828,8 +829,8 @@ func (c *AddService) AddMerchantPayType(payType, singleRoad, rollPoolRoad,
|
||||
keyDataJSON.Code = -1
|
||||
keyDataJSON.Msg = "参数不能为空"
|
||||
} else {
|
||||
merchantDeployInfo.CreateTime = utils.GetBasicDateTime()
|
||||
merchantDeployInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
merchantDeployInfo.CreateTime = time.Now()
|
||||
merchantDeployInfo.UpdateTime = time.Now()
|
||||
merchantDeployInfo.Status = common.ACTIVE
|
||||
if merchant.InsertMerchantDeployInfo(merchantDeployInfo) {
|
||||
keyDataJSON.Code = 200
|
||||
@@ -895,9 +896,9 @@ func (c *AddService) AddPayFor(merchantUid, bankUid, payForAmount, bankNo, accou
|
||||
BankAccountType: bankInfo.BankAccountType,
|
||||
BankAccountAddress: bankAddress,
|
||||
Status: common.PAYFOR_COMFRIM,
|
||||
RequestTime: utils.GetBasicDateTime(),
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
RequestTime: time.Now(),
|
||||
CreateTime: time.Now(),
|
||||
UpdateTime: time.Now(),
|
||||
}
|
||||
|
||||
if payfor.InsertPayfor(payFor) {
|
||||
@@ -950,8 +951,8 @@ func (c *AddService) AddSelfPayFor(bankUid, payForAmount, accountName,
|
||||
BankAccountType: bankInfo.BankAccountType,
|
||||
BankAccountAddress: bankAddress,
|
||||
Status: common.PAYFOR_COMFRIM,
|
||||
CreateTime: utils.GetBasicDateTime(),
|
||||
UpdateTime: utils.GetBasicDateTime(),
|
||||
CreateTime: time.Now(),
|
||||
UpdateTime: time.Now(),
|
||||
}
|
||||
|
||||
if payfor.InsertPayfor(selfPayFor) {
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"boss/models/road"
|
||||
"boss/models/system"
|
||||
"boss/models/user"
|
||||
"boss/utils"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type DeleteService struct {
|
||||
@@ -54,7 +54,7 @@ func (c *DeleteService) Finish() {
|
||||
r.ShowSecondMenu = strings.Join(remainderSecondMenu, "||")
|
||||
r.ShowPowerUid = strings.Join(remainderPowerId, "||")
|
||||
r.ShowPower = strings.Join(remainderPower, "||")
|
||||
r.UpdateTime = utils.GetBasicDateTime()
|
||||
r.UpdateTime = time.Now()
|
||||
system.UpdateRoleInfo(r)
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ func (c *DeleteService) DeleteRoad(roadUid string) *datas.BaseDataJSON {
|
||||
}
|
||||
}
|
||||
roadPoolInfo.RoadUidPool = strings.Join(uids, "||")
|
||||
roadPoolInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
roadPoolInfo.UpdateTime = time.Now()
|
||||
road.UpdateRoadPool(roadPoolInfo)
|
||||
}
|
||||
return dataJSON
|
||||
@@ -248,7 +248,7 @@ func (c *DeleteService) DeleteAgentRelation(merchantUid string) *datas.KeyDataJS
|
||||
keyDataJSON.Code = -1
|
||||
keyDataJSON.Msg = "不存在这样的商户"
|
||||
} else {
|
||||
merchantInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
merchantInfo.UpdateTime = time.Now()
|
||||
merchantInfo.BelongAgentUid = ""
|
||||
merchantInfo.BelongAgentName = ""
|
||||
|
||||
@@ -269,7 +269,7 @@ func SortFirstMenuOrder() {
|
||||
|
||||
for i := 0; i < len(menuInfoList); i++ {
|
||||
m := menuInfoList[i]
|
||||
m.UpdateTime = utils.GetBasicDateTime()
|
||||
m.UpdateTime = time.Now()
|
||||
m.MenuOrder = i + 1
|
||||
system.UpdateMenuInfo(m)
|
||||
//对应的二级菜单也应该重新分配顺序号
|
||||
@@ -284,7 +284,7 @@ func SortSecondMenuOrder(firstMenuInfo system.MenuInfo) {
|
||||
secondMenuInfoList := system.GetSecondMenuListByFirstMenuUid(firstMenuInfo.MenuUid)
|
||||
for _, sm := range secondMenuInfoList {
|
||||
sm.FirstMenuOrder = firstMenuInfo.MenuOrder
|
||||
sm.UpdateTime = utils.GetBasicDateTime()
|
||||
sm.UpdateTime = time.Now()
|
||||
system.UpdateSecondMenu(sm)
|
||||
//删除下下一级的所有权限项
|
||||
system.DeletePowerBySecondUid(sm.SecondMenuUid)
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
type UpdateService struct {
|
||||
@@ -39,8 +40,8 @@ func (c *UpdateService) UpMenu(menuUid string) *datas.BaseDataJSON {
|
||||
preMenuInfo := system.GetMenuInfoByMenuOrder(menuInfo.MenuOrder - 1)
|
||||
menuInfo.MenuOrder = menuInfo.MenuOrder - 1
|
||||
preMenuInfo.MenuOrder = preMenuInfo.MenuOrder + 1
|
||||
preMenuInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
menuInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
preMenuInfo.UpdateTime = time.Now()
|
||||
menuInfo.UpdateTime = time.Now()
|
||||
//更新菜单表
|
||||
system.UpdateMenuInfo(preMenuInfo)
|
||||
system.UpdateMenuInfo(menuInfo)
|
||||
@@ -69,8 +70,8 @@ func (c *UpdateService) DownMenu(menuUid string) *datas.BaseDataJSON {
|
||||
lastMenuInfo := system.GetMenuInfoByMenuOrder(menuInfo.MenuOrder + 1)
|
||||
menuInfo.MenuOrder = menuInfo.MenuOrder + 1
|
||||
lastMenuInfo.MenuOrder = lastMenuInfo.MenuOrder - 1
|
||||
lastMenuInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
menuInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
lastMenuInfo.UpdateTime = time.Now()
|
||||
menuInfo.UpdateTime = time.Now()
|
||||
//更新菜单表
|
||||
system.UpdateMenuInfo(lastMenuInfo)
|
||||
system.UpdateMenuInfo(menuInfo)
|
||||
@@ -91,9 +92,9 @@ func (c *UpdateService) UpSecondMenu(secondMenuUid string) *datas.BaseDataJSON {
|
||||
} else {
|
||||
preSecondMenuInfo := system.GetSecondMenuInfoByMenuOrder(secondMenuInfo.MenuOrder-1, secondMenuInfo.FirstMenuUid)
|
||||
preSecondMenuInfo.MenuOrder = preSecondMenuInfo.MenuOrder + 1
|
||||
preSecondMenuInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
preSecondMenuInfo.UpdateTime = time.Now()
|
||||
secondMenuInfo.MenuOrder = secondMenuInfo.MenuOrder - 1
|
||||
secondMenuInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
secondMenuInfo.UpdateTime = time.Now()
|
||||
//更新二级菜单项
|
||||
system.UpdateSecondMenu(preSecondMenuInfo)
|
||||
system.UpdateSecondMenu(secondMenuInfo)
|
||||
@@ -114,10 +115,10 @@ func (c *UpdateService) DownSecondMenu(secondMenuUid string) *datas.BaseDataJSON
|
||||
} else {
|
||||
lastSecondMenu := system.GetSecondMenuInfoByMenuOrder(secondMenuInfo.MenuOrder+1, secondMenuInfo.FirstMenuUid)
|
||||
lastSecondMenu.MenuOrder = lastSecondMenu.MenuOrder - 1
|
||||
lastSecondMenu.UpdateTime = utils.GetBasicDateTime()
|
||||
lastSecondMenu.UpdateTime = time.Now()
|
||||
|
||||
secondMenuInfo.MenuOrder = secondMenuInfo.MenuOrder + 1
|
||||
secondMenuInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
secondMenuInfo.UpdateTime = time.Now()
|
||||
|
||||
system.UpdateSecondMenu(lastSecondMenu)
|
||||
system.UpdateSecondMenu(secondMenuInfo)
|
||||
@@ -176,7 +177,7 @@ func (c *UpdateService) EditOperator(password, changePassword, role, userId, nic
|
||||
keyDataJSON.Code = -2
|
||||
keyDataJSON.Msg = "该用户不存在"
|
||||
} else {
|
||||
userInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
userInfo.UpdateTime = time.Now()
|
||||
userInfo.Remark = remark
|
||||
roleInfo := system.GetRoleByRoleUid(role)
|
||||
userInfo.RoleName = roleInfo.RoleName
|
||||
@@ -229,7 +230,7 @@ func (c *UpdateService) UpdateMerchantStatus(merchantUid string) *datas.KeyDataJ
|
||||
} else {
|
||||
merchantInfo.Status = common.ACTIVE
|
||||
}
|
||||
merchantInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
merchantInfo.UpdateTime = time.Now()
|
||||
|
||||
if merchant.UpdateMerchant(merchantInfo) {
|
||||
keyDataJSON.Code = 200
|
||||
@@ -246,7 +247,7 @@ func (c *UpdateService) UpdateAccountStatus(accountUid string) *datas.BaseDataJS
|
||||
} else {
|
||||
accountInfo.Status = common.ACTIVE
|
||||
}
|
||||
accountInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
accountInfo.UpdateTime = time.Now()
|
||||
|
||||
dataJSON := new(datas.BaseDataJSON)
|
||||
if accounts.UpdateAccount(accountInfo) {
|
||||
@@ -302,7 +303,7 @@ func (c *UpdateService) UpdateAgentStatus(agentUid string) *datas.KeyDataJSON {
|
||||
} else {
|
||||
agentInfo.Status = "active"
|
||||
}
|
||||
agentInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
agentInfo.UpdateTime = time.Now()
|
||||
if agent.UpdateAgentInfo(agentInfo) {
|
||||
keyDataJSON.Code = 200
|
||||
} else {
|
||||
@@ -331,7 +332,7 @@ func (c *UpdateService) ResetAgentPassword(agentUid, newPassword, newVertifyPass
|
||||
}
|
||||
|
||||
agentInfo := agent.GetAgentInfoByAgentUid(agentUid)
|
||||
agentInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
agentInfo.UpdateTime = time.Now()
|
||||
agentInfo.AgentPassword = utils.GetMD5Upper(newPassword)
|
||||
if !agent.UpdateAgentInfo(agentInfo) {
|
||||
keyDataJSON.Code = -1
|
||||
@@ -355,7 +356,7 @@ func (c *UpdateService) ChoosePayForRoad(confirmType, roadName, bankOrderId, rem
|
||||
if payForInfo.Status != common.PAYFOR_COMFRIM {
|
||||
keyDataJSON.Msg = "结算状态错误,请刷新后确认"
|
||||
} else {
|
||||
payForInfo.UpdateTime = utils.GetBasicDateTime()
|
||||
payForInfo.UpdateTime = time.Now()
|
||||
payForInfo.GiveType = confirmType
|
||||
if confirmType == common.PAYFOR_REFUSE {
|
||||
//拒绝打款
|
||||
@@ -405,7 +406,7 @@ func (c *UpdateService) ResultPayFor(resultType, bankOrderId string) *datas.KeyD
|
||||
|
||||
if payFor.Type == common.SELF_HELP {
|
||||
//如果是管理员在后台提现,不用做任何的商户减款,只需要更新代付订单状态
|
||||
payFor.UpdateTime = utils.GetBasicDateTime()
|
||||
payFor.UpdateTime = time.Now()
|
||||
payFor.Status = resultType
|
||||
|
||||
if !payfor.ForUpdatePayFor(payFor) {
|
||||
|
||||
Reference in New Issue
Block a user