feat(StoreFinanceFlowDayLists): 修改收入计算逻辑增加财务类型判断

This commit is contained in:
mkm 2024-06-27 15:09:14 +08:00
parent 02f747c8b9
commit 300b6b4bb2

View File

@ -46,7 +46,7 @@ class StoreFinanceFlowDayLists extends BaseAdminDataLists implements ListsSearch
return StoreFinanceFlow::where($this->searchWhere)
->field('
FROM_UNIXTIME(create_time, "%Y-%m-%d") as date,
SUM(CASE WHEN financial_pm = 1 THEN number ELSE 0 END) as income,
SUM(CASE WHEN financial_pm = 1 AND WHERE financial_type=1 THEN number ELSE 0 END) as income,
SUM(CASE WHEN financial_pm = 0 THEN number ELSE 0 END) as expenditure
')
->limit($this->limitOffset, $this->limitLength)