Browse Source

Merge branch 'refs/heads/develop' into develop-zhou

Ethan 3 ngày trước cách đây
mục cha
commit
7464647657

+ 4 - 0
app/controller/task_controller.go

@@ -792,6 +792,10 @@ func (t TaskController) CreateLocalLife(c *gin.Context) {
 		returnError(c, 40000, "Parameter Error: "+err.Error())
 		return
 	}
+	if data.RecruitStrategys == nil || len(data.RecruitStrategys) == 0 {
+		returnSuccessWithMessage(c, 30030, "招募策略不能为空", nil)
+		return
+	}
 	localId, err := service.LocalLifeService{}.CreateLocalLife(data)
 	if err != nil {
 		logrus.Errorf("[CreateLocalLife] call CreateLocalLife err:%+v\n", err)

+ 1 - 1
app/dao/local_life_dao.go

@@ -51,7 +51,7 @@ func (d LocalLifeDao) GetLocalListOfDay(enterpriseId string, date time.Time) ([]
 
 // 创建本地生活任务
 func (d LocalLifeDao) CreateLocalLife(localLife entity.LocalLifeInfo) error {
-	err := Db.Omit("auto_fail_at", "pay_at", "submit_at", "pass_at", "finish_at").Create(&localLife).Error
+	err := Db.Omit("auto_fail_at", "pay_at", "submit_at", "pass_at", "finish_at", "fail_at").Create(&localLife).Error
 	if err != nil {
 		return err
 	}

+ 1 - 1
app/dao/project_dao.go

@@ -51,7 +51,7 @@ func (d ProjectDAO) GetProjectListOfDay(enterpriseId string, date time.Time) ([]
 
 // 创建种草任务
 func (d ProjectDAO) CreateProject(project entity.Project) error {
-	err := Db.Omit("auto_fail_at", "auto_script_break_at", "auto_sketch_break_at", "pay_at", "pass_at", "finish_at", "submit_at").Create(&project).Error
+	err := Db.Omit("auto_fail_at", "auto_script_break_at", "auto_sketch_break_at", "pay_at", "pass_at", "finish_at", "submit_at", "fail_at").Create(&project).Error
 	if err != nil {
 		return err
 	}

+ 1 - 1
app/dao/selection_info_dao.go

@@ -40,7 +40,7 @@ func (d SelectionInfoDAO) GetSelectionInfoListOfDay(enterpriseId string, date ti
 
 // 创建带货任务
 func (d SelectionInfoDAO) CreateSelectionInfo(selectionInfo entity.SelectionInfo) error {
-	err := Db.Omit("submit_at", "pass_at", "pay_at", "finish_at", "auto_fail_at").Create(&selectionInfo).Error
+	err := Db.Omit("submit_at", "pass_at", "pay_at", "finish_at", "auto_fail_at", "fail_at").Create(&selectionInfo).Error
 	if err != nil {
 		return err
 	}

+ 5 - 4
app/service/local_life_service.go

@@ -527,7 +527,7 @@ func (s LocalLifeService) GetLocalLifeDetail(localId string) (*vo.ReLocalDetail,
 	// 关联主体
 	var reStore vo.ReStorePreview
 	store, err := dao.StoreDao{}.GetStoreByID(localLife.StoreID)
-	if err == nil {
+	if err == nil && store != nil {
 		photoUrl, e := dao.ProductPhotoDAO{}.GetMainPhotoByStoreID(store.StoreID)
 		if e != nil {
 			photoUrl = ""
@@ -546,7 +546,7 @@ func (s LocalLifeService) GetLocalLifeDetail(localId string) (*vo.ReLocalDetail,
 	reLocalDetail.StoreInfo = &reStore
 	var reTeamBuying vo.ReTeamBuyingPreview
 	teamBuying, err := dao.TeamBuyingDao{}.GetTeamBuyingByID(localLife.TeamBuyingId)
-	if err == nil {
+	if err == nil && teamBuying != nil {
 		photoUrl, e := dao.ProductPhotoDAO{}.GetMainPhotoByTeamBuyingID(teamBuying.TeamBuyingID)
 		if e != nil {
 			photoUrl = ""
@@ -1268,8 +1268,9 @@ func (s LocalLifeService) StoreExploreOperate(param *vo.LocalTalentOperateParam)
 	}
 	if param.Status == 1 {
 		err2 := dao.LocalLifeTaskInfoDao{}.UpdateLocalStatus(taskIds, entity.LocalLifeTaskInfo{
-			TaskStage:  7,
-			BookStatus: 5,
+			TaskStage:   7,
+			BookStatus:  5,
+			ExploreTime: time.Now(),
 		})
 		if err2 != nil {
 			return err2

+ 7 - 7
db/locallife_task.go

@@ -247,7 +247,7 @@ func GetLocallifetaskList(ctx context.Context, request http_model.GetLocalTaskLi
 			}
 		}
 		boperator := getBOperator(db, task.BOperator, task.BOperatorType)
-		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.TalentId)
+		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.OpenId)
 		Iscoop := getIscoop(db, task.TalentId, request.EnterPriseId)
 		s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, localinfo.LocalType)
 		response := &http_model.LocaLTaskInfo{
@@ -726,7 +726,7 @@ func GetLocalPreSketchList(ctx context.Context, request http_model.LocalPreSketc
 	taskInfoPointers := make([]*http_model.LocalTasksketchInfo, 0, len(projecrtaskinfo))
 
 	for _, task := range projecrtaskinfo {
-		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.TalentId)
+		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.OpenId)
 		Iscoop := getIscoop(db, task.TalentId, request.EnterpriseId)
 		s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, localinfo.LocalType)
 		taskinfo := &http_model.LocaLTaskInfo{
@@ -835,7 +835,7 @@ func GetLocalSketchList(ctx context.Context, request http_model.LocalTasksketchl
 	}
 	taskInfoPointers := make([]*http_model.LocalTasksketchinfo, 0, len(projecrtaskinfo))
 	for _, task := range projecrtaskinfo {
-		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.TalentId)
+		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.OpenId)
 		s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, localinfo.LocalType)
 		taskinfo := &http_model.LocaLTaskInfo{
 			TaskId:             task.TaskId,
@@ -960,7 +960,7 @@ func GetLocalPreLinkList(ctx context.Context, request http_model.LocalPreLinkLis
 	}
 	taskInfoPointers := make([]*http_model.LocalTasklinkinfo, 0, len(projecrtaskinfo))
 	for _, task := range projecrtaskinfo {
-		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.TalentId)
+		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.OpenId)
 		Iscoop := getIscoop(db, task.TalentId, request.EnterpriseId)
 		s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, localinfo.LocalType)
 		taskinfo := &http_model.LocaLTaskInfo{
@@ -1069,7 +1069,7 @@ func GetLocalLinkList(ctx context.Context, request http_model.LocalTaskLinklistR
 	}
 	taskInfoPointers := make([]*http_model.LocalTaskLinkinfo, 0, len(projecrtaskinfo))
 	for _, task := range projecrtaskinfo {
-		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.TalentId)
+		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.OpenId)
 		Iscoop := getIscoop(db, task.TalentId, request.EnterpriseId)
 		s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, localinfo.LocalType)
 		taskinfo := &http_model.LocaLTaskInfo{
@@ -1195,7 +1195,7 @@ func GetLocalPreDataList(ctx context.Context, request http_model.LocalPreDataLis
 	}
 	taskInfoPointers := make([]*http_model.LocalTaskdatainfo, 0, len(projecrtaskinfo))
 	for _, task := range projecrtaskinfo {
-		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.TalentId)
+		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.OpenId)
 		Iscoop := getIscoop(db, task.TalentId, request.EnterpriseId)
 		s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, localinfo.LocalType)
 		taskinfo := &http_model.LocaLTaskInfo{
@@ -1304,7 +1304,7 @@ func GetLocalDataList(ctx context.Context, request http_model.LocalTaskDatalistR
 	}
 	taskInfoPointers := make([]*http_model.LocalTaskDatainfo, 0, len(projecrtaskinfo))
 	for _, task := range projecrtaskinfo {
-		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.TalentId)
+		nickname, headurl, gender, fans, voteavg := getTalentinfo(db, task.OpenId)
 		Iscoop := getIscoop(db, task.TalentId, request.EnterpriseId)
 		s_type, s_name := stype(db, task.SupplierId, task.SupplierStatus, localinfo.LocalType)
 		taskinfo := &http_model.LocaLTaskInfo{

+ 1 - 1
db/sketch.go

@@ -245,7 +245,7 @@ func AcceptSketch(ctx context.Context, TaskIDs []string, operatorid string, oper
 			optype = 2
 		}
 	}
-	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": opid, "b_operator_type": optype}).Error
+	err := db.Model(gorm_model.YounggeeSketchInfo{}).Where("task_id in ? and is_review = 0", TaskIDs).Updates(map[string]interface{}{"is_ok": 1, "is_review": 1, "agree_at": time.Now(), "b_operator": opid, "b_operator_type": optype, "revise_opinion": "初稿通过"}).Error
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[Sketch db] Update YounggeeSketchInfo error,err:%+v", err)
 		return err