|
@@ -616,9 +616,14 @@ func (p *ProjectTask) NewProject(tmp map[string]interface{}, thisinfo *Info) (st
|
|
|
set["sortprice"] = p1.Budget
|
|
|
}
|
|
|
}
|
|
|
+ if tmp["bid_field"] != nil {
|
|
|
+ set["bid_field"] = tmp["bid_field"]
|
|
|
+ }
|
|
|
redis.PutCKV("project", thisinfo.Id, set)
|
|
|
push := p.PushListInfo(tmp, thisinfo.Id)
|
|
|
- push["s_winner"] = strings.Join(thisinfo.Winners, ",")
|
|
|
+ if len(thisinfo.Winners) > 0 {
|
|
|
+ push["s_winner"] = strings.Join(thisinfo.Winners, ",")
|
|
|
+ }
|
|
|
set["list"] = []bson.M{
|
|
|
push,
|
|
|
}
|
|
@@ -949,23 +954,38 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
}
|
|
|
|
|
|
if len(thisinfo.Winners) > 0 {
|
|
|
- if len(project.Winners) <= 0 {
|
|
|
+ var winners []string
|
|
|
+ if project.Winners == "" {
|
|
|
set["winner"] = qu.ObjToString(tmp["winner"])
|
|
|
- }
|
|
|
- winners := strings.Split(project.Winners, ",")
|
|
|
- for _, k := range thisinfo.Winners {
|
|
|
- if thisinfo.SubType == "流标" || thisinfo.SubType == "废标" {
|
|
|
- if BinarySearch(winners, k) != -1 {
|
|
|
- deleteSlice(winners, k, "")
|
|
|
+ for _, k := range thisinfo.Winners {
|
|
|
+ if k == "" {
|
|
|
+ continue
|
|
|
}
|
|
|
- } else {
|
|
|
if BinarySearch(winners, k) == -1 {
|
|
|
winners = append(winners, k)
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ winners = strings.Split(project.Winners, ",")
|
|
|
+ for _, k := range thisinfo.Winners {
|
|
|
+ if k == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if thisinfo.SubType == "流标" || thisinfo.SubType == "废标" {
|
|
|
+ if BinarySearch(winners, k) != -1 {
|
|
|
+ deleteSlice(winners, k, "")
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if BinarySearch(winners, k) == -1 {
|
|
|
+ winners = append(winners, k)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(winners) > 0 {
|
|
|
+ set["s_winner"] = strings.Join(qu.ObjArrToStringArr(Duplicate(winners)), ",")
|
|
|
}
|
|
|
|
|
|
- set["s_winner"] = strings.Join(qu.ObjArrToStringArr(Duplicate(winners)), ",")
|
|
|
}
|
|
|
|
|
|
if len(thisinfo.EntIdList) > 0 {
|
|
@@ -1079,7 +1099,9 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
set["sortprice"] = pInfo.Budget
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if tmp["bid_field"] != nil {
|
|
|
+ set["bid_field"] = tmp["bid_field"]
|
|
|
+ }
|
|
|
infofield := InfoField{
|
|
|
Budget: thisinfo.Budget,
|
|
|
Bidamount: thisinfo.Bidamount,
|
|
@@ -1111,7 +1133,9 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
|
|
|
update["$set"] = set
|
|
|
}
|
|
|
push := p.PushListInfo(tmp, thisinfo.Id)
|
|
|
- push["s_winner"] = strings.Join(thisinfo.Winners, ",")
|
|
|
+ if len(thisinfo.Winners) > 0 {
|
|
|
+ push["s_winner"] = strings.Join(thisinfo.Winners, ",")
|
|
|
+ }
|
|
|
push["compareStr"] = comStr
|
|
|
push["resVal"] = pInfo.resVal
|
|
|
push["pjVal"] = pInfo.pjVal
|