Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
eb109369
提交
eb109369
authored
10月 28, 2020
作者:
wangkr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整 账单balance的条件,按照balance剩余数值生成缴费单
上级
a6ff70f8
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
26 行增加
和
17 行删除
+26
-17
Payment.php
application/em/controller/Payment.php
+26
-17
没有找到文件。
application/em/controller/Payment.php
浏览文件 @
eb109369
...
@@ -188,7 +188,7 @@ class Payment extends Base
...
@@ -188,7 +188,7 @@ class Payment extends Base
if
(
!
$payment
)
return
json
([
'status'
=>
0
,
'message'
=>
'单据:'
.
$epiModel
->
payment_id
.
'出现异常,单据与账单关系存在,但缴费单不存在!'
]);
if
(
!
$payment
)
return
json
([
'status'
=>
0
,
'message'
=>
'单据:'
.
$epiModel
->
payment_id
.
'出现异常,单据与账单关系存在,但缴费单不存在!'
]);
//如果缴费单并未缴费
//如果缴费单并未缴费
if
(
$payment
->
amount
>
0
){
if
(
$payment
->
balance
>
0
){
$message
=
'账单号: '
.
$inv
->
invoice_id
.
' 已经与缴费单:'
.
$payment
->
payment_id
.
'挂起,无法生成缴费单'
;
$message
=
'账单号: '
.
$inv
->
invoice_id
.
' 已经与缴费单:'
.
$payment
->
payment_id
.
'挂起,无法生成缴费单'
;
return
json
([
'status'
=>
0
,
'message'
=>
$message
]);
return
json
([
'status'
=>
0
,
'message'
=>
$message
]);
}
else
{
}
else
{
...
@@ -475,16 +475,21 @@ class Payment extends Base
...
@@ -475,16 +475,21 @@ class Payment extends Base
if
(
$inv
->
payment_balance
==
0
){
if
(
$inv
->
payment_balance
==
0
){
$inv
->
paid_amount
=
$inv
->
payment_amount
;
$inv
->
paid_amount
=
$inv
->
payment_amount
;
}
else
{
}
else
{
$inv
->
paid_amount
=
$inv
->
payment_
amount
-
$inv
->
payment_
balance
;
$inv
->
paid_amount
=
$inv
->
payment_balance
;
}
}
}
}
}
}
$payway
=
$this
->
getFkInfo
(
1
);
$org
=
$this
->
getFkInfo
(
2
);
$this
->
assign
(
'invs'
,
$invs
);
$this
->
assign
(
'invs'
,
$invs
);
$this
->
assign
(
'payment_id'
,
$payment_id
);
$this
->
assign
(
'payment_id'
,
$payment_id
);
$this
->
assign
(
'payee'
,
$this
->
getGys
(
$staff
->
email
));
$this
->
assign
(
'payee'
,
$this
->
getGys
(
$staff
->
email
));
$this
->
assign
(
'org'
,
$this
->
getFkInfo
(
2
));
$this
->
assign
(
'org'
,
$org
);
$this
->
assign
(
'payway'
,
$this
->
getFkInfo
(
1
));
$this
->
assign
(
'date'
,
date
(
'Y-m-d H:i:s'
));
$this
->
assign
(
'payway'
,
$payway
);
return
$this
->
fetch
(
'pay_oa'
);
return
$this
->
fetch
(
'pay_oa'
);
}
}
...
@@ -503,19 +508,19 @@ class Payment extends Base
...
@@ -503,19 +508,19 @@ class Payment extends Base
$details
=
[];
$details
=
[];
if
(
$payment
->
payment_type
==
2
||
$payment
->
payment_type
==
4
){
if
(
$payment
->
payment_type
==
2
||
$payment
->
payment_type
==
4
){
$details
[
0
][
'charge_type'
]
=
"维护电费"
;
$details
[
0
][
'charge_type'
]
=
$post
[
'fkitem'
]
;
$details
[
0
][
'amount'
]
=
$payment
->
amount
;
$details
[
0
][
'amount'
]
=
$payment
->
amount
;
$details
[
0
][
'cbzxid'
]
=
$this
->
getCbzxIdByEmId
(
$payment
->
em_id
);
$details
[
0
][
'cbzxid'
]
=
$this
->
getCbzxIdByEmId
(
$payment
->
em_id
);
}
else
{
}
else
{
$invs
=
(
new
EmPayment
())
->
getinvsInfo
(
$payment
->
payment_id
);
$invs
=
(
new
EmPayment
())
->
getinvsInfo
(
$payment
->
payment_id
);
foreach
(
$invs
as
$k
=>
$inv
){
foreach
(
$invs
as
$k
=>
$inv
){
$details
[
$k
][
'charge_type'
]
=
"维护电费"
;
$details
[
$k
][
'charge_type'
]
=
$post
[
'fkitem'
]
;
if
(
$inv
->
payment_balance
==
0
){
if
(
$inv
->
payment_balance
==
0
){
$details
[
$k
][
'amount'
]
=
0
;
$details
[
$k
][
'amount'
]
=
0
;
}
else
if
(
$inv
->
payment_amount
==
$inv
->
payment_balance
){
}
else
if
(
$inv
->
payment_amount
==
$inv
->
payment_balance
){
$details
[
$k
][
'amount'
]
=
$inv
->
payment_amount
;
$details
[
$k
][
'amount'
]
=
$inv
->
payment_amount
;
}
else
{
}
else
{
$details
[
$k
][
'amount'
]
=
$inv
->
payment_
amount
-
$inv
->
payment_
balance
;
$details
[
$k
][
'amount'
]
=
$inv
->
payment_balance
;
}
}
$details
[
$k
][
'cbzxid'
]
=
$this
->
getDetailsFields
(
$inv
->
account_id
);
$details
[
$k
][
'cbzxid'
]
=
$this
->
getDetailsFields
(
$inv
->
account_id
);
}
}
...
@@ -531,6 +536,7 @@ class Payment extends Base
...
@@ -531,6 +536,7 @@ class Payment extends Base
'info'
=>
$post
[
'info'
],
'info'
=>
$post
[
'info'
],
'cause'
=>
$post
[
'cause'
],
'cause'
=>
$post
[
'cause'
],
'date'
=>
$post
[
'date'
],
'date'
=>
$post
[
'date'
],
'payment_id'
=>
$payment
->
payment_id
,
'details'
=>
$details
'details'
=>
$details
];
];
...
@@ -550,7 +556,7 @@ class Payment extends Base
...
@@ -550,7 +556,7 @@ class Payment extends Base
//创建付款单据
//创建付款单据
$receipt
=
$this
->
createFkNumb
(
$data
);
$receipt
=
$this
->
createFkNumb
(
$data
);
//创建结果
//创建结果
$result
=
false
;
$result
=
false
;
if
(
!
empty
(
$receipt
[
'data'
])){
if
(
!
empty
(
$receipt
[
'data'
])){
...
@@ -587,9 +593,14 @@ class Payment extends Base
...
@@ -587,9 +593,14 @@ class Payment extends Base
$res
=
httpPOST
(
$url
,
$data
);
$res
=
httpPOST
(
$url
,
$data
);
$res
=
json_decode
(
$res
,
true
);
$res
=
json_decode
(
$res
,
true
);
foreach
(
$res
[
'data'
]
as
$k
=>
$v
){
foreach
(
$res
[
'data'
]
as
$k
=>
$v
){
$temp
=
[];
if
(
!
empty
(
$v
[
'bank_info'
])){
if
(
!
empty
(
$v
[
'bank_info'
])){
foreach
(
$v
[
'bank_info'
]
as
$a
=>
$b
){
foreach
(
$v
[
'bank_info'
]
as
$a
=>
$b
){
$temp
[
$a
]
=
'银行名称: '
.
$b
[
'open_bank_name'
]
.
'账号: '
.
$b
[
'bank_code'
];
$info
=
"账户名称:"
.
$b
[
'bank_holder'
]
.
','
;
$info
.=
"开户银行:"
.
$b
[
'open_bank_name'
]
.
','
;
$info
.=
"银行账号:"
.
$b
[
'bank_code'
]
.
','
;
$info
.=
"开户行地址:"
.
$b
[
'open_address'
];
$temp
[
$a
]
=
$info
;
}
}
$res
[
'data'
][
$k
][
'bankInfo'
]
=
json_encode
(
$temp
);
$res
[
'data'
][
$k
][
'bankInfo'
]
=
json_encode
(
$temp
);
}
}
...
@@ -599,9 +610,9 @@ class Payment extends Base
...
@@ -599,9 +610,9 @@ class Payment extends Base
//获取付款所需信息
//获取付款所需信息
public
function
getFkInfo
(
$type
){
public
function
getFkInfo
(
$type
){
$url
=
config
(
'oafk.base_url'
)
.
config
(
'oafk.type'
)
.
$this
->
apiKey
();
$data
=
[
'type'
=>
$type
];
$url
=
config
(
'oafk.base_url'
)
.
config
(
'oafk.type'
)
.
$this
->
apiKey
();
$res
=
httpPOST
(
$url
,
$data
);
$res
=
httpPOST
(
$url
,
[
'type'
=>
$type
]
);
$res
=
json_decode
(
$res
,
true
);
$res
=
json_decode
(
$res
,
true
);
return
$res
[
'data'
];
return
$res
[
'data'
];
}
}
...
@@ -609,9 +620,8 @@ class Payment extends Base
...
@@ -609,9 +620,8 @@ class Payment extends Base
//创建付款编号
//创建付款编号
public
function
createFkNumb
(
$data
){
public
function
createFkNumb
(
$data
){
$url
=
config
(
'oafk.base_url'
)
.
config
(
'oafk.fk'
)
.
$this
->
apiKey
();
$url
=
config
(
'oafk.base_url'
)
.
config
(
'oafk.fk'
)
.
$this
->
apiKey
();
$res
=
httpPOST
(
$url
,
[
'data'
=>
json_encode
(
$data
)]);
$data
=
[
'data'
=>
$data
];
// $end = strpos($res,'}');
$res
=
httpPOST
(
$url
,
$data
);
// $str = substr($res,$start,$end);
$res
=
json_decode
(
$res
,
true
);
$res
=
json_decode
(
$res
,
true
);
return
$res
;
return
$res
;
}
}
...
@@ -639,4 +649,4 @@ class Payment extends Base
...
@@ -639,4 +649,4 @@ class Payment extends Base
$station
=
\app\station\model\Station
::
get
([
'station_id'
=>
$em
->
station_id
]);
$station
=
\app\station\model\Station
::
get
([
'station_id'
=>
$em
->
station_id
]);
return
$station
->
proj_number
;
return
$station
->
proj_number
;
}
}
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论