Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
5eda0a72
Commit
5eda0a72
authored
Sep 20, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新数据
parent
e47e52c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
7 deletions
+45
-7
AmercementService.php
application/index/service/AmercementService.php
+45
-7
No files found.
application/index/service/AmercementService.php
View file @
5eda0a72
...
@@ -315,6 +315,8 @@ class AmercementService
...
@@ -315,6 +315,8 @@ class AmercementService
*/
*/
public
function
editAmercement
(
$id
,
$params
,
$edit_type
,
$operation_id
)
public
function
editAmercement
(
$id
,
$params
,
$edit_type
,
$operation_id
)
{
{
$code
=
200
;
$msg
=
'成功'
;
switch
(
$edit_type
)
{
switch
(
$edit_type
)
{
case
0
:
case
0
:
//0编辑
//0编辑
...
@@ -343,13 +345,17 @@ class AmercementService
...
@@ -343,13 +345,17 @@ class AmercementService
break
;
break
;
case
1
:
case
1
:
//1取消
//1取消
$this
->
cancelAmercement
(
$id
);
$res
=
$this
->
cancelAmercement
(
$id
);
$code
=
$res
[
'code'
];
$msg
=
$res
[
'msg'
];
break
;
break
;
default
:
default
:
//2转已支付
//2转已支付
$this
->
consummationAmercement
(
$id
,
$operation_id
);
$res
=
$this
->
consummationAmercement
(
$id
,
$operation_id
);
$code
=
$res
[
'code'
];
$msg
=
$res
[
'msg'
];
}
}
return
[
'code'
=>
200
,
'msg'
=>
'成功'
];
return
[
'code'
=>
$code
,
'msg'
=>
$msg
];
}
}
/**
/**
...
@@ -388,15 +394,21 @@ class AmercementService
...
@@ -388,15 +394,21 @@ class AmercementService
/**
/**
* 更新数据 取消
* 更新数据 取消
* @param $id
* @param $id
* @return
bool
* @return
array
*/
*/
public
function
cancelAmercement
(
$id
)
public
function
cancelAmercement
(
$id
)
{
{
//判断是否有支付过
$payInfo
=
$this
->
isPay
(
$id
,
-
1
);
if
(
$payInfo
)
{
//有支付订单号 不允许取消
return
[
'code'
=>
101
,
'msg'
=>
'失败!该罚款有支付订单'
];
}
else
{
//无支付订单号 允许取消
$data
=
[];
$data
=
[];
$data
[
'id'
]
=
$id
;
$data
[
'id'
]
=
$id
;
$data
[
'status'
]
=
2
;
$data
[
'status'
]
=
2
;
$this
->
m_amercement
->
updateAmercementData
(
$data
);
$this
->
m_amercement
->
updateAmercementData
(
$data
);
return
true
;
return
[
'code'
=>
200
,
'msg'
=>
'已取消'
];
}
}
}
...
@@ -404,19 +416,45 @@ class AmercementService
...
@@ -404,19 +416,45 @@ class AmercementService
* 更新数据 转已支付
* 更新数据 转已支付
* @param $id
* @param $id
* @param $operation_id
* @param $operation_id
* @return
bool
* @return
array
*/
*/
public
function
consummationAmercement
(
$id
,
$operation_id
)
public
function
consummationAmercement
(
$id
,
$operation_id
)
{
{
//判断是否有支付过
$payInfo
=
$this
->
isPay
(
$id
);
if
(
$payInfo
)
{
//已支付
$data
=
[];
$data
=
[];
$data
[
'id'
]
=
$id
;
$data
[
'id'
]
=
$id
;
$data
[
'status'
]
=
1
;
$data
[
'status'
]
=
1
;
$data
[
'operation_id'
]
=
$operation_id
;
$data
[
'operation_id'
]
=
$operation_id
;
$data
[
'operation_time'
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$data
[
'operation_time'
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$this
->
m_amercement
->
updateAmercementData
(
$data
);
$this
->
m_amercement
->
updateAmercementData
(
$data
);
return
true
;
return
[
'code'
=>
200
,
'msg'
=>
'已转为已支付'
];
}
else
{
//未支付
return
[
'code'
=>
101
,
'msg'
=>
'失败!暂未支付'
];
}
}
}
/**
* 支付状态查询 默认判断是否有支付过
* @param $amercement_id
* @param int $status
* @return array|false|\PDOStatement|string|\think\Model
*/
public
function
isPay
(
$amercement_id
,
$status
=
1
)
{
$amercementPayModel
=
new
OAmercementPayModel
();
$where
[
"amercement_id"
]
=
$amercement_id
;
$where
[
"status"
]
=
$status
;
if
(
$status
==
-
1
){
$where
[
"status"
]
=
array
(
'neq'
,
2
);
//排除支付失败的
}
$payInfo
=
$amercementPayModel
->
getAmercementPayInfo
(
$where
,
"id,status,trade_no"
);
return
$payInfo
;
}
/**
/**
* 后台罚款账单表
* 后台罚款账单表
* @param $params
* @param $params
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment