feat(StoreFinanceFlow): 修改财务流水的统计方式,按年份和月份或按周显示收入和支出
This commit is contained in:
parent
3a80a09c83
commit
eff3a9a2c6
@ -46,7 +46,7 @@ class StoreFinanceFlowMonthLists extends BaseAdminDataLists implements ListsSear
|
|||||||
return StoreFinanceFlow::where($this->searchWhere)
|
return StoreFinanceFlow::where($this->searchWhere)
|
||||||
->field('
|
->field('
|
||||||
CONCAT(YEAR(FROM_UNIXTIME(create_time, "%Y-%m-%d")), "年", MONTH(FROM_UNIXTIME(create_time, "%Y-%m-%d")), "月") as date,
|
CONCAT(YEAR(FROM_UNIXTIME(create_time, "%Y-%m-%d")), "年", MONTH(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 financial_type = 1 THEN number ELSE 0 END) as income,
|
||||||
SUM(CASE WHEN financial_pm = 0 THEN number ELSE 0 END) as expenditure
|
SUM(CASE WHEN financial_pm = 0 THEN number ELSE 0 END) as expenditure
|
||||||
')
|
')
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
@ -46,7 +46,7 @@ class StoreFinanceFlowWeekLists extends BaseAdminDataLists implements ListsSearc
|
|||||||
return StoreFinanceFlow::where($this->searchWhere)
|
return StoreFinanceFlow::where($this->searchWhere)
|
||||||
->field('
|
->field('
|
||||||
CONCAT("第", LPAD(YEAR(FROM_UNIXTIME(create_time, "%Y-%m-%d")), 4, "0"), "-", LPAD(WEEK(FROM_UNIXTIME(create_time, "%Y-%m-%d"), 3), 2, "0"), "周(", LPAD(MONTH(FROM_UNIXTIME(create_time, "%Y-%m-%d")), 2, "0"), "月)") as date,
|
CONCAT("第", LPAD(YEAR(FROM_UNIXTIME(create_time, "%Y-%m-%d")), 4, "0"), "-", LPAD(WEEK(FROM_UNIXTIME(create_time, "%Y-%m-%d"), 3), 2, "0"), "周(", LPAD(MONTH(FROM_UNIXTIME(create_time, "%Y-%m-%d")), 2, "0"), "月)") as date,
|
||||||
SUM(CASE WHEN financial_pm = 1 THEN number ELSE 0 END) as income,
|
SUM(CASE WHEN financial_pm = 1 AND financial_type = 1 THEN number ELSE 0 END) as income,
|
||||||
SUM(CASE WHEN financial_pm = 0 THEN number ELSE 0 END) as expenditure
|
SUM(CASE WHEN financial_pm = 0 THEN number ELSE 0 END) as expenditure
|
||||||
')
|
')
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user