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
46572527
Commit
46572527
authored
Sep 03, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ad803d17
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
123 additions
and
3 deletions
+123
-3
Amercement.php
application/api_broker/controller/Amercement.php
+31
-0
Amercement.php
application/index/controller/Amercement.php
+3
-0
AmercementService.php
application/index/service/AmercementService.php
+64
-1
OAmercementImgModel.php
application/model/OAmercementImgModel.php
+10
-0
OAmercementModel.php
application/model/OAmercementModel.php
+12
-0
route.php
application/route.php
+3
-2
No files found.
application/api_broker/controller/Amercement.php
View file @
46572527
...
...
@@ -62,4 +62,34 @@ class Amercement extends Basic
}
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);
// }
$page_no
=
empty
(
$params
[
"page_no"
])
?
1
:
$params
[
"page_no"
];
$page_size
=
empty
(
$params
[
"page_size"
])
?
15
:
$params
[
"page_size"
];
$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)
if
(
$result
)
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
}
\ No newline at end of file
application/index/controller/Amercement.php
View file @
46572527
...
...
@@ -48,4 +48,6 @@ class Amercement extends Basic
return
$this
->
response
(
"101"
,
"失败"
);
}
}
}
\ No newline at end of file
application/index/service/AmercementService.php
View file @
46572527
...
...
@@ -23,13 +23,19 @@ class AmercementService
{
$this
->
m_amercement
=
new
OAmercementModel
();
$this
->
m_amercement_img
=
new
OAmercementImgModel
();
if
(
CURRENT_URL
==
'https://api.tonglianjituan.com/'
)
{
$this
->
internet_path
=
IMAGES_URL
.
'/static/amercement_img/'
;
}
else
{
$this
->
internet_path
=
'http://pre2.tonglianjituan.com/static/amercement_img/'
;
}
}
/**
* 类型
* @return array
*/
public
function
getAmercementType
()
public
function
getAmercementType
()
{
return
[
[
'id'
=>
'1'
,
'name'
=>
'班主任早会监督'
],
...
...
@@ -96,5 +102,61 @@ class AmercementService
}
/**
* 罚款账单
* @param $status
* @param $amercement_type
* @param $agent_id
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAmercementList
(
$status
,
$amercement_type
,
$agent_id
,
$page_no
,
$page_size
)
{
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time"
;
$condition
=
[];
if
(
$amercement_type
==
0
){
$condition
[
'agent_id'
]
=
$agent_id
;
}
else
{
$condition
[
'submit_agent_id'
]
=
$agent_id
;
}
$condition
[
'status'
]
=
$status
;
$result
=
$this
->
m_amercement
->
getAmercementList
(
$condition
,
$field
,
$page_no
,
$page_size
);
foreach
(
$result
as
$key
=>
$val
)
{
if
(
$status
==
0
){
//待支付
$forfeit_penalty
=
100
;
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
//滞纳金
$result
[
$key
][
'money_sum'
]
=
$forfeit_penalty
+
$result
[
$key
][
'money'
];
//罚款总金额
}
elseif
(
$status
==
1
){
//已支付
$forfeit_penalty
=
100
;
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
$result
[
$key
][
'money_sum'
]
=
$forfeit_penalty
+
$result
[
$key
][
'money'
];
$result
[
$key
][
'pay_time'
]
=
''
;
}
$result
[
$key
][
'img'
]
=
$this
->
getAmercementImage
(
$val
[
'id'
]);
}
return
$result
;
}
/**
* 罚款图片
* @param $id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public
function
getAmercementImage
(
$id
)
{
$where
[
'amercement_id'
]
=
$id
;
$img_data
=
$this
->
m_amercement_img
->
getListAll
(
'id,file_name'
,
$where
);
if
(
$img_data
)
{
foreach
(
$img_data
as
$k
=>
$v
)
{
$img_data
[
$k
][
'image_path'
]
=
$this
->
internet_path
.
$v
[
'file_name'
];
}
}
return
$img_data
?
$img_data
:
null
;
}
}
\ No newline at end of file
application/model/OAmercementImgModel.php
View file @
46572527
...
...
@@ -25,6 +25,16 @@ class OAmercementImgModel extends Model
return
$this
->
db_
->
insert
(
$data
);
}
public
function
getListAll
(
$field
,
$where
)
{
if
(
!
isset
(
$params
[
'status'
]))
{
$where
[
'status'
]
=
0
;
}
return
$this
->
db_
->
field
(
$field
)
->
where
(
$where
)
->
select
();
}
}
application/model/OAmercementModel.php
View file @
46572527
...
...
@@ -25,4 +25,16 @@ class OAmercementModel extends Model
return
$this
->
db_
->
insertGetId
(
$data
);
}
public
function
getAmercementList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
order
(
'id desc'
)
->
select
();
return
$result
;
}
}
application/route.php
View file @
46572527
...
...
@@ -1075,8 +1075,9 @@ Route::group('broker', [
'subletList'
=>
[
'api_broker/Sublet/subletList'
,
[
'method'
=>
'GET'
]],
//委托转铺列表
'getUserLookShopList'
=>
[
'api_broker/Shop/getUserLookShopList'
,
[
'method'
=>
'GET'
]],
//获取客户浏览商铺数据
'addAmercement'
=>
[
'api_broker/Amercement/addAmercement'
,
[
'method'
=>
'GET|POST'
]],
'getAmercementType'
=>
[
'api_broker/Amercement/getAmercementType'
,
[
'method'
=>
'GET|POST'
]],
'addAmercement'
=>
[
'api_broker/Amercement/addAmercement'
,
[
'method'
=>
'GET|POST'
]
],
'getAmercementType'
=>
[
'api_broker/Amercement/getAmercementType'
,
[
'method'
=>
'GET|POST'
]
],
'getAmercementList'
=>
[
'api_broker/Amercement/getAmercementList'
,
[
'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