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
edae7981
Commit
edae7981
authored
Sep 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑
parent
24fce57b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
9 deletions
+54
-9
Amercement.php
application/index/controller/Amercement.php
+4
-3
AmercementService.php
application/index/service/AmercementService.php
+42
-5
AmercementValidate.php
application/index/validate/AmercementValidate.php
+8
-1
No files found.
application/index/controller/Amercement.php
View file @
edae7981
...
...
@@ -119,7 +119,6 @@ class Amercement extends Basic
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
...
...
@@ -129,16 +128,17 @@ class Amercement extends Basic
*/
public
function
editAmercement
(){
$params
=
$this
->
params
;
// $params = array(
// "id" => 1,
// "edit_type" => 0,//0编辑 1取消 2转已支付
// );
$checkResult
=
$this
->
validate
(
$params
,
"AmercementValidate.getAmercementInfo"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$this
->
s_amercement
->
editAmercement
(
$params
[
'id'
]);
//int(1)
$this
->
s_amercement
->
editAmercement
(
$params
[
'id'
]
,
$params
[
'edit_type'
]
);
//int(1)
return
$this
->
response
(
"200"
,
"成功"
);
}
}
\ No newline at end of file
application/index/service/AmercementService.php
View file @
edae7981
...
...
@@ -276,21 +276,39 @@ class AmercementService
/**
* 更新数据
* @param $id
* @param $edit_type
* @return bool
*/
public
function
editAmercement
(
$id
)
public
function
editAmercement
(
$id
,
$edit_type
)
{
//0编辑 1取消 2转已支付
switch
(
$edit_type
)
{
case
0
:
$this
->
updateAmercement
(
$id
);
break
;
case
1
:
$this
->
cancelAmercement
(
$id
);
break
;
default
:
$this
->
consummationAmercement
(
$id
);
}
return
true
;
}
public
function
updateAmercement
(
$id
)
{
$data
=
[];
if
((
isset
(
$params
[
'money'
]))
&&
(
$params
[
'money'
]
>
0
))
if
((
isset
(
$params
[
'money'
]))
&&
(
$params
[
'money'
]
>
0
))
$data
[
'money'
]
=
$params
[
'money'
];
if
((
isset
(
$params
[
'type'
]))
&&
(
in_array
(
$params
[
'type'
],
[
0
,
1
])))
if
((
isset
(
$params
[
'type'
]))
&&
(
in_array
(
$params
[
'type'
],
[
0
,
1
])))
$data
[
'type'
]
=
$params
[
'type'
];
if
((
isset
(
$params
[
'remarks'
]))
&&
$params
[
'remarks'
])
if
((
isset
(
$params
[
'remarks'
]))
&&
$params
[
'remarks'
])
$data
[
'social_security_fee'
]
=
$params
[
'social_security_fee'
];
if
(
!
$data
)
{
if
(
!
$data
)
{
return
false
;
}
...
...
@@ -299,6 +317,25 @@ class AmercementService
return
true
;
}
public
function
cancelAmercement
(
$id
)
{
$data
=
[];
$data
[
'id'
]
=
$id
;
$data
[
'status'
]
=
3
;
$this
->
m_amercement
->
updateAmercementData
(
$data
);
return
true
;
}
public
function
consummationAmercement
(
$id
)
{
$data
=
[];
$data
[
'id'
]
=
$id
;
$data
[
'status'
]
=
2
;
$this
->
m_amercement
->
updateAmercementData
(
$data
);
return
true
;
}
/**
* 后台罚款账单表
* @param $params
...
...
application/index/validate/AmercementValidate.php
View file @
edae7981
...
...
@@ -18,6 +18,8 @@ class AmercementValidate extends Validate {
'status'
=>
'require|number|in:0,1,2'
,
'amercement_type'
=>
'require|number|in:0,1'
,
'id'
=>
'require|number|gt:0'
,
'edit_type'
=>
'require|number|in:0,1,2'
,
];
...
...
@@ -50,11 +52,15 @@ class AmercementValidate extends Validate {
'id.number'
=>
'id只能为数字'
,
'id.gt'
=>
'id必须大于0'
,
'edit_type.require'
=>
'type为必填字段'
,
'edit_type.number'
=>
'type只能为数字'
,
'edit_type.in'
=>
'type范围错误'
,
];
protected
$scene
=
[
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
,
'img'
],
'getAmercementInfo'
=>
[
'id'
],
'getAmercementInfo'
=>
[
'id'
,
'edit_type'
],
];
}
\ No newline at end of file
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