|
@@ -181,7 +181,7 @@
|
|
|
count(hp.id) as "countPayment",
|
|
count(hp.id) as "countPayment",
|
|
|
count(hcsc.id) as "countSubContract",
|
|
count(hcsc.id) as "countSubContract",
|
|
|
count(hccc.id) as "countCpContract",
|
|
count(hccc.id) as "countCpContract",
|
|
|
- case when count(hcs.id) > 0 then 2 else 1 end as "companySettingStatus"
|
|
|
|
|
|
|
+ case when (select count(hcs2.id) from hlw_company_subcontractor hcs2 where hcs2.company_id = a.id) > 0 then 2 else 1 end as "companySettingStatus"
|
|
|
FROM hlw_company a
|
|
FROM hlw_company a
|
|
|
left join hlw_payment hp on hp.company_id=a.id and hp.status=3
|
|
left join hlw_payment hp on hp.company_id=a.id and hp.status=3
|
|
|
left join hlw_company_subcontractor hcs on hp.company_id=hcs.company_id and hcs.subcontractor_id=hp.subcontractor_id and hp.is_through_platform=0
|
|
left join hlw_company_subcontractor hcs on hp.company_id=hcs.company_id and hcs.subcontractor_id=hp.subcontractor_id and hp.is_through_platform=0
|