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
48d40704
Commit
48d40704
authored
Sep 19, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d85f113b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
157 additions
and
77 deletions
+157
-77
Amercement.php
application/api_broker/controller/Amercement.php
+47
-8
AmercementValidate.php
application/api_broker/validate/AmercementValidate.php
+28
-3
AmercementService.php
application/index/service/AmercementService.php
+80
-66
route.php
application/route.php
+2
-0
No files found.
application/api_broker/controller/Amercement.php
View file @
48d40704
<?php
<?php
namespace
app\api_broker\controller
;
namespace
app\api_broker\controller
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
@@ -17,6 +18,7 @@ use think\Request;
...
@@ -17,6 +18,7 @@ use think\Request;
class
Amercement
extends
Basic
class
Amercement
extends
Basic
{
{
protected
$s_amercement
;
protected
$s_amercement
;
public
function
__construct
(
$request
=
null
)
public
function
__construct
(
$request
=
null
)
{
{
parent
::
__construct
(
$request
);
parent
::
__construct
(
$request
);
...
@@ -28,7 +30,8 @@ class Amercement extends Basic
...
@@ -28,7 +30,8 @@ class Amercement extends Basic
* @return \think\Response
* @return \think\Response
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=918
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=918
*/
*/
public
function
addAmercement
(){
public
function
addAmercement
()
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
...
@@ -45,10 +48,10 @@ class Amercement extends Basic
...
@@ -45,10 +48,10 @@ class Amercement extends Basic
$vip
=
new
VipService
();
//0:有权限 1:无权限
$vip
=
new
VipService
();
//0:有权限 1:无权限
$is_can_edit
=
$vip
->
checkRule
(
$this
->
agentId
,
'addAmercement'
);
$is_can_edit
=
$vip
->
checkRule
(
$this
->
agentId
,
'addAmercement'
);
if
(
$is_can_edit
==
1
)
{
if
(
$is_can_edit
==
1
)
{
return
$this
->
response
(
"101"
,
"暂无权限"
);
return
$this
->
response
(
"101"
,
"暂无权限"
);
}
}
$father_id
=
$this
->
s_amercement
->
addAmercement
(
$params
,
$this
->
agentId
);
//int(1)
$father_id
=
$this
->
s_amercement
->
addAmercement
(
$params
,
$this
->
agentId
);
//int(1)
if
(
$father_id
)
{
if
(
$father_id
)
{
if
(
isset
(
$params
[
'img'
])
&&
!
empty
(
$params
[
'img'
]))
{
if
(
isset
(
$params
[
'img'
])
&&
!
empty
(
$params
[
'img'
]))
{
$this
->
s_amercement
->
addAmercementImg
(
$params
[
'img'
],
$father_id
);
$this
->
s_amercement
->
addAmercementImg
(
$params
[
'img'
],
$father_id
);
...
@@ -64,9 +67,10 @@ class Amercement extends Basic
...
@@ -64,9 +67,10 @@ class Amercement extends Basic
* 获取类型
* 获取类型
* @return \think\Response
* @return \think\Response
*/
*/
public
function
getAmercementType
(){
public
function
getAmercementType
()
{
$res
=
$this
->
s_amercement
->
getAmercementType
();
$res
=
$this
->
s_amercement
->
getAmercementType
();
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
}
}
...
@@ -74,7 +78,8 @@ class Amercement extends Basic
...
@@ -74,7 +78,8 @@ class Amercement extends Basic
* 罚款账单
* 罚款账单
* @return \think\Response
* @return \think\Response
*/
*/
public
function
getAmercementList
(){
public
function
getAmercementList
()
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
// $params = array(
// $params = array(
...
@@ -93,8 +98,42 @@ class Amercement extends Basic
...
@@ -93,8 +98,42 @@ class Amercement extends Basic
$status
=
$params
[
'status'
];
$status
=
$params
[
'status'
];
$amercement_type
=
$params
[
'amercement_type'
];
//0我需要支付的 1我提交的
$amercement_type
=
$params
[
'amercement_type'
];
//0我需要支付的 1我提交的
$result
=
$this
->
s_amercement
->
getAmercementList
(
$status
,
$amercement_type
,
$params
[
'agent_id'
],
$page_no
,
$page_size
);
//int(1)
$result
=
$this
->
s_amercement
->
getAmercementList
(
$status
,
$amercement_type
,
$params
[
'agent_id'
],
$page_no
,
$page_size
);
//int(1)
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
public
function
savePayAmercement
()
{
$params
=
$this
->
params
;
/* $params = array(
"amercement_id" => 11,
"trade_no" => "12323123123",
"pay_type" => 1,//支付类型 1支付宝 2微信
"status" => 0,
"remark" => "qweqweqweqwe",
"pay_money" => 111,
"pay_time" => 111,
);*/
$checkResult
=
$this
->
validate
(
$params
,
"AmercementValidate.savePayAmercement"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$amercement_id
=
$params
[
"amercement_id"
];
$trade_no
=
$params
[
"trade_no"
];
$pay_type
=
$params
[
"pay_type"
];
//支付类型 1支付宝 2微信
$status
=
$params
[
"status"
];
$remark
=
$params
[
"remark"
];
$pay_money
=
$params
[
"pay_money"
];
$pay_time
=
$params
[
"pay_time"
];
$result
=
$this
->
s_amercement
->
savePayAmercement
(
$amercement_id
,
$trade_no
,
$pay_type
,
$status
,
$remark
,
$pay_money
,
$pay_time
);
if
(
$result
)
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"101"
,
"保存失败,请求异常"
);
}
}
}
...
...
application/api_broker/validate/AmercementValidate.php
View file @
48d40704
<?php
<?php
namespace
app\api_broker\validate
;
namespace
app\api_broker\validate
;
use
think\Validate
;
use
think\Validate
;
/**
/**
...
@@ -8,7 +10,8 @@ use think\Validate;
...
@@ -8,7 +10,8 @@ use think\Validate;
* Date: 2019-09-02
* Date: 2019-09-02
* Time: 16:27:00
* Time: 16:27:00
*/
*/
class
AmercementValidate
extends
Validate
{
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'
,
...
@@ -17,6 +20,12 @@ class AmercementValidate extends Validate{
...
@@ -17,6 +20,12 @@ class AmercementValidate extends Validate{
'remarks'
=>
'require'
,
'remarks'
=>
'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'
,
'amercement_id'
=>
'require|number'
,
'trade_no'
=>
'require'
,
'pay_type'
=>
'require|number|in:1,2'
,
'pay_money'
=>
'require|number|gt:0'
,
'pay_time'
=>
'require'
,
];
];
...
@@ -44,10 +53,26 @@ class AmercementValidate extends Validate{
...
@@ -44,10 +53,26 @@ class AmercementValidate extends Validate{
'amercement_type.number'
=>
'amercement_type只能为数字'
,
'amercement_type.number'
=>
'amercement_type只能为数字'
,
'amercement_type.in'
=>
'amercement_type范围错误'
,
'amercement_type.in'
=>
'amercement_type范围错误'
,
'amercement_id.require'
=>
'amercement_id为必填字段'
,
'amercement_id.number'
=>
'amercement_id只能为数字'
,
'trade_no.require'
=>
'trade_no只能为数字'
,
'pay_type.require'
=>
'pay_type为必填字段'
,
'pay_type.number'
=>
'pay_type只能为数字'
,
'pay_type.in'
=>
'pay_type范围错误'
,
'pay_money.require'
=>
'pay_money为必填字段'
,
'pay_money.number'
=>
'pay_money只能为数字'
,
'pay_money.gt'
=>
'pay_money必须大于0'
,
'pay_time.require'
=>
'pay_time为必填字段'
,
];
];
protected
$scene
=
[
protected
$scene
=
[
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
],
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
],
'getAmercementList'
=>
[
'agent_id'
,
'status'
,
'amercement_type'
],
'getAmercementList'
=>
[
'agent_id'
,
'status'
,
'amercement_type'
],
'savePayAmercement'
=>
[
'amercement_id'
,
'trade_no'
,
'pay_type'
,
'pay_money'
,
'pay_time'
],
];
];
}
}
application/index/service/AmercementService.php
View file @
48d40704
...
@@ -43,22 +43,22 @@ class AmercementService
...
@@ -43,22 +43,22 @@ class AmercementService
public
function
getAmercementType
()
public
function
getAmercementType
()
{
{
return
[
return
[
[
'id'
=>
'1'
,
'name'
=>
'班主任早会监督'
],
[
'id'
=>
'1'
,
'name'
=>
'班主任早会监督'
],
[
'id'
=>
'2'
,
'name'
=>
'晚会表监督'
],
[
'id'
=>
'2'
,
'name'
=>
'晚会表监督'
],
[
'id'
=>
'3'
,
'name'
=>
'学习视频监督'
],
[
'id'
=>
'3'
,
'name'
=>
'学习视频监督'
],
[
'id'
=>
'4'
,
'name'
=>
'投诉'
],
[
'id'
=>
'4'
,
'name'
=>
'投诉'
],
[
'id'
=>
'5'
,
'name'
=>
'日报'
],
[
'id'
=>
'5'
,
'name'
=>
'日报'
],
[
'id'
=>
'6'
,
'name'
=>
'房源上架'
],
[
'id'
=>
'6'
,
'name'
=>
'房源上架'
],
[
'id'
=>
'7'
,
'name'
=>
'视频审核'
],
[
'id'
=>
'7'
,
'name'
=>
'视频审核'
],
[
'id'
=>
'8'
,
'name'
=>
'商学院评论'
],
[
'id'
=>
'8'
,
'name'
=>
'商学院评论'
],
[
'id'
=>
'9'
,
'name'
=>
'弟子班自律'
],
[
'id'
=>
'9'
,
'name'
=>
'弟子班自律'
],
[
'id'
=>
'10'
,
'name'
=>
'弟子班心得评论'
],
[
'id'
=>
'10'
,
'name'
=>
'弟子班心得评论'
],
[
'id'
=>
'11'
,
'name'
=>
'将帅赢心得评论'
],
[
'id'
=>
'11'
,
'name'
=>
'将帅赢心得评论'
],
[
'id'
=>
'12'
,
'name'
=>
'各项会议处罚机制'
],
[
'id'
=>
'12'
,
'name'
=>
'各项会议处罚机制'
],
[
'id'
=>
'13'
,
'name'
=>
'五星好评'
],
[
'id'
=>
'13'
,
'name'
=>
'五星好评'
],
[
'id'
=>
'14'
,
'name'
=>
'投诉暂扣'
],
[
'id'
=>
'14'
,
'name'
=>
'投诉暂扣'
],
[
'id'
=>
'15'
,
'name'
=>
'独家协议'
],
[
'id'
=>
'15'
,
'name'
=>
'独家协议'
],
[
'id'
=>
'16'
,
'name'
=>
'其他处罚'
],
[
'id'
=>
'16'
,
'name'
=>
'其他处罚'
],
];
];
}
}
...
@@ -136,6 +136,7 @@ class AmercementService
...
@@ -136,6 +136,7 @@ class AmercementService
}
}
return
$str
;
return
$str
;
}
}
/**
/**
* 新增
* 新增
*
*
...
@@ -143,7 +144,7 @@ class AmercementService
...
@@ -143,7 +144,7 @@ class AmercementService
* @param $submit_agent_id
* @param $submit_agent_id
* @return int|string
* @return int|string
*/
*/
public
function
addAmercement
(
$params
,
$submit_agent_id
)
public
function
addAmercement
(
$params
,
$submit_agent_id
)
{
{
$params_
[
'status'
]
=
0
;
//'状态 0待支付 1已支付 2已取消'
$params_
[
'status'
]
=
0
;
//'状态 0待支付 1已支付 2已取消'
$params_
[
'type'
]
=
$params
[
'type'
];
//'罚款类型
$params_
[
'type'
]
=
$params
[
'type'
];
//'罚款类型
...
@@ -164,15 +165,16 @@ class AmercementService
...
@@ -164,15 +165,16 @@ class AmercementService
* @param $father_id
* @param $father_id
* @return bool
* @return bool
*/
*/
public
function
addAmercementImg
(
$img_info
,
$father_id
){
public
function
addAmercementImg
(
$img_info
,
$father_id
)
if
(
!
$img_info
)
{
if
(
!
$img_info
)
return
false
;
return
false
;
$sublet_img
=
json_decode
(
$img_info
,
true
);
$sublet_img
=
json_decode
(
$img_info
,
true
);
if
(
!
$sublet_img
)
if
(
!
$sublet_img
)
return
false
;
return
false
;
foreach
(
$sublet_img
as
$k
=>
$v
)
{
foreach
(
$sublet_img
as
$k
=>
$v
)
{
$insert
=
[];
$insert
=
[];
$insert
[
"file_name"
]
=
$v
;
$insert
[
"file_name"
]
=
$v
;
$insert
[
"amercement_id"
]
=
$father_id
;
$insert
[
"amercement_id"
]
=
$father_id
;
$this
->
m_amercement_img
->
saveAmercementImg
(
$insert
);
$this
->
m_amercement_img
->
saveAmercementImg
(
$insert
);
...
@@ -190,18 +192,18 @@ class AmercementService
...
@@ -190,18 +192,18 @@ class AmercementService
* @param $page_size
* @param $page_size
* @return array|false|\PDOStatement|string|\think\Collection
* @return array|false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getAmercementList
(
$status
,
$amercement_type
,
$agent_id
,
$page_no
,
$page_size
)
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"
;
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty,money_sum"
;
$condition
=
[];
$condition
=
[];
if
(
$amercement_type
==
0
)
{
if
(
$amercement_type
==
0
)
{
$condition
[
'agent_id'
]
=
$agent_id
;
$condition
[
'agent_id'
]
=
$agent_id
;
}
else
{
}
else
{
$condition
[
'submit_agent_id'
]
=
$agent_id
;
$condition
[
'submit_agent_id'
]
=
$agent_id
;
}
}
$condition
[
'status'
]
=
$status
;
$condition
[
'status'
]
=
$status
;
$result
=
$this
->
m_amercement
->
getAmercementList
(
$condition
,
$field
,
$page_no
,
$page_size
);
$result
=
$this
->
m_amercement
->
getAmercementList
(
$condition
,
$field
,
$page_no
,
$page_size
);
if
(
!
$result
)
{
if
(
!
$result
)
{
return
[];
return
[];
}
}
...
@@ -215,14 +217,14 @@ class AmercementService
...
@@ -215,14 +217,14 @@ class AmercementService
$result
[
$key
][
'submit_agent_name'
]
=
$agent_data
[
'name'
];
$result
[
$key
][
'submit_agent_name'
]
=
$agent_data
[
'name'
];
$result
[
$key
][
'submit_agent_phone'
]
=
$agent_data
[
'phone'
];
$result
[
$key
][
'submit_agent_phone'
]
=
$agent_data
[
'phone'
];
if
(
$status
==
0
)
{
//待支付
if
(
$status
==
0
)
{
//待支付
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
//滞纳金
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
//滞纳金
$money_sum
=
$forfeit_penalty
+
$result
[
$key
][
'money'
];
$money_sum
=
$forfeit_penalty
+
$result
[
$key
][
'money'
];
$result
[
$key
][
'money_sum'
]
=
$money_sum
;
//罚款总金额
$result
[
$key
][
'money_sum'
]
=
$money_sum
;
//罚款总金额
$this
->
updateAmercement
(
$val
[
'id'
],
[
'money_sum'
=>
$money_sum
]);
$this
->
updateAmercement
(
$val
[
'id'
],
[
'money_sum'
=>
$money_sum
]);
}
}
$result
[
$key
][
'img'
]
=
$this
->
getAmercementImage
(
$val
[
'id'
]);
$result
[
$key
][
'img'
]
=
$this
->
getAmercementImage
(
$val
[
'id'
]);
}
}
...
@@ -238,15 +240,15 @@ class AmercementService
...
@@ -238,15 +240,15 @@ class AmercementService
* @param $money
* @param $money
* @return int|number
* @return int|number
*/
*/
public
function
updateForfeitPenalty
(
$id
,
$time
,
$now_time
,
$money
)
public
function
updateForfeitPenalty
(
$id
,
$time
,
$now_time
,
$money
)
{
{
$forfeit_penalty
=
0
;
$forfeit_penalty
=
0
;
$num
=
$this
->
diffBetweenTwoDays
(
$time
,
$now_time
);
$num
=
$this
->
diffBetweenTwoDays
(
$time
,
$now_time
);
if
((
$num
>
0
)
&&
(
$money
>
0
))
{
if
((
$num
>
0
)
&&
(
$money
>
0
))
{
$money_every_day
=
$money
*
0.2
;
$money_every_day
=
$money
*
0.2
;
$forfeit_penalty
=
$num
*
$money_every_day
;
$forfeit_penalty
=
$num
*
$money_every_day
;
}
}
$this
->
updateAmercement
(
$id
,
[
'forfeit_penalty'
=>
$forfeit_penalty
]);
$this
->
updateAmercement
(
$id
,
[
'forfeit_penalty'
=>
$forfeit_penalty
]);
return
$forfeit_penalty
;
return
$forfeit_penalty
;
}
}
...
@@ -270,14 +272,14 @@ class AmercementService
...
@@ -270,14 +272,14 @@ class AmercementService
public
function
getAmercementInfo
(
$id
)
public
function
getAmercementInfo
(
$id
)
{
{
$conditions
=
[];
$conditions
=
[];
$conditions
[
"id"
]
=
$id
;
$conditions
[
"id"
]
=
$id
;
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,
operation_id,operation_time,forfeit_penalty,money_sum"
;
operation_id,operation_time,forfeit_penalty,money_sum"
;
$result
=
$this
->
m_amercement
->
getAmercementInfo
(
$conditions
,
$field
);
$result
=
$this
->
m_amercement
->
getAmercementInfo
(
$conditions
,
$field
);
if
(
!
$result
)
{
if
(
!
$result
)
{
return
false
;
return
false
;
}
}
...
@@ -310,17 +312,17 @@ class AmercementService
...
@@ -310,17 +312,17 @@ class AmercementService
* @param $operation_id
* @param $operation_id
* @return array
* @return array
*/
*/
public
function
editAmercement
(
$id
,
$params
,
$edit_type
,
$operation_id
)
public
function
editAmercement
(
$id
,
$params
,
$edit_type
,
$operation_id
)
{
{
switch
(
$edit_type
)
{
switch
(
$edit_type
)
{
case
0
:
case
0
:
//0编辑
//0编辑
$this
->
updateAmercement
(
$id
,
$params
);
$this
->
updateAmercement
(
$id
,
$params
);
if
(
isset
(
$params
[
'img'
])
&&
!
empty
(
$params
[
'img'
]))
{
if
(
isset
(
$params
[
'img'
])
&&
!
empty
(
$params
[
'img'
]))
{
//处理图片
//处理图片
$result_img
=
$this
->
getAmercementImage
(
$id
);
$result_img
=
$this
->
getAmercementImage
(
$id
);
if
(
!
$result_img
)
{
if
(
!
$result_img
)
{
break
;
break
;
}
}
$list_img
=
[];
$list_img
=
[];
...
@@ -329,8 +331,8 @@ class AmercementService
...
@@ -329,8 +331,8 @@ class AmercementService
}
}
$params_img
=
json_decode
(
$params
[
'img'
],
true
);
$params_img
=
json_decode
(
$params
[
'img'
],
true
);
foreach
(
$params_img
as
$key
=>
$val
)
{
foreach
(
$params_img
as
$key
=>
$val
)
{
if
(
!
in_array
(
$val
,
$list_img
))
{
if
(
!
in_array
(
$val
,
$list_img
))
{
$insert
=
[];
$insert
=
[];
$insert
[
"file_name"
]
=
$val
;
$insert
[
"file_name"
]
=
$val
;
$insert
[
"amercement_id"
]
=
$id
;
$insert
[
"amercement_id"
]
=
$id
;
$this
->
m_amercement_img
->
saveAmercementImg
(
$insert
);
$this
->
m_amercement_img
->
saveAmercementImg
(
$insert
);
...
@@ -344,9 +346,9 @@ class AmercementService
...
@@ -344,9 +346,9 @@ class AmercementService
break
;
break
;
default
:
default
:
//2转已支付
//2转已支付
$this
->
consummationAmercement
(
$id
,
$operation_id
);
$this
->
consummationAmercement
(
$id
,
$operation_id
);
}
}
return
[
'code'
=>
200
,
'msg'
=>
'成功'
];
return
[
'code'
=>
200
,
'msg'
=>
'成功'
];
}
}
/**
/**
...
@@ -355,13 +357,13 @@ class AmercementService
...
@@ -355,13 +357,13 @@ class AmercementService
* @param $params
* @param $params
* @return bool money_sum
* @return bool money_sum
*/
*/
public
function
updateAmercement
(
$id
,
$params
)
public
function
updateAmercement
(
$id
,
$params
)
{
{
$data
=
[];
$data
=
[];
if
((
isset
(
$params
[
'money'
]))
&&
(
$params
[
'money'
]
>
0
))
if
((
isset
(
$params
[
'money'
]))
&&
(
$params
[
'money'
]
>
0
))
$data
[
'money'
]
=
$params
[
'money'
];
$data
[
'money'
]
=
$params
[
'money'
];
if
((
isset
(
$params
[
'type'
]))
&&
(
in_array
(
$params
[
'type'
],
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
])))
if
((
isset
(
$params
[
'type'
]))
&&
(
in_array
(
$params
[
'type'
],
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
])))
$data
[
'type'
]
=
$params
[
'type'
];
$data
[
'type'
]
=
$params
[
'type'
];
if
((
isset
(
$params
[
'remarks'
]))
&&
$params
[
'remarks'
])
if
((
isset
(
$params
[
'remarks'
]))
&&
$params
[
'remarks'
])
...
@@ -403,7 +405,7 @@ class AmercementService
...
@@ -403,7 +405,7 @@ class AmercementService
* @param $operation_id
* @param $operation_id
* @return bool
* @return bool
*/
*/
public
function
consummationAmercement
(
$id
,
$operation_id
)
public
function
consummationAmercement
(
$id
,
$operation_id
)
{
{
$data
=
[];
$data
=
[];
$data
[
'id'
]
=
$id
;
$data
[
'id'
]
=
$id
;
...
@@ -421,7 +423,7 @@ class AmercementService
...
@@ -421,7 +423,7 @@ class AmercementService
* @param $page_size
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getAmercementListPc
(
$params
,
$page_no
,
$page_size
)
public
function
getAmercementListPc
(
$params
,
$page_no
,
$page_size
)
{
{
$conditions
=
$this
->
buildConditions
(
$params
);
$conditions
=
$this
->
buildConditions
(
$params
);
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty,money_sum"
;
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty,money_sum"
;
...
@@ -429,14 +431,14 @@ class AmercementService
...
@@ -429,14 +431,14 @@ class AmercementService
$redis_cache
=
new
RedisCacheService
();
$redis_cache
=
new
RedisCacheService
();
foreach
(
$result
as
$key
=>
$val
)
{
foreach
(
$result
as
$key
=>
$val
)
{
if
(
$val
[
'status'
]
==
0
)
{
if
(
$val
[
'status'
]
==
0
)
{
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
$money_sum
=
$forfeit_penalty
+
$val
[
'money'
];
$money_sum
=
$forfeit_penalty
+
$val
[
'money'
];
$result
[
$key
][
'money_sum'
]
=
$money_sum
;
//罚款总金额
$result
[
$key
][
'money_sum'
]
=
$money_sum
;
//罚款总金额
$this
->
updateAmercement
(
$val
[
'id'
],
[
'money_sum'
=>
$money_sum
]);
$this
->
updateAmercement
(
$val
[
'id'
],
[
'money_sum'
=>
$money_sum
]);
}
}
$result
[
$key
][
'type_name'
]
=
$this
->
getTypeName
(
$val
[
'type'
]);
$result
[
$key
][
'type_name'
]
=
$this
->
getTypeName
(
$val
[
'type'
]);
$result
[
$key
][
'status_name'
]
=
$this
->
getStatusName
(
$val
[
'status'
]);
$result
[
$key
][
'status_name'
]
=
$this
->
getStatusName
(
$val
[
'status'
]);
...
@@ -462,15 +464,15 @@ class AmercementService
...
@@ -462,15 +464,15 @@ class AmercementService
*/
*/
public
function
getAmercementListExcel
(
$params
)
public
function
getAmercementListExcel
(
$params
)
{
{
$conditions
=
$this
->
buildConditions
(
$params
);
$conditions
=
$this
->
buildConditions
(
$params
);
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty"
;
$field
=
"id,status,type,money,submit_agent_id,agent_id,remarks,create_time,forfeit_penalty"
;
$result
=
$this
->
m_amercement
->
getAmercementListExcel
(
$conditions
,
$field
);
$result
=
$this
->
m_amercement
->
getAmercementListExcel
(
$conditions
,
$field
);
$redis_cache
=
new
RedisCacheService
();
$redis_cache
=
new
RedisCacheService
();
foreach
(
$result
as
$key
=>
$val
)
{
foreach
(
$result
as
$key
=>
$val
)
{
if
(
$val
[
'status'
]
==
0
)
{
if
(
$val
[
'status'
]
==
0
)
{
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$now_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
$forfeit_penalty
=
$this
->
updateForfeitPenalty
(
$val
[
'id'
],
$val
[
'create_time'
],
$now_time
,
$val
[
'money'
]);
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
$result
[
$key
][
'forfeit_penalty'
]
=
$forfeit_penalty
;
}
}
$result
[
$key
][
'type_name'
]
=
$this
->
getTypeName
(
$val
[
'type'
]);
$result
[
$key
][
'type_name'
]
=
$this
->
getTypeName
(
$val
[
'type'
]);
...
@@ -499,7 +501,7 @@ class AmercementService
...
@@ -499,7 +501,7 @@ class AmercementService
}
}
$field_num
=
9
;
$field_num
=
9
;
$title
=
[
'罚款ID'
,
'罚款项目'
,
'提交时间'
,
'提交人'
,
'罚款金额'
,
'被罚款人'
,
'状态'
,
'滞纳金'
,
'付款金额'
];
$title
=
[
'罚款ID'
,
'罚款项目'
,
'提交时间'
,
'提交人'
,
'罚款金额'
,
'被罚款人'
,
'状态'
,
'滞纳金'
,
'付款金额'
];
$title2
=
'罚款账单表'
;
$title2
=
'罚款账单表'
;
$export
->
exportTable
(
'罚款账单表'
,
$e_data_new
,
$field_num
,
$title2
,
$title
);
$export
->
exportTable
(
'罚款账单表'
,
$e_data_new
,
$field_num
,
$title2
,
$title
);
...
@@ -507,9 +509,6 @@ class AmercementService
...
@@ -507,9 +509,6 @@ class AmercementService
}
}
/**
/**
* 构建搜索条件
* 构建搜索条件
* @param $params
* @param $params
...
@@ -534,7 +533,7 @@ class AmercementService
...
@@ -534,7 +533,7 @@ class AmercementService
}
}
//罚款ID
//罚款ID
if
(
isset
(
$params
[
'id'
])
&&
is_numeric
(
$params
[
"id"
]))
{
if
(
isset
(
$params
[
'id'
])
&&
is_numeric
(
$params
[
"id"
]))
{
$conditions
[
"id"
]
=
$params
[
"id"
];
$conditions
[
"id"
]
=
$params
[
"id"
];
}
}
...
@@ -553,7 +552,6 @@ class AmercementService
...
@@ -553,7 +552,6 @@ class AmercementService
}
}
/**
/**
* 求两个日期之间相差的天数
* 求两个日期之间相差的天数
* (针对1970年1月1日之后,求之前可以采用泰勒公式)
* (针对1970年1月1日之后,求之前可以采用泰勒公式)
...
@@ -561,7 +559,7 @@ class AmercementService
...
@@ -561,7 +559,7 @@ class AmercementService
* @param string $day2
* @param string $day2
* @return number
* @return number
*/
*/
function
diffBetweenTwoDays
(
$day1
,
$day2
)
function
diffBetweenTwoDays
(
$day1
,
$day2
)
{
{
$second1
=
strtotime
(
$day1
);
$second1
=
strtotime
(
$day1
);
$second2
=
strtotime
(
$day2
);
$second2
=
strtotime
(
$day2
);
...
@@ -584,7 +582,7 @@ class AmercementService
...
@@ -584,7 +582,7 @@ class AmercementService
{
{
//查询总监下面门店的所有经纪人
//查询总监下面门店的所有经纪人
$params
=
[];
$params
=
[];
$params
[
'name'
]
=
[
'LIKE'
,
'%'
.
$name
.
'%'
];
$params
[
'name'
]
=
[
'LIKE'
,
'%'
.
$name
.
'%'
];
$m_agent
=
new
AAgents
();
$m_agent
=
new
AAgents
();
$field
=
'id'
;
$field
=
'id'
;
$res
=
$m_agent
->
getStoreIdByAgentId
(
$field
,
$params
);
$res
=
$m_agent
->
getStoreIdByAgentId
(
$field
,
$params
);
...
@@ -606,12 +604,27 @@ class AmercementService
...
@@ -606,12 +604,27 @@ class AmercementService
* @param $id
* @param $id
* @return int|string
* @return int|string
*/
*/
public
function
delAmercementImage
(
$id
){
public
function
delAmercementImage
(
$id
)
{
$params_
[
'status'
]
=
1
;
$params_
[
'status'
]
=
1
;
$res
=
$this
->
m_amercement_img
->
updateImage
(
$id
,
$params_
);
//int(1)
$res
=
$this
->
m_amercement_img
->
updateImage
(
$id
,
$params_
);
//int(1)
return
$res
;
return
$res
;
}
}
public
function
savePayAmercement
(
$amercement_id
,
$trade_no
,
$pay_type
,
$status
,
$remark
,
$pay_money
,
$pay_time
)
{
//todo 判断是否有支付过
$arr
[
"amercement_id"
]
=
$amercement_id
;
$arr
[
"trade_no"
]
=
$trade_no
;
$arr
[
"pay_type"
]
=
$pay_type
;
$arr
[
"status"
]
=
$status
;
$arr
[
"remark"
]
=
$remark
;
$arr
[
"pay_money"
]
=
$pay_money
;
$arr
[
"pay_time"
]
=
$pay_time
;
}
}
}
\ No newline at end of file
application/route.php
View file @
48d40704
...
@@ -815,6 +815,8 @@ Route::group('task', [
...
@@ -815,6 +815,8 @@ Route::group('task', [
'delAgentUserLog'
=>
[
'task/AgentLookUserTask/delAgentUserLog'
,
[
'method'
=>
'get'
]],
//清理经纪人看客户记录
'delAgentUserLog'
=>
[
'task/AgentLookUserTask/delAgentUserLog'
,
[
'method'
=>
'get'
]],
//清理经纪人看客户记录
'selectDailyUncommitted'
=>
[
'task/DailyUncommittedTask/selectDailyUncommitted'
,
[
'method'
=>
'get'
]],
//未提交财务日报的门店
'selectDailyUncommitted'
=>
[
'task/DailyUncommittedTask/selectDailyUncommitted'
,
[
'method'
=>
'get'
]],
//未提交财务日报的门店
'saveLookUser'
=>
[
'task/SaveLookUserHistoryTask/saveLookUser'
,
[
'method'
=>
'get'
]],
//保存经纪人看客户的记录
]);
]);
Route
::
group
(
'broker'
,
[
Route
::
group
(
'broker'
,
[
...
...
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