|
@@ -5,6 +5,7 @@ import (
|
|
|
"fmt"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
+ "time"
|
|
|
"youngee_m_api/db"
|
|
|
"youngee_m_api/model/common_model"
|
|
|
"youngee_m_api/model/gorm_model"
|
|
@@ -148,7 +149,8 @@ func (*project) GetProjectTaskList(ctx context.Context, projectID string, pageSi
|
|
|
}
|
|
|
|
|
|
func (*project) Create(ctx context.Context, newProject http_model.CreateProjectRequest, enterpriseID int64) (*http_model.CreateProjectData, error) {
|
|
|
- // build gorm_model.ProjectInfo
|
|
|
+ fmt.Println("RecruitDdl:", newProject.RecruitDdl)
|
|
|
+ RecruitDdl, _ := time.ParseInLocation("2006-01-02 15:04:05", newProject.RecruitDdl, time.Local)
|
|
|
// 查询关联商品信息
|
|
|
product, err := db.GetProductByID(ctx, newProject.ProductID)
|
|
|
if err != nil {
|
|
@@ -172,12 +174,13 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
|
|
|
TalentType: newProject.TalentType,
|
|
|
ProjectPlatform: newProject.ProjectPlatform,
|
|
|
ProjectForm: newProject.ProjectForm,
|
|
|
- RecruitDdl: &newProject.RecruitDdl,
|
|
|
+ RecruitDdl: &RecruitDdl,
|
|
|
ProjectDetail: newProject.ProjectDetail,
|
|
|
ContentType: newProject.ContentType,
|
|
|
EnterpriseID: enterpriseID,
|
|
|
ProductID: newProject.ProductID,
|
|
|
FeeForm: feeFroms,
|
|
|
+ IsRead: 0,
|
|
|
}
|
|
|
// db create ProjectInfo
|
|
|
projectID, err := db.CreateProject(ctx, projectInfo)
|
|
@@ -229,9 +232,10 @@ func (*project) Create(ctx context.Context, newProject http_model.CreateProjectR
|
|
|
|
|
|
func (*project) Update(ctx context.Context, newProject http_model.UpdateProjectRequest, enterpriseID int64) (*http_model.UpdateProjectData, error) {
|
|
|
//fmt.Println("newproject:", newProject)
|
|
|
+ RecruitDdl, _ := time.ParseInLocation("2006-01-02 15:04:05", newProject.RecruitDdl, time.Local)
|
|
|
project := gorm_model.ProjectInfo{
|
|
|
ProjectID: conv.MustInt64(newProject.ProjectID, 0),
|
|
|
- RecruitDdl: &newProject.RecruitDdl,
|
|
|
+ RecruitDdl: &RecruitDdl,
|
|
|
TalentType: newProject.TalentType,
|
|
|
ContentType: conv.MustInt64(newProject.ContentType, 0),
|
|
|
ProjectDetail: newProject.ProjectDetail,
|
|
@@ -471,3 +475,14 @@ func (p *project) GetTaskFinishList(ctx *gin.Context, projectID string, pageSize
|
|
|
TaskFinishListData.Total = conv.MustString(total, "")
|
|
|
return TaskFinishListData, nil
|
|
|
}
|
|
|
+
|
|
|
+func (p *project) GetServiceCharge(ctx *gin.Context, data http_model.GetServiceChargeRequest) (*http_model.ServiceChargeData, error) {
|
|
|
+ pricingStrategy, err := db.GetPricingStrategy(ctx, data.FollowersLow, data.FollowersUp, data.FeeForm, data.Platform)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ serviceFee := http_model.ServiceChargeData{
|
|
|
+ ServiceCharge: pricingStrategy.ServiceCharge,
|
|
|
+ }
|
|
|
+ return &serviceFee, nil
|
|
|
+}
|