作者 tangxvhui

bug 修复

package models
type AdminPermission struct {
tableName struct{} `pg:"admin_permission"`
tableName struct{} `pg:"admin_permission,alias:admin_permission"`
//id
Id int `pg:",pk"`
//权限名称、菜单名称
... ...
... ... @@ -10,7 +10,7 @@ import (
)
type AdminUser struct {
tableName struct{} `pg:"admin_user"`
tableName struct{} `pg:"admin_user,alias:admin_user"`
//id
Id int64 `pg:",pk"`
//用户账号
... ...
package models
import "time"
type Order struct {
tableName struct{} `pg:"order,alias:order"`
Id int64 `pg:",pk"`
//订单类型
OrderType int
//订单编号
OrderCode string
//订单名称
OrderName string
//订单状态
OrderStatus int
//数量
OrderCount int
//实际数量
OrderActualCount int
//订单金额
OrderAmount int
//实际订单金额
OrderActualAmount int
//订单已支付分红金额(货款)
OrderPaymentAmount int
//订单区域信息
OrderRegionInfo string
//买家
Buyer string
//合伙人id
PartnerId int64
//合伙人分红百分比
PartnerBonusPercent float64
//业务员分红百分比
SalesmanBonusPercent float64
//创建时间
CreateAt time.Time
//更新时间
UpdateAt time.Time
//最后查看得时间
LastViewTime time.Time
}
... ...
... ... @@ -9,7 +9,7 @@ import (
)
type PartnerInfo struct {
tableName struct{} `pg:"partner_info"`
tableName struct{} `pg:"partner_info,alias:partner_info"`
// 合伙人ID
Id int64 `pg:",pk"`
// 合伙人姓名
... ...
... ... @@ -122,6 +122,7 @@ func (reponsitory AdminUserRepository) Find(queryOption domain.AdminUserFindQuer
err error
adminuserReturn = make([]domain.AdminUser, 0)
)
query = query.Order("admin_user.id DESC")
err = query.Select()
if err != nil {
return adminuserReturn, err
... ...
... ... @@ -112,6 +112,7 @@ func (repository *PartnerInfoRepository) Find(queryOption domain.PartnerFindQuer
err error
partnerReturn = make([]domain.PartnerInfo, 0)
)
query = query.Order("partner_info.id DESC")
err = query.Select()
if err != nil {
return partnerReturn, err
... ...