Xingyu Xian 1 week ago
parent
commit
9d7692fd5d
5 changed files with 13 additions and 3 deletions
  1. 1 0
      db/s_local_life.go
  2. 4 0
      db/s_project.go
  3. 1 1
      service/cooperate.go
  4. 5 1
      service/s_local_life.go
  5. 2 1
      service/s_project.go

+ 1 - 0
db/s_local_life.go

@@ -228,6 +228,7 @@ func UpdateSLocal(ctx context.Context, sLocalInfo *gorm_model.YounggeeSLocalLife
 		StrategyStatus:     sLocalInfo.StrategyStatus,
 		StrategyStatus:     sLocalInfo.StrategyStatus,
 		CreateStrategyType: sLocalInfo.CreateStrategyType,
 		CreateStrategyType: sLocalInfo.CreateStrategyType,
 		CreateStrategyId:   sLocalInfo.CreateStrategyId,
 		CreateStrategyId:   sLocalInfo.CreateStrategyId,
+		AgreeTime:          sLocalInfo.AgreeTime,
 	}
 	}
 	err := db.Model(&gorm_model.YounggeeSLocalLifeInfo{}).Where(whereCondition).Updates(sLocal).Error
 	err := db.Model(&gorm_model.YounggeeSLocalLifeInfo{}).Where(whereCondition).Updates(sLocal).Error
 	if err != nil {
 	if err != nil {

+ 4 - 0
db/s_project.go

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"fmt"
 	"github.com/sirupsen/logrus"
 	"github.com/sirupsen/logrus"
 	"reflect"
 	"reflect"
+	"time"
 	"youngee_b_api/model/common_model"
 	"youngee_b_api/model/common_model"
 	"youngee_b_api/model/gorm_model"
 	"youngee_b_api/model/gorm_model"
 	"youngee_b_api/model/http_model"
 	"youngee_b_api/model/http_model"
@@ -123,11 +124,14 @@ func UpdateSProjectStatus(ctx context.Context, newSProject *http_model.SpecialSP
 	} else {
 	} else {
 		operatorType = 2
 		operatorType = 2
 	}
 	}
+	var currentTime time.Time
+	currentTime = time.Now()
 	whereCondition := gorm_model.SProjectInfo{SProjectId: newSProject.SProjectId}
 	whereCondition := gorm_model.SProjectInfo{SProjectId: newSProject.SProjectId}
 	sProjectInfo := gorm_model.SProjectInfo{
 	sProjectInfo := gorm_model.SProjectInfo{
 		SProjectStatus: newSProject.SProjectStatus,
 		SProjectStatus: newSProject.SProjectStatus,
 		SubAccountId:   newSProject.SubAccountId,
 		SubAccountId:   newSProject.SubAccountId,
 		OperatorType:   operatorType,
 		OperatorType:   operatorType,
+		AgreeTime:      &currentTime,
 	}
 	}
 	err := db.Model(&gorm_model.SProjectInfo{}).Where(whereCondition).Updates(sProjectInfo).Error
 	err := db.Model(&gorm_model.SProjectInfo{}).Where(whereCondition).Updates(sProjectInfo).Error
 	if err != nil {
 	if err != nil {

+ 1 - 1
service/cooperate.go

@@ -20,7 +20,7 @@ func (*cooperate) GetEnterpriseInfoBySupplierId(ctx context.Context, request *ht
 	enterpriseListData = &http_model.EnterpriseListData{}
 	enterpriseListData = &http_model.EnterpriseListData{}
 
 
 	// 1. 根据服务商ID和合作状态查找信息
 	// 1. 根据服务商ID和合作状态查找信息
-	enterpriseListInfo, total, enterpriseListInfoErr := db.GetCooperateInfoByIds(ctx, request.SupplierId, request.CooperateStatus, request.PageSize, request.PageNum)
+	enterpriseListInfo, total, enterpriseListInfoErr := db.GetCooperateInfoByIds(ctx, request.SupplierId, request.CooperateStatus, request.PageSize, request.PageNum-1)
 	if enterpriseListInfoErr != nil {
 	if enterpriseListInfoErr != nil {
 		return nil, enterpriseListInfoErr
 		return nil, enterpriseListInfoErr
 	}
 	}

+ 5 - 1
service/s_local_life.go

@@ -60,6 +60,7 @@ func (*sLocalLife) CreateSLocalLife(ctx context.Context, request *http_model.Loc
 		sLocalLifeInfo.OperatorType = operatorType
 		sLocalLifeInfo.OperatorType = operatorType
 		currTime := time.Now()
 		currTime := time.Now()
 		sLocalLifeInfo.CreateTime = &currTime
 		sLocalLifeInfo.CreateTime = &currTime
+		sLocalLifeInfo.AgreeTime = &currTime
 
 
 		// 2. 入库
 		// 2. 入库
 		sLocalId, createErr := db.CreateSLocalLife(ctx, sLocalLifeInfo)
 		sLocalId, createErr := db.CreateSLocalLife(ctx, sLocalLifeInfo)
@@ -485,12 +486,15 @@ func (*sLocalLife) ChangeSupplierStatus(ctx context.Context, req *http_model.Spe
 	} else {
 	} else {
 		operatorType = 2
 		operatorType = 2
 	}
 	}
+	var currTime time.Time
+	currTime = time.Now()
 	sLocalInfo.SLocalId = req.SLocalId
 	sLocalInfo.SLocalId = req.SLocalId
 	sLocalInfo.SupplierId = req.SupplierId
 	sLocalInfo.SupplierId = req.SupplierId
 	sLocalInfo.SubAccountId = req.SubAccountId
 	sLocalInfo.SubAccountId = req.SubAccountId
 	sLocalInfo.OperatorType = operatorType
 	sLocalInfo.OperatorType = operatorType
 	sLocalInfo.SLocalStatus = req.SLocalStatus
 	sLocalInfo.SLocalStatus = req.SLocalStatus
-	fmt.Println("data: ", sLocalInfo)
+	sLocalInfo.AgreeTime = &currTime
+	// fmt.Println("data: ", sLocalInfo)
 	err := db.UpdateSLocal(ctx, sLocalInfo)
 	err := db.UpdateSLocal(ctx, sLocalInfo)
 	if err != nil {
 	if err != nil {
 		return err
 		return err

+ 2 - 1
service/s_project.go

@@ -54,6 +54,7 @@ func (*sProject) CreateSProject(ctx context.Context, request http_model.AddToLis
 		newSProject.ProjectType = 1
 		newSProject.ProjectType = 1
 		newSProject.ProductId = projectInfo.ProductID
 		newSProject.ProductId = projectInfo.ProductID
 		newSProject.ProjectName = projectInfo.ProjectName
 		newSProject.ProjectName = projectInfo.ProjectName
+		newSProject.AgreeTime = &currentTime
 	}
 	}
 	sProjectId, err := db.CreateSProject(ctx, newSProject)
 	sProjectId, err := db.CreateSProject(ctx, newSProject)
 	if err != nil {
 	if err != nil {
@@ -495,7 +496,7 @@ func (*sProject) GetSpecialSProjectList(ctx context.Context, supplierId int, pag
 			currSpecialProject.RecruitNum = specialProject.RecruitNum
 			currSpecialProject.RecruitNum = specialProject.RecruitNum
 			currSpecialProject.SettleNum = specialProject.SettleNum
 			currSpecialProject.SettleNum = specialProject.SettleNum
 			currSpecialProject.CreateTime = conv.MustString(specialProject.CreateTime)[0:19]
 			currSpecialProject.CreateTime = conv.MustString(specialProject.CreateTime)[0:19]
-			if specialProject.SProjectStatus == 2 {
+			if specialProject.SProjectStatus == 2 && specialProject.AgreeTime != nil {
 				currSpecialProject.AgreeTime = conv.MustString(specialProject.AgreeTime)[0:19]
 				currSpecialProject.AgreeTime = conv.MustString(specialProject.AgreeTime)[0:19]
 			}
 			}