|
@@ -60,19 +60,25 @@ func (n *network) AddOrUpdate(in *types.AddOrUpdateReq) *types.Reply {
|
|
|
var saveIntroduce = func(tx *sql.Tx, cid int64, isUpdate bool) bool {
|
|
|
if in.Type != "middleman" {
|
|
|
return true
|
|
|
- } else if in.Introduce_owner_id == "" && in.Introduce_project_id == "" {
|
|
|
+ } else if in.Introduce_owner_id == "" || in.Introduce_project_id == "" {
|
|
|
return false
|
|
|
}
|
|
|
values := []interface{}{}
|
|
|
- if in.Introduce_owner_id != "" {
|
|
|
- for k, v := range strings.Split(in.Introduce_owner_id, ",") {
|
|
|
- values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, strings.Split(in.Introduce_owner_name, ",")[k], 1, nowFormat)
|
|
|
- }
|
|
|
+ ioi := strings.Split(in.Introduce_owner_id, ",")
|
|
|
+ ion := strings.Split(in.Introduce_owner_name, ",")
|
|
|
+ if len(ioi) != len(ion) {
|
|
|
+ return false
|
|
|
}
|
|
|
- if in.Introduce_project_id != "" {
|
|
|
- for k, v := range strings.Split(in.Introduce_project_id, ",") {
|
|
|
- values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, strings.Split(in.Introduce_project_name, ",")[k], 2, nowFormat)
|
|
|
- }
|
|
|
+ for k, v := range ioi {
|
|
|
+ values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, ion[k], 1, nowFormat)
|
|
|
+ }
|
|
|
+ ipi := strings.Split(in.Introduce_project_id, ",")
|
|
|
+ ipn := strings.Split(in.Introduce_project_name, ",")
|
|
|
+ if len(ipi) != len(ipn) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ for k, v := range ipi {
|
|
|
+ values = append(values, in.PositionId, in.EntId, in.EntDeptId, in.EntUserId, cid, v, ipn[k], 2, nowFormat)
|
|
|
}
|
|
|
var r2 int64
|
|
|
if isUpdate {
|
|
@@ -478,9 +484,6 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if middleman_project[company_id] != nil {
|
|
|
- expect_amount = middleman_project[company_id].ProjectAmount
|
|
|
- }
|
|
|
case 5:
|
|
|
itype = "招标代理机构"
|
|
|
jump_type = "agency"
|
|
@@ -496,7 +499,7 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
|
}
|
|
|
if buyer_count < in.Buyercount_start {
|
|
|
continue
|
|
|
- } else if buyer_count > in.Buyercount_end {
|
|
|
+ } else if in.Buyercount_end > 0 && buyer_count > in.Buyercount_end {
|
|
|
continue
|
|
|
} else if in.Monitor == 1 && monitor_count <= 0 {
|
|
|
continue
|
|
@@ -504,11 +507,12 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
|
continue
|
|
|
} else if monitor_count < in.Monitorcount_start {
|
|
|
continue
|
|
|
- } else if monitor_count > in.Monitorcount_end {
|
|
|
+ } else if in.Monitorcount_end > 0 && monitor_count > in.Monitorcount_end {
|
|
|
continue
|
|
|
} else if in.Project_matchme == 1 && project_count == 0 {
|
|
|
continue
|
|
|
}
|
|
|
+
|
|
|
export_url := ""
|
|
|
if len(export_id) > 0 {
|
|
|
export_url = "/subscribepay/network/projectExport?export_id=" + encrypt.SE.EncodeStringByCheck(strings.Join(export_id, ","))
|