fix: order_info

master
howell 4 years ago
parent 56f569a7fc
commit 879e19e095

@ -76,7 +76,7 @@ func QueryAllCategories(c *gin.Context) {
}
// 填充子类目 sub
for i, _ := range categories {
for i := range categories {
err = dbc.DB.Table((&goods.Category{}).TableName()).Order("location asc").Find(&categories[i].Sub, "parent_id=? AND depth=2 AND `show`=1", categories[i].ID).Error
if err != nil && !gorm.IsRecordNotFoundError(err) {
back.Err(c, err.Error())

@ -3,14 +3,17 @@ package order
import (
"errors"
"fmt"
"github.com/golangkit/formatime"
"github.com/shopspring/decimal"
"recook/internal/dbc"
"recook/internal/libs/bean"
"recook/internal/model/order"
goods2 "recook/internal/v2/logic/manage/goods"
"recook/internal/v2/model/recook/after"
"recook/internal/v2/model/recook/goods"
manage "recook/internal/v2/model/recook/order"
"git.oa00.com/go/mysql"
"github.com/golangkit/formatime"
"github.com/shopspring/decimal"
)
var OrderLogic = &orderLogic{}
@ -110,11 +113,14 @@ func (o *orderLogic) Lists(userId, status uint, page bean.Page) (lists []OrderIt
// @Style 导购订单列表
func (o *orderLogic) GuideLists(userId, status uint, page bean.Page) (lists []OrderItem, total int) {
ids := make([]uint, 0)
mysql.Db.Table((&order.Profit{}).TableName()).Where("user_id = ?", userId).Group("order_id").Pluck("order_id", &ids)
lists = []OrderItem{}
recookOrderInfoModel := &manage.RecookOrderInfoModel{}
query := "share_id = ?"
query := "id in (?) and user_id != ?"
//userCoinHistory := user.RecookUserCoinHistory{}
queryArgs := []interface{}{userId}
queryArgs := []interface{}{ids, userId}
if status > 0 {
switch status {
case 1: // 待发货

Loading…
Cancel
Save