|
@@ -23,7 +23,7 @@ type RelationContractList struct {
|
|
|
|
|
|
func GetContractRelationListByRelationContractIds(contractIdStr string) (list []*RelationContractList, err error) {
|
|
func GetContractRelationListByRelationContractIds(contractIdStr string) (list []*RelationContractList, err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
- sql := `select a.contract_id,a.company_name,b.payment_on_behalf_contract_id from contract a join contract_relation b on a.contract_id=b.payment_on_behalf_contract_id where a.status in ("已签回","已审批") AND a.is_delete = 0 AND b.contract_id in (` + contractIdStr + `) order by a.contract_id asc`
|
|
+ sql := `select b.contract_id,a.company_name,b.payment_on_behalf_contract_id from contract a join contract_relation b on a.contract_id=b.payment_on_behalf_contract_id where a.status in ("已签回","已审批") AND a.is_delete = 0 AND b.contract_id in (` + contractIdStr + `) order by a.contract_id asc`
|
|
|
|
|
|
_, err = o.Raw(sql).QueryRows(&list)
|
|
_, err = o.Raw(sql).QueryRows(&list)
|
|
return
|
|
return
|
|
@@ -42,7 +42,7 @@ where a.status in ("已签回","已审批") AND a.is_delete = 0 AND b.payment_on
|
|
|
|
|
|
func GetContractRelationListByRelationContractId(contractId int) (list []*RelationContractList, err error) {
|
|
func GetContractRelationListByRelationContractId(contractId int) (list []*RelationContractList, err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
- sql := `select a.contract_id,a.company_name,b.payment_on_behalf_contract_id from contract a join contract_relation b on a.contract_id=b.payment_on_behalf_contract_id
|
|
+ sql := `select b.contract_id,a.company_name,b.payment_on_behalf_contract_id from contract a join contract_relation b on a.contract_id=b.payment_on_behalf_contract_id
|
|
where a.status in ("已签回","已审批") AND a.is_delete = 0 AND b.contract_id =? order by a.contract_id asc`
|
|
where a.status in ("已签回","已审批") AND a.is_delete = 0 AND b.contract_id =? order by a.contract_id asc`
|
|
|
|
|
|
_, err = o.Raw(sql, contractId).QueryRows(&list)
|
|
_, err = o.Raw(sql, contractId).QueryRows(&list)
|
|
@@ -62,7 +62,7 @@ where a.status in ("已签回","已审批") AND a.is_delete = 0 AND b.payment_on
|
|
|
|
|
|
func GetContractRelationListByContractId(contractId int) (list []*RelationContractList, err error) {
|
|
func GetContractRelationListByContractId(contractId int) (list []*RelationContractList, err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
- sql := `select a.contract_id,a.company_name,b.payment_on_behalf_contract_id,a.price from contract a join contract_relation b on a.contract_id=b.payment_on_behalf_contract_id
|
|
+ sql := `select b.contract_id,a.company_name,b.payment_on_behalf_contract_id,a.price from contract a join contract_relation b on a.contract_id=b.payment_on_behalf_contract_id
|
|
where a.status in ("已签回","已审批","待审批") AND a.is_delete = 0 AND b.contract_id =? order by a.contract_id asc`
|
|
where a.status in ("已签回","已审批","待审批") AND a.is_delete = 0 AND b.contract_id =? order by a.contract_id asc`
|
|
|
|
|
|
_, err = o.Raw(sql, contractId).QueryRows(&list)
|
|
_, err = o.Raw(sql, contractId).QueryRows(&list)
|