Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
ce16bfd8
提交
ce16bfd8
authored
7月 17, 2020
作者:
chengye
浏览文件
操作
浏览文件
下载
差异文件
test
上级
8e8e4dcf
6af3a14e
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
38 行增加
和
17 行删除
+38
-17
Payment.php
application/api/controller/v2/common/Payment.php
+1
-7
WriteOff.php
application/em/controller/WriteOff.php
+9
-9
default.html
application/em/view/useage/default.html
+26
-1
detail_special.html
application/em/view/useage/detail_special.html
+2
-0
没有找到文件。
application/api/controller/v2/common/Payment.php
浏览文件 @
ce16bfd8
...
...
@@ -44,13 +44,7 @@ class Payment
$payment
->
pay_date
=
time
();
$payment
->
save
();
try
{
$res
=
(
new
WriteOff
())
->
writeOffFromPayment
(
$payment
->
account_id
,
$payment
->
payment_id
);
}
catch
(
\Exception
$e
){
$res
=
$e
->
getMessage
();
Log
::
error
(
'##res##:'
.
$res
);
}
$res
=
(
new
WriteOff
())
->
writeOffFromPayment
(
$payment
->
account_id
,
$payment
->
payment_id
);
return
json
([
...
...
application/em/controller/WriteOff.php
浏览文件 @
ce16bfd8
...
...
@@ -21,19 +21,15 @@ class WriteOff extends Controller
//获取关联的账单对象
$invs
=
(
new
EmInvoice
())
->
alias
(
'a'
)
->
field
(
'a.invoice_id'
)
->
leftJ
oin
([
'em_payment_invoice'
=>
'b'
],
'b.invoice_id = a.invoice_id'
)
->
j
oin
([
'em_payment_invoice'
=>
'b'
],
'b.invoice_id = a.invoice_id'
)
->
where
(
'b.payment_id'
,
'='
,
$payment_id
)
->
where
(
'a.payment_balance'
,
'neq'
,
0
)
->
order
(
'a.invoice_id asc'
)
->
select
();
$invsArr
=
[];
//更新缴费单状态
if
(
$invs
->
isEmpty
()){
$payment
->
status
=
4
;
$payment
->
save
();
return
'审核成功'
;
}
else
{
//如果存在账单关联对象
if
(
!
$invs
->
isEmpty
()){
foreach
(
$invs
as
$inv
){
$invsArr
[]
=
$inv
->
invoice_id
;
}
...
...
@@ -47,6 +43,7 @@ class WriteOff extends Controller
$invs
=
(
new
EmInvoice
())
->
field
(
'invoice_id'
)
->
where
(
'account_id'
,
'='
,
$payment
->
account_id
)
->
where
(
'payment_balance'
,
'neq'
,
0
)
->
whereNotIn
(
'invoice_id'
,
$invsArr
)
->
order
(
'invoice_id asc'
)
->
select
();
if
(
!
$invs
->
isEmpty
())
{
...
...
@@ -56,6 +53,7 @@ class WriteOff extends Controller
}
}
$paymentIds
[]
=
$payment
->
payment_id
;
//处理账户金额
...
...
@@ -82,10 +80,12 @@ class WriteOff extends Controller
foreach
(
$payments
as
$key
=>
$payment
){
if
(
$payment
->
balance
==
0
)
continue
;
foreach
(
$invs
as
$index
=>
$inv
)
{
$balanceMode
=
new
EmPaymentInvoiceBalance
();
$balanceMode
->
payment_id
=
$payment
->
payment_id
;
if
(
$inv
->
payment_balance
==
0
)
continue
;
$balanceMode
=
new
EmPaymentInvoiceBalance
();
$balanceMode
->
payment_id
=
$payment
->
payment_id
;
$balanceMode
->
invoice_id
=
$inv
->
invoice_id
;
//如果该缴费单可以完全消除当前账单额度
...
...
application/em/view/useage/default.html
浏览文件 @
ce16bfd8
...
...
@@ -155,13 +155,28 @@
</div>
</div>
{if $em.rule.pricing_type == 2}
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
实缴电费
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"amount"
name=
"amount"
autocomplete=
"off"
class=
"layui-input"
value=
"{$em.useage.amount|default=''}"
{
if
isset
($
em
.
useage
.
amount
)
}
disabled=
"disabled"
{/
if
}
>
</div>
<div
class=
"layui-form-mid layui-word-aux"
>
元
</div>
</div>
</div>
{/if}
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
单价
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"price"
name=
"price"
autocomplete=
"off"
class=
"layui-input"
{
if
$
em
.
useage
.
price
}
disabled=
"disabled"
{/
if
}
value=
"{$em.useage.price|default=''}"
>
<input
type=
"text"
id=
"price"
name=
"price"
autocomplete=
"off"
class=
"layui-input"
{
if
$
em
.
useage
.
price
||
$
em
.
rule
.
pricing_type =
=
2
}
disabled=
"disabled"
{/
if
}
value=
"{$em.useage.price|default=''}"
>
</div>
<div
class=
"layui-form-mid layui-word-aux"
>
元
...
...
@@ -310,6 +325,15 @@
$
(
'#repo_numb'
).
val
(
$rNum
/
$level
)
}
})
$
(
'#amount'
).
change
(
function
(){
if
(
$
(
'#repo_numb'
).
val
()
==
''
)
{
layMsg
(
'本次抄表必须大于上次抄表读数'
,
5
);
return
;
}
var
$price
=
$
(
'#amount'
).
val
()
/
$
(
'#repo_numb'
).
val
();
$
(
'#price'
).
val
(
$price
.
toFixed
(
4
))
})
});
</script>
{/block}
\ No newline at end of file
application/em/view/useage/detail_special.html
浏览文件 @
ce16bfd8
...
...
@@ -151,6 +151,8 @@
</div>
</div>
<div
class=
"layui-col-md5"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论