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
536fc953
Commit
536fc953
authored
Sep 24, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将已支付罚款状态改掉
parent
c658313b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
7 deletions
+76
-7
ImageDepot.php
application/index/controller/ImageDepot.php
+23
-2
AmercementService.php
application/index/service/AmercementService.php
+37
-5
OAmercementModel.php
application/model/OAmercementModel.php
+16
-0
No files found.
application/index/controller/ImageDepot.php
View file @
536fc953
...
...
@@ -5,6 +5,7 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\index\service\PositionService
;
use
app\index\service\UserCallStintService
;
use
app\model\AAgents
;
use
app\model\GImageDepot
;
/**
...
...
@@ -180,9 +181,29 @@ class ImageDepot extends Basic
public
function
ceshi
()
{
$p
redict_see_time
=
strtotime
(
"+2 hour"
,
strtotime
(
'2019-09-20 16:45:16'
))
;
$p
arams
[
"district_id"
]
=
29
;
dump
(
time
()
<
$predict_see_time
);
$params
[
"status"
]
=
array
(
'in'
,
'0,1,2,3'
);
$agentModel
=
new
AAgents
();
$agentsArr
=
$agentModel
->
getAgentsByStoreId
(
$params
);
$agentIds
=
array_column
(
$agentsArr
,
'id'
);
$agentIds
=
implode
(
','
,
$agentIds
);
dump
(
$agentIds
);
// $agent_total = count($agentsArr);
// $agentIds = "";
// if ($agent_total > 0) {
// foreach ($agentsArr as $key1 => $value1) {
// $agentIds .= $value1["id"] . ",";
// }
// $agentIds = rtrim($agentIds, ",");//经纪人ID集合
// }//查询总监下面门店的所有经纪人 end
//
// dump($agentIds);
}
...
...
application/index/service/AmercementService.php
View file @
536fc953
...
...
@@ -195,7 +195,8 @@ class AmercementService
*/
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,forfeit_penalty,money_sum"
;
$this
->
updateBeforeAmercement
();
//将已支付罚款状态改掉
$condition
=
[];
if
(
$amercement_type
==
0
)
{
$condition
[
'agent_id'
]
=
$agent_id
;
...
...
@@ -203,7 +204,9 @@ class AmercementService
$condition
[
'submit_agent_id'
]
=
$agent_id
;
}
$condition
[
'status'
]
=
$status
;
$result
=
$this
->
m_amercement
->
getAmercementList
(
$condition
,
$field
,
$page_no
,
$page_size
);
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty,money_sum"
;
$result
=
$this
->
m_amercement
->
getAmercementList
(
$condition
,
$field
,
$page_no
,
$page_size
);
if
(
!
$result
)
{
return
[];
}
...
...
@@ -211,13 +214,10 @@ class AmercementService
$redis_cache
=
new
RedisCacheService
();
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
'type_name'
]
=
$this
->
getTypeName
(
$val
[
'type'
]);
$agent_data
=
$redis_cache
->
getRedisCache
(
2
,
$val
[
'submit_agent_id'
]);
$result
[
$key
][
'submit_agent_name'
]
=
$agent_data
[
'name'
];
$result
[
$key
][
'submit_agent_phone'
]
=
$agent_data
[
'phone'
];
if
(
$status
==
0
)
{
//待支付
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
...
...
@@ -466,6 +466,8 @@ class AmercementService
*/
public
function
getAmercementListPc
(
$params
,
$page_no
,
$page_size
)
{
$this
->
updateBeforeAmercement
();
//将已支付罚款状态改掉
$conditions
=
$this
->
buildConditions
(
$params
);
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty,money_sum"
;
$result
=
$this
->
m_amercement
->
getAmercementList
(
$conditions
,
$field
,
$page_no
,
$page_size
);
...
...
@@ -473,6 +475,7 @@ class AmercementService
foreach
(
$result
as
$key
=>
$val
)
{
if
(
$val
[
'status'
]
==
0
)
{
//计算滞纳金
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
...
...
@@ -498,6 +501,34 @@ class AmercementService
}
/**
* 罚款列表前置操作 将已支付罚款状态改掉
* @return bool
*/
public
function
updateBeforeAmercement
()
{
$conditions
[
"status"
]
=
0
;
$field
=
"id,status"
;
$result
=
$this
->
m_amercement
->
getAmercementListAll
(
$conditions
,
$field
);
if
(
!
$result
)
{
return
true
;
}
foreach
(
$result
as
$key
=>
$val
)
{
//该记录是否已支付
$payInfo
=
$this
->
isPay
(
$val
[
'id'
]);
if
(
$payInfo
)
{
//已支付
$data
=
[];
$data
[
'id'
]
=
$val
[
'id'
];
$data
[
'status'
]
=
1
;
$data
[
'operation_id'
]
=
0
;
$data
[
'operation_time'
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$this
->
m_amercement
->
updateAmercementData
(
$data
);
}
}
return
true
;
}
/**
* 后台罚款账单表 导出excel
* @param $params
...
...
@@ -505,6 +536,7 @@ class AmercementService
*/
public
function
getAmercementListExcel
(
$params
)
{
$this
->
updateBeforeAmercement
();
//将已支付罚款状态改掉
$conditions
=
$this
->
buildConditions
(
$params
);
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty"
;
$result
=
$this
->
m_amercement
->
getAmercementListExcel
(
$conditions
,
$field
);
...
...
application/model/OAmercementModel.php
View file @
536fc953
...
...
@@ -46,6 +46,22 @@ class OAmercementModel extends Model
return
$result
;
}
/**
* 罚款列表前置操作 将已支付罚款状态改掉
* @param $params
* @param $field
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAmercementListAll
(
$params
,
$field
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
order
(
'id desc'
)
->
select
();
return
$result
;
}
public
function
getAmercementTotal
(
$params
,
$field
)
{
$result
=
$this
->
db_
...
...
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