Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
53179b77
提交
53179b77
authored
7月 26, 2020
作者:
chengye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge release 改动
上级
cae0784c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
64 行删除
+30
-64
Payment.php
application/em/controller/Payment.php
+5
-2
EmPayment.php
application/em/model/EmPayment.php
+16
-59
update.html
application/em/view/useage/update.html
+9
-3
没有找到文件。
application/em/controller/Payment.php
浏览文件 @
53179b77
...
...
@@ -172,7 +172,10 @@ class Payment extends Base
//过滤不可以生成缴费单的账单ID
$idsArr
=
[];
$amount
=
0
;
$inv0
=
null
;
foreach
(
$invs
as
$inv
){
if
(
$inv0
===
null
)
$inv0
=
$inv
;
//未生成缴费或已挂起
$amount
+=
$inv
->
payment_balance
;
//是否已挂起
...
...
@@ -219,8 +222,8 @@ class Payment extends Base
$pData
=
[];
$pData
[
'payment_id'
]
=
$paymentId
;
$pData
[
'status'
]
=
1
;
$pData
[
'account_id'
]
=
'\\'
;
//占位符,表示空的无效的
$pData
[
'em_id'
]
=
'\\'
;
//占位符,表示空的无效的
$pData
[
'account_id'
]
=
$inv0
->
account_id
;
//占位符,表示空的无效的
$pData
[
'em_id'
]
=
$inv0
->
em_id
;
//占位符,表示空的无效的
$pData
[
'payment_type'
]
=
1
;
$pData
[
'balance'
]
=
$pData
[
'amount'
]
=
round
(
$amount
,
2
);
$pData
[
'uid'
]
=
$this
->
uid
;
...
...
application/em/model/EmPayment.php
浏览文件 @
53179b77
...
...
@@ -23,46 +23,19 @@ class EmPayment extends Base
//缴费单+search
public
function
getPaymentList
(
$map
,
$Nowpage
,
$limits
){
//先找到账单
$data
=
self
::
alias
(
'pay'
)
->
field
(
'pay.*'
)
->
field
(
'epi.invoice_id'
)
->
field
(
'em.em_numb'
)
->
field
(
'r.region_name,station.station_name'
)
->
leftJoin
([
'em_payment_invoice'
=>
'epi'
],
'epi.payment_id = pay.payment_id'
)
->
leftJoin
([
'em_invoice'
=>
'ei'
],
'ei.invoice_id=epi.invoice_id'
)
->
leftJoin
([
'em_account'
=>
'ea'
],
'ea.account_id=ei.account_id'
)
->
leftJoin
([
'em'
],
'em.id=ea.em_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
leftJoin
([
'region'
=>
'r'
],
'station.area_id = r.id'
)
->
where
(
$map
)
->
order
(
'pay.id desc'
)
->
group
(
'pay.payment_id'
)
->
page
(
$Nowpage
,
$limits
)
->
select
()
->
toarray
();
$arr
=
[];
foreach
(
$data
as
$v
){
$arr
[]
=
$v
[
'payment_id'
];
}
$data
2
=
self
::
alias
(
'pay'
)
$data
=
self
::
alias
(
'pay'
)
->
field
(
'pay.*'
)
->
field
(
'em.em_numb,r.region_name,station.station_name'
)
->
leftJoin
([
'em_account'
=>
'ea'
],
'ea.account_id=pay.account_id'
)
->
leftJoin
([
'em'
],
'em.id=ea.em_id'
)
->
leftJoin
([
'em'
],
'em.id=pay.em_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
leftJoin
([
'region'
=>
'r'
],
'station.area_id = r.id'
)
->
where
(
$map
)
->
whereNotIn
(
'pay.payment_id'
,
$arr
)
->
order
(
'pay.id desc'
)
->
group
(
'pay.payment_id'
)
->
page
(
$Nowpage
,
$limits
)
->
select
()
->
toarray
();
$data
=
array_merge
(
$data
,
$data2
);
$sortKey
=
[];
foreach
(
$data
as
$k
=>
$item
){
...
...
@@ -80,52 +53,36 @@ class EmPayment extends Base
//先找到账单
$data
=
self
::
alias
(
'pay'
)
->
field
(
'pay.*'
)
->
field
(
'epi.invoice_id'
)
->
field
(
'em.em_numb'
)
->
field
(
'r.region_name,station.station_name'
)
->
leftJoin
([
'em_payment_invoice'
=>
'epi'
],
'epi.payment_id = pay.payment_id'
)
->
leftJoin
([
'em_invoice'
=>
'ei'
],
'ei.invoice_id=epi.invoice_id'
)
->
leftJoin
([
'em_account'
=>
'ea'
],
'ea.account_id=ei.account_id'
)
->
leftJoin
([
'em'
],
'em.id=ea.em_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
leftJoin
([
'region'
=>
'r'
],
'station.area_id = r.id'
)
->
where
(
$map
)
->
count
();
$data2
=
self
::
alias
(
'pay'
)
->
field
(
'pay.*'
)
->
field
(
'em.em_numb,r.region_name,station.station_name'
)
->
leftJoin
([
'em_account'
=>
'ea'
],
'ea.account_id=pay.account_id'
)
->
leftJoin
([
'em'
],
'em.id=ea.em_id'
)
->
leftJoin
([
'em'
],
'em.id=pay.em_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
leftJoin
([
'region'
=>
'r'
],
'station.area_id = r.id'
)
->
where
(
$map
)
->
count
();
return
intval
(
$data
+
$data2
);
return
$data
;
}
//通过缴费单id返回缴费单关联账单信息
public
function
getinvsInfo
(
$payment_id
){
//1.获取所关联账单的账单id,通过账单id查询账单信息
$invIdArr
=
EmPaymentInvoice
::
field
(
'invoice_id'
)
->
where
(
'payment_id'
,
'='
,
$payment_id
)
->
select
()
->
toArray
();
//1.获取所关联账单的账单id,通过账单id查询账单信息
$invIdArr
=
EmPaymentInvoice
::
field
(
'invoice_id'
)
->
where
(
'payment_id'
,
'='
,
$payment_id
)
->
select
()
->
toArray
();
//降维
//降维
$invArr
=
[];
foreach
(
$invIdArr
as
$inv
){
$invArr
[]
=
$inv
[
'invoice_id'
];
}
$invModel
=
new
EmInvoice
();
$invs
=
$invModel
->
alias
(
'inv'
)
->
field
(
'inv.*'
)
->
field
(
'station.station_name,station.proj_number'
)
->
field
(
'em.em_numb'
)
->
leftJoin
([
'em_invoice_useage'
=>
'eiu'
],
'eiu.invoice_id=inv.invoice_id'
)
->
leftJoin
([
'em_useage'
=>
'eu'
],
'eu.useage_id = eiu.useage_id'
)
->
leftJoin
([
'em'
],
'em.id=eu.em_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
where
([
'inv.invoice_id'
=>
$invArr
])
->
select
();
->
field
(
'inv.*'
)
->
field
(
'station.station_name,station.proj_number'
)
->
field
(
'em.em_numb'
)
->
leftJoin
([
'em_invoice_useage'
=>
'eiu'
],
'eiu.invoice_id=inv.invoice_id'
)
->
leftJoin
([
'em_useage'
=>
'eu'
],
'eu.useage_id = eiu.useage_id'
)
->
leftJoin
([
'em'
],
'em.id=eu.em_id'
)
->
leftJoin
([
'station_info'
=>
'station'
],
'station.station_id=em.station_id'
)
->
where
([
'inv.invoice_id'
=>
$invArr
])
->
select
();
return
$invs
;
}
...
...
application/em/view/useage/update.html
浏览文件 @
53179b77
...
...
@@ -209,7 +209,7 @@
</label>
<div
class=
"layui-input-inline"
>
<button
type=
"button"
class=
"layui-btn"
id=
"up_photo"
{
if
$
useage
.
status=
=2}
disabled=
"disabled"
{/
if
}
>
<i
class=
"layui-icon"
>
</i>
上传
<i
class=
"layui-icon"
>
</i>
上传
</button>
<input
type=
"hidden"
name=
"photo_id"
value=
"{$useage.photo_id}"
>
<a
href=
"{$useage.photo.src}"
target=
"_blank"
class=
"layui-btn {if empty($useage.photo_id)} layui-hide {/if}"
>
...
...
@@ -307,7 +307,7 @@
}
});
$
(
'#current_numb'
).
change
(
function
(){
var
$level
=
1
00000
;
var
$level
=
1
;
var
$rate
=
$
(
'#rate'
).
val
();
var
$baseNum
=
$level
*
$rate
;
var
$rNum
=
$
(
this
).
val
()
*
$baseNum
-
$
(
'#last_numb'
).
val
()
*
$baseNum
;
...
...
@@ -317,7 +317,8 @@
layMsg
(
'本次抄表必须大于上次抄表读数'
,
5
);
$
(
'#current_numb'
).
focus
();
}
else
{
var
$num
=
$rNum
/
$level
;
var
$num
=
round2
(
$rNum
);
$
(
'#repo_numb'
).
val
(
$num
)
if
(
$amount
!=
''
||
$amount
!=
0
){
...
...
@@ -336,6 +337,10 @@
var
$price
=
$
(
'#amount'
).
val
()
/
$
(
'#repo_numb'
).
val
();
$
(
'#price'
).
val
(
$price
.
toFixed
(
4
))
})
function
round2
(
num
){
return
Math
.
round
((
num
+
Number
.
EPSILON
)
*
100
)
/
100
;
}
});
</script>
{/block}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论