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
9607de30
Commit
9607de30
authored
Sep 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台验证
parent
e9b7302f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
17 deletions
+90
-17
Amercement.php
application/api_broker/controller/Amercement.php
+14
-11
AmercementValidate.php
application/api_broker/validate/AmercementValidate.php
+17
-5
Amercement.php
application/index/controller/Amercement.php
+4
-1
AmercementValidate.php
application/index/validate/AmercementValidate.php
+55
-0
No files found.
application/api_broker/controller/Amercement.php
View file @
9607de30
...
...
@@ -62,24 +62,27 @@ class Amercement extends Basic
}
/**
* 罚款账单
* @return \think\Response
*/
public
function
getAmercementList
(){
$params
=
$this
->
params
;
$params
=
array
(
"type"
=>
1
,
"agent_id"
=>
5776
,
"status"
=>
0
,
"amercement_type"
=>
0
,
);
// $checkResult = $this->validate($params, "AmercementValidate.addAmercement");
// if (true !== $checkResult) {
// return $this->response("300", $checkResult);
// }
// $params = array(
// "agent_id" => 5776,
// "status" => 0,
// "amercement_type" => 0,
// );
$checkResult
=
$this
->
validate
(
$params
,
"AmercementValidate.getAmercementList"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"300"
,
$checkResult
);
}
$page_no
=
empty
(
$params
[
"page_no"
])
?
1
:
$params
[
"page_no"
];
$page_size
=
empty
(
$params
[
"page_size"
])
?
15
:
$params
[
"page_size"
];
$status
=
$params
[
'status'
];
//
$status
=
$params
[
'status'
];
$amercement_type
=
$params
[
'amercement_type'
];
//0我需要支付的 1我提交的
$result
=
$this
->
s_amercement
->
getAmercementList
(
$status
,
$amercement_type
,
$params
[
'agent_id'
],
$page_no
,
$page_size
);
//int(1)
...
...
application/api_broker/validate/AmercementValidate.php
View file @
9607de30
...
...
@@ -16,16 +16,18 @@ class AmercementValidate extends Validate{
'agent_id'
=>
'require|number|gt:0'
,
'remarks'
=>
'require'
,
'img'
=>
'require'
,
'status'
=>
'require|number|in:0,1,2'
,
'amercement_type'
=>
'require|number|in:0,1'
,
];
protected
$message
=
[
'type.require'
=>
'type为必填字段'
,
'type.number'
=>
'type只能为数字'
,
'type.require'
=>
'type为必填字段'
,
'type.number'
=>
'type只能为数字'
,
'type.in'
=>
'type范围错误'
,
'money.require'
=>
'money为必填字段'
,
'money.number'
=>
'money只能为数字'
,
'money.require'
=>
'money为必填字段'
,
'money.number'
=>
'money只能为数字'
,
'money.gt'
=>
'money必须大于0'
,
'agent_id.require'
=>
'agent_id为必填字段'
,
...
...
@@ -33,11 +35,21 @@ class AmercementValidate extends Validate{
'agent_id.gt'
=>
'agent_id必须大于0'
,
'remarks.require'
=>
'罚款原因不能为空'
,
'img.require'
=>
'图片必传'
,
'img.require'
=>
'图片必传'
,
'status.require'
=>
'status为必填字段'
,
'status.number'
=>
'status只能为数字'
,
'status.in'
=>
'status范围错误'
,
'amercement_type.require'
=>
'amercement_type为必填字段'
,
'amercement_type.number'
=>
'amercement_type只能为数字'
,
'amercement_type.in'
=>
'amercement_type范围错误'
,
];
protected
$scene
=
[
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
,
'img'
],
'getAmercementList'
=>
[
'agent_id'
,
'status'
,
'amercement_type'
],
];
}
application/index/controller/Amercement.php
View file @
9607de30
...
...
@@ -39,7 +39,10 @@ class Amercement extends Basic
"remarks" => '罚你不需要理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
$checkResult
=
$this
->
validate
(
$params
,
"AmercementValidate.addAmercement"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$father_id
=
$this
->
s_amercement
->
addAmercement
(
$params
,
$this
->
userId
);
//int(1)
if
(
$father_id
)
{
$this
->
s_amercement
->
addAmercementImg
(
$params
[
'img'
],
$father_id
);
...
...
application/index/validate/AmercementValidate.php
0 → 100755
View file @
9607de30
<?php
namespace
app\index\validate
;
use
think\Validate
;
class
AmercementValidate
extends
Validate
{
protected
$rule
=
[
'type'
=>
'require|number|in:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17'
,
'money'
=>
'require|number|gt:0'
,
'agent_id'
=>
'require|number|gt:0'
,
'remarks'
=>
'require'
,
'img'
=>
'require'
,
'status'
=>
'require|number|in:0,1,2'
,
'amercement_type'
=>
'require|number|in:0,1'
,
];
protected
$message
=
[
'type.require'
=>
'type为必填字段'
,
'type.number'
=>
'type只能为数字'
,
'type.in'
=>
'type范围错误'
,
'money.require'
=>
'money为必填字段'
,
'money.number'
=>
'money只能为数字'
,
'money.gt'
=>
'money必须大于0'
,
'agent_id.require'
=>
'agent_id为必填字段'
,
'agent_id.number'
=>
'agent_id只能为数字'
,
'agent_id.gt'
=>
'agent_id必须大于0'
,
'remarks.require'
=>
'罚款原因不能为空'
,
'img.require'
=>
'图片必传'
,
'status.require'
=>
'status为必填字段'
,
'status.number'
=>
'status只能为数字'
,
'status.in'
=>
'status范围错误'
,
'amercement_type.require'
=>
'amercement_type为必填字段'
,
'amercement_type.number'
=>
'amercement_type只能为数字'
,
'amercement_type.in'
=>
'amercement_type范围错误'
,
];
protected
$scene
=
[
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
,
'img'
],
];
}
\ 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