Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
b7221ed4
提交
b7221ed4
authored
1月 15, 2020
作者:
chengye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复账单列表无法显示与账单详情显示错误
上级
0e2dea9d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
26 行增加
和
25 行删除
+26
-25
workspace.xml
.idea/workspace.xml
+0
-0
EmInvoice.php
application/em/model/EmInvoice.php
+26
-25
没有找到文件。
.idea/workspace.xml
浏览文件 @
b7221ed4
差异被折叠。
点击展开。
application/em/model/EmInvoice.php
浏览文件 @
b7221ed4
...
@@ -32,17 +32,15 @@ class EmInvoice extends Base
...
@@ -32,17 +32,15 @@ class EmInvoice extends Base
public
function
getInvoiceList
(
$map
,
$Nowpage
,
$limits
){
public
function
getInvoiceList
(
$map
,
$Nowpage
,
$limits
){
$data
=
self
::
alias
(
'inv'
)
$data
=
self
::
alias
(
'inv'
)
->
field
(
'inv.*'
)
->
field
(
'inv.*'
)
->
field
(
'station.station_name'
)
->
field
(
'station.station_name,em.em_numb'
)
->
field
(
'em.em_numb'
)
->
join
([
'em_account'
=>
'ea'
],
'ea.account_id = inv.account_id'
)
->
leftJoin
([
'em_invoice_useage'
=>
'eiu'
],
'eiu.invoice_id=inv.invoice_id'
)
->
join
([
'em'
],
'em.id=ea.em_id'
)
->
leftJoin
([
'em_useage'
=>
'eu'
],
'eu.useage_id = eiu.useage_id'
)
->
join
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
leftJoin
([
'em'
],
'em.id=eu.em_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
where
(
$map
)
->
where
(
$map
)
->
page
(
$Nowpage
,
$limits
)
->
page
(
$Nowpage
,
$limits
)
->
select
()
->
select
()
->
toarray
();
->
toarray
();
foreach
(
$data
as
&
$item
){
foreach
(
$data
as
&
$item
){
if
(
$item
[
'payment_balance'
]
==
''
)
$item
[
'payment_balance'
]
=
0
;
if
(
$item
[
'payment_balance'
]
==
''
)
$item
[
'payment_balance'
]
=
0
;
$item
[
'paid_amount'
]
=
$item
[
'payment_amount'
]
-
$item
[
'payment_balance'
];
$item
[
'paid_amount'
]
=
$item
[
'payment_amount'
]
-
$item
[
'payment_balance'
];
if
(
is_int
(
$item
[
'settle_amount'
])
&&
$item
[
'settle_balance'
]){
if
(
is_int
(
$item
[
'settle_amount'
])
&&
$item
[
'settle_balance'
]){
...
@@ -56,15 +54,12 @@ class EmInvoice extends Base
...
@@ -56,15 +54,12 @@ class EmInvoice extends Base
}
}
public
function
getInvoiceCount
(
$map
){
public
function
getInvoiceCount
(
$map
){
$data
=
self
::
alias
(
'inv'
)
$data
=
self
::
alias
(
'inv'
)
->
field
(
'inv.*'
)
->
field
(
'inv.*'
)
->
field
(
'station.station_name'
)
->
join
([
'em_account'
=>
'ea'
],
'ea.account_id = inv.account_id'
)
->
field
(
'em.em_numb'
)
->
join
([
'em'
],
'em.id=ea.em_id'
)
->
leftJoin
([
'em_invoice_useage'
=>
'eiu'
],
'eiu.invoice_id=inv.invoice_id'
)
->
join
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
leftJoin
([
'em_useage'
=>
'eu'
],
'eu.useage_id = eiu.useage_id'
)
->
where
(
$map
)
->
leftJoin
([
'em'
],
'em.id=eu.em_id'
)
->
count
();
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
where
(
$map
)
->
count
();
return
$data
;
return
$data
;
}
}
//通过invoice_id查询列表数据
//通过invoice_id查询列表数据
...
@@ -73,10 +68,9 @@ class EmInvoice extends Base
...
@@ -73,10 +68,9 @@ class EmInvoice extends Base
->
field
(
'inv.*'
)
->
field
(
'inv.*'
)
->
field
(
'station.station_name'
)
->
field
(
'station.station_name'
)
->
field
(
'em.em_numb'
)
->
field
(
'em.em_numb'
)
->
leftJoin
([
'em_invoice_useage'
=>
'eiu'
],
'eiu.invoice_id=inv.invoice_id'
)
->
join
([
'em_account'
=>
'ea'
],
'ea.account_id = inv.account_id'
)
->
leftJoin
([
'em_useage'
=>
'eu'
],
'eu.useage_id = eiu.useage_id'
)
->
join
([
'em'
],
'em.id=ea.em_id'
)
->
leftJoin
([
'em'
],
'em.id=eu.em_id'
)
->
join
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
where
([
'inv.invoice_id'
=>
$ids
])
->
where
([
'inv.invoice_id'
=>
$ids
])
// ->where('inv.payment_balance','neq',0)
// ->where('inv.payment_balance','neq',0)
->
select
();
->
select
();
...
@@ -94,7 +88,14 @@ class EmInvoice extends Base
...
@@ -94,7 +88,14 @@ class EmInvoice extends Base
$eiu
=
EmInvoiceUseage
::
where
([
'invoice_id'
=>
$inv
->
invoice_id
])
->
find
();
$eiu
=
EmInvoiceUseage
::
where
([
'invoice_id'
=>
$inv
->
invoice_id
])
->
find
();
//查询抄表信息
//查询抄表信息
$useage
=
Useage
::
with
(
'photo'
)
->
get
([
'useage_id'
=>
$eiu
->
useage_id
]);
$useage
=
Useage
::
get
([
'useage_id'
=>
$eiu
->
useage_id
]);
if
(
$useage
->
photo_id
)
{
$receipt
=
Receipt
::
get
([
'id'
=>
$useage
->
photo_id
]);
if
(
$receipt
)
$useage
[
'photo'
]
=
$receipt
;
}
else
{
$useage
[
'photo'
]
=
[];
}
//获取电表信息
//获取电表信息
$em
=
Em
::
with
(
'rule'
)
->
field
(
'id,station_id,em_numb,em_type_id,rate'
)
->
where
([
'id'
=>
$useage
->
em_id
])
->
find
();
$em
=
Em
::
with
(
'rule'
)
->
field
(
'id,station_id,em_numb,em_type_id,rate'
)
->
where
([
'id'
=>
$useage
->
em_id
])
->
find
();
...
@@ -125,10 +126,10 @@ class EmInvoice extends Base
...
@@ -125,10 +126,10 @@ class EmInvoice extends Base
//峰谷表
//峰谷表
if
(
$inv
[
'type'
]
!==
5
){
if
(
$inv
[
'type'
]
!==
5
){
$ud
=
UseageDetail
::
field
(
'*,case type
$ud
=
UseageDetail
::
field
(
'*,case type
when 1 then "尖峰段"
when 1 then "尖峰段"
when 2 then "峰段"
when 2 then "峰段"
when 3 then "谷段"
when 3 then "谷段"
when 4 then "平段"
when 4 then "平段"
else "普通" end as typeName
else "普通" end as typeName
'
)
'
)
...
@@ -143,7 +144,7 @@ class EmInvoice extends Base
...
@@ -143,7 +144,7 @@ class EmInvoice extends Base
$totle
[
'current_numb'
]
=
0
;
$totle
[
'current_numb'
]
=
0
;
$totle
[
'repo_numb'
]
=
0
;
$totle
[
'repo_numb'
]
=
0
;
$totle
[
'amount'
]
=
$totle
[
'settle_amount'
]
=
0
;
$totle
[
'amount'
]
=
$totle
[
'settle_amount'
]
=
0
;
$totle
[
'settle_price'
]
=
$inv
->
em
->
emr
->
settle_price
*
$inv
->
em
->
rate
;
$totle
[
'settle_price'
]
=
(
$inv
->
em
->
emr
->
settle_price
?:
0
)
*
$inv
->
em
->
rate
;
$totle
[
'settle_status'
]
=
parseStatus
(
$inv
->
status
,
2
);
$totle
[
'settle_status'
]
=
parseStatus
(
$inv
->
status
,
2
);
//峰谷表与普通抄表
//峰谷表与普通抄表
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论