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
3455038b
Commit
3455038b
authored
Sep 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6058720b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
8 deletions
+83
-8
Amercement.php
application/index/controller/Amercement.php
+20
-0
AmercementService.php
application/index/service/AmercementService.php
+36
-0
AmercementValidate.php
application/index/validate/AmercementValidate.php
+15
-8
OAmercementModel.php
application/model/OAmercementModel.php
+10
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/Amercement.php
View file @
3455038b
...
@@ -91,4 +91,23 @@ class Amercement extends Basic
...
@@ -91,4 +91,23 @@ class Amercement extends Basic
}
}
public
function
getAmercementInfo
(){
$params
=
$this
->
params
;
// $params = array(
// "id" => 1,
// );
$checkResult
=
$this
->
validate
(
$params
,
"AmercementValidate.getAmercementInfo"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$result
=
$this
->
s_amercement
->
getAmercementInfo
(
$params
[
'id'
]);
//int(1)
if
(
$result
)
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
}
}
\ No newline at end of file
application/index/service/AmercementService.php
View file @
3455038b
...
@@ -239,6 +239,34 @@ class AmercementService
...
@@ -239,6 +239,34 @@ class AmercementService
return
$img_data
?
$img_data
:
null
;
return
$img_data
?
$img_data
:
null
;
}
}
public
function
getAmercementInfo
(
$id
)
{
$conditions
=
[];
$conditions
[
"id"
]
=
$id
;
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time"
;
$result
=
$this
->
m_amercement
->
getAmercementInfo
(
$conditions
,
$field
);
$redis_cache
=
new
RedisCacheService
();
$result
[
'type_name'
]
=
$this
->
getTypeName
(
$result
[
'type'
]);
$agent_data
=
$redis_cache
->
getRedisCache
(
2
,
$result
[
'submit_agent_id'
]);
$result
[
'submit_agent_name'
]
=
$agent_data
[
'name'
];
$result
[
'submit_agent_phone'
]
=
$agent_data
[
'phone'
];
if
(
$result
[
'status'
]
==
0
){
//待支付
$forfeit_penalty
=
100
;
$result
[
'forfeit_penalty'
]
=
$forfeit_penalty
;
//滞纳金
$result
[
'money_sum'
]
=
$forfeit_penalty
+
$result
[
'money'
];
//罚款总金额
}
elseif
(
$result
[
'status'
]
==
1
){
//已支付
$forfeit_penalty
=
100
;
$result
[
'forfeit_penalty'
]
=
$forfeit_penalty
;
$result
[
'money_sum'
]
=
$forfeit_penalty
+
$result
[
'money'
];
$result
[
'pay_time'
]
=
''
;
}
$result
[
'img'
]
=
$this
->
getAmercementImage
(
$result
[
'id'
]);
return
$result
;
}
/**
/**
* 后台罚款账单表
* 后台罚款账单表
...
@@ -268,6 +296,13 @@ class AmercementService
...
@@ -268,6 +296,13 @@ class AmercementService
}
}
/**
* 后台罚款账单表 导出excel
* @param $params
* @param $page_no
* @param $page_size
* @return string
*/
public
function
getAmercementListExcel
(
$params
,
$page_no
,
$page_size
)
public
function
getAmercementListExcel
(
$params
,
$page_no
,
$page_size
)
{
{
$conditions
=
$this
->
buildConditions
(
$params
);
$conditions
=
$this
->
buildConditions
(
$params
);
...
@@ -284,6 +319,7 @@ class AmercementService
...
@@ -284,6 +319,7 @@ class AmercementService
$result
[
$key
][
'agent_name'
]
=
$agent_data
[
'name'
];
$result
[
$key
][
'agent_name'
]
=
$agent_data
[
'name'
];
}
}
$export
=
new
ExportExcelUntil
();
$export
=
new
ExportExcelUntil
();
$e_data_new
=
[];
foreach
(
$result
as
$key
=>
$v
)
{
foreach
(
$result
as
$key
=>
$v
)
{
$e_data_old
[
'1'
]
=
$v
[
'id'
];
$e_data_old
[
'1'
]
=
$v
[
'id'
];
$e_data_old
[
'2'
]
=
$v
[
'type_name'
];
$e_data_old
[
'2'
]
=
$v
[
'type_name'
];
...
...
application/index/validate/AmercementValidate.php
View file @
3455038b
...
@@ -10,13 +10,14 @@ class AmercementValidate extends Validate {
...
@@ -10,13 +10,14 @@ class AmercementValidate extends Validate {
protected
$rule
=
[
protected
$rule
=
[
'type'
=>
'require|number|in:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17'
,
'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'
,
'money'
=>
'require|number|gt:0'
,
'agent_id'
=>
'require|number|gt:0'
,
'agent_id'
=>
'require|number|gt:0'
,
'remarks'
=>
'require'
,
'remarks'
=>
'require'
,
'img'
=>
'require'
,
'img'
=>
'require'
,
'status'
=>
'require|number|in:0,1,2'
,
'status'
=>
'require|number|in:0,1,2'
,
'amercement_type'
=>
'require|number|in:0,1'
,
'amercement_type'
=>
'require|number|in:0,1'
,
'id'
=>
'require|number|gt:0'
,
];
];
...
@@ -45,10 +46,15 @@ class AmercementValidate extends Validate {
...
@@ -45,10 +46,15 @@ class AmercementValidate extends Validate {
'amercement_type.number'
=>
'amercement_type只能为数字'
,
'amercement_type.number'
=>
'amercement_type只能为数字'
,
'amercement_type.in'
=>
'amercement_type范围错误'
,
'amercement_type.in'
=>
'amercement_type范围错误'
,
'id.require'
=>
'id为必填字段'
,
'id.number'
=>
'id只能为数字'
,
'id.gt'
=>
'id必须大于0'
,
];
];
protected
$scene
=
[
protected
$scene
=
[
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
,
'img'
],
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
,
'img'
],
'getAmercementInfo'
=>
[
'id'
],
];
];
}
}
\ No newline at end of file
application/model/OAmercementModel.php
View file @
3455038b
...
@@ -25,6 +25,16 @@ class OAmercementModel extends Model
...
@@ -25,6 +25,16 @@ class OAmercementModel extends Model
return
$this
->
db_
->
insertGetId
(
$data
);
return
$this
->
db_
->
insertGetId
(
$data
);
}
}
public
function
getAmercementInfo
(
$params
,
$field
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
order
(
'id desc'
)
->
find
();
return
$result
;
}
public
function
getAmercementList
(
$params
,
$field
,
$page_no
,
$page_size
)
public
function
getAmercementList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
{
$result
=
$this
->
db_
$result
=
$this
->
db_
...
...
application/route.php
View file @
3455038b
...
@@ -587,6 +587,8 @@ Route::group('index', [
...
@@ -587,6 +587,8 @@ Route::group('index', [
'addAmercement'
=>
[
'index/Amercement/addAmercement'
,
[
'method'
=>
'GET|POST'
]],
'addAmercement'
=>
[
'index/Amercement/addAmercement'
,
[
'method'
=>
'GET|POST'
]],
'getAmercementListPc'
=>
[
'index/Amercement/getAmercementListPc'
,
[
'method'
=>
'GET|POST'
]],
'getAmercementListPc'
=>
[
'index/Amercement/getAmercementListPc'
,
[
'method'
=>
'GET|POST'
]],
'getAmercementListExcel'
=>
[
'index/Amercement/getAmercementListExcel'
,
[
'method'
=>
'GET|POST'
]],
'getAmercementInfo'
=>
[
'index/Amercement/getAmercementInfo'
,
[
'method'
=>
'GET|POST'
]],
]);
]);
...
...
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