“liushuai” hai 1 ano
pai
achega
1169bfd946
Modificáronse 4 ficheiros con 10 adicións e 5 borrados
  1. 7 2
      db/selection.go
  2. 0 1
      handler/selection_find_all.go
  3. 1 0
      pack/selection.go
  4. 2 2
      route/init.go

+ 7 - 2
db/selection.go

@@ -125,7 +125,8 @@ func GetSelectionByEnterpiseIdAndProductId(ctx context.Context, enterpriseId str
 
 func GetSelectionList(ctx context.Context, enterpriseID string, pageSize, pageNum int64, conditions *common_model.SelectionConditions) ([]*gorm_model.YounggeeSelectionInfo, int64, error) {
 	db := GetReadDB(ctx)
-	db = db.Debug().Model(gorm_model.YounggeeSelectionInfo{}).Where("enterprise_id = ?", enterpriseID)
+	//db = db.Debug().Model(gorm_model.YounggeeSelectionInfo{}).Where("enterprise_id = ?", enterpriseID)
+	db = db.Debug().Model(gorm_model.YounggeeSelectionInfo{})
 	conditionType := reflect.TypeOf(conditions).Elem()
 	conditionValue := reflect.ValueOf(conditions).Elem()
 	selectionStatus := ""
@@ -135,7 +136,11 @@ func GetSelectionList(ctx context.Context, enterpriseID string, pageSize, pageNu
 		tag := field.Tag.Get("condition")
 		value := conditionValue.FieldByName(field.Name)
 		if tag == "selection_status" {
-			selectionStatus = fmt.Sprintf("%v", value.Interface())
+			selectionStatus = fmt.Sprintf("%v", conv.MustInt(value.Interface(), 0))
+			if selectionStatus != "0" {
+				db = db.Where("selection_status = ?", selectionStatus)
+			}
+
 		} else if tag == "search_value" {
 			searchValue = fmt.Sprintf("%v", value.Interface())
 		} else if tag == "submit_at" && value.Interface() != "" {

+ 0 - 1
handler/selection_find_all.go

@@ -36,7 +36,6 @@ func (f FindAllSelectionHandler) getRequest() interface{} {
 }
 
 func (f FindAllSelectionHandler) run() {
-	//enterpriseID := middleware.GetSessionAuth(f.ctx).EnterpriseID
 	condition := pack.HttpFindAllSelectionRequestToCondition(f.req)
 	data, err := service.Selection.GetAllSelection(f.ctx, f.req.EnterpriseId, f.req.PageSize, f.req.PageNum, condition)
 	if err != nil {

+ 1 - 0
pack/selection.go

@@ -56,5 +56,6 @@ func GormSelectionToHttpSelectionPreview(selectionInfo *gorm_model.YounggeeSelec
 		PayAt:            selectionInfo.PayAt,
 		FinishAt:         selectionInfo.FinishAt,
 		IsRead:           selectionInfo.IsRead,
+		TaskMode:         selectionInfo.TaskMode,
 	}
 }

+ 2 - 2
route/init.go

@@ -190,14 +190,14 @@ func InitRoute(r *gin.Engine) {
 	// 选品广场相关接口
 	s := r.Group("/youngee/m/selection")
 	{
-		s.Use(middleware.LoginAuthMiddleware)
+		//s.Use(middleware.LoginAuthMiddleware)
 		s.GET("/reviewnumber", handler.WrapSelectionReviewNumberHandler)            //查询选品待审核的数量
 		s.POST("/delete", handler.WrapDeleteSelectionHandler)                       //删除选品
 		s.POST("/findAll", handler.WrapFindAllSelectionHandler)                     //选品列表
 		s.POST("/detail", handler.WrapSelectionDetailHandler)                       //选品详情
 		s.POST("/create", handler.WrapCreateSelectionHandler)                       // 创建选品
 		s.POST("/update", handler.WrapUpdateSelectionHandler)                       // 更新选品
-		s.POST("/update", handler.WrapReviewSelectionHandler)                       // 选品审核通过
+		s.POST("/review", handler.WrapReviewSelectionHandler)                       // 选品审核通过
 		s.POST("/pay", handler.WrapPaySelectionHandler)                             // 支付选品项目
 		s.POST("/task/list", handler.WrapGetSecTaskListHandler)                     // 查询选品的任务列表
 		s.POST("/task/coop/pass", handler.WrapPassSecTaskCoopHandler)               // 同意任务合作