进度控制开发,任务模式bug修正

This commit is contained in:
2025-04-18 10:36:41 +08:00
parent e159c3acc0
commit 46f4e044bf
4 changed files with 55 additions and 0 deletions

View File

@@ -72,6 +72,23 @@
ORDER BY d.plan_start_date ASC
LIMIT 1
) AS remainTime,
(
SELECT d.plan_end_date
FROM oa_progress_detail d
WHERE d.progress_id = op.progress_id
AND d.detail_status = 0
ORDER BY d.plan_start_date ASC
LIMIT 1
) AS endTime,
(
SELECT d.plan_pay_date
FROM oa_progress_detail d
WHERE d.progress_id = op.progress_id
ORDER BY d.plan_pay_date ASC
LIMIT 1
) AS payEndTime,
-- 计算当前 progress 对应的 detail 完成比例:满足 detail_status = 1 的条数 / 总条数避免除0
(
SELECT IF(COUNT(*) = 0, 0, ROUND(SUM(CASE WHEN d.detail_status = 1 THEN 1 ELSE 0 END) / COUNT(*), 2))