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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
28 deletions
+94
-28
Amercement.php
application/api_broker/controller/Amercement.php
+58
-19
AmercementValidate.php
application/api_broker/validate/AmercementValidate.php
+34
-9
AmercementService.php
application/index/service/AmercementService.php
+0
-0
route.php
application/route.php
+2
-0
No files found.
application/api_broker/controller/Amercement.php
View file @
48d40704
<?php
namespace
app\api_broker\controller
;
/**
* Created by PhpStorm.
...
...
@@ -17,6 +18,7 @@ use think\Request;
class
Amercement
extends
Basic
{
protected
$s_amercement
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
...
...
@@ -28,27 +30,28 @@ class Amercement extends Basic
* @return \think\Response
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=918
*/
public
function
addAmercement
(){
public
function
addAmercement
()
{
$params
=
$this
->
params
;
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
$checkResult
=
$this
->
validate
(
$params
,
"AmercementValidate.addAmercement"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$vip
=
new
VipService
();
//0:有权限 1:无权限
$vip
=
new
VipService
();
//0:有权限 1:无权限
$is_can_edit
=
$vip
->
checkRule
(
$this
->
agentId
,
'addAmercement'
);
if
(
$is_can_edit
==
1
)
{
if
(
$is_can_edit
==
1
)
{
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
(
isset
(
$params
[
'img'
])
&&
!
empty
(
$params
[
'img'
]))
{
$this
->
s_amercement
->
addAmercementImg
(
$params
[
'img'
],
$father_id
);
...
...
@@ -64,9 +67,10 @@ class Amercement extends Basic
* 获取类型
* @return \think\Response
*/
public
function
getAmercementType
(){
public
function
getAmercementType
()
{
$res
=
$this
->
s_amercement
->
getAmercementType
();
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
}
...
...
@@ -74,7 +78,8 @@ class Amercement extends Basic
* 罚款账单
* @return \think\Response
*/
public
function
getAmercementList
(){
public
function
getAmercementList
()
{
$params
=
$this
->
params
;
// $params = array(
...
...
@@ -87,14 +92,48 @@ class Amercement extends Basic
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"
];
$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)
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
$result
=
$this
->
s_amercement
->
getAmercementList
(
$status
,
$amercement_type
,
$params
[
'agent_id'
],
$page_no
,
$page_size
);
//int(1)
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
namespace
app\api_broker\validate
;
use
think\Validate
;
/**
...
...
@@ -8,15 +10,22 @@ use think\Validate;
* Date: 2019-09-02
* Time: 16:27:00
*/
class
AmercementValidate
extends
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'
,
'status'
=>
'require|number|in:0,1,2'
,
'amercement_type'
=>
'require|number|in:0,1'
,
'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'
,
'status'
=>
'require|number|in:0,1,2'
,
'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{
'amercement_type.number'
=>
'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
=
[
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
],
'getAmercementList'
=>
[
'agent_id'
,
'status'
,
'amercement_type'
],
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
],
'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
This diff is collapsed.
Click to expand it.
application/route.php
View file @
48d40704
...
...
@@ -815,6 +815,8 @@ Route::group('task', [
'delAgentUserLog'
=>
[
'task/AgentLookUserTask/delAgentUserLog'
,
[
'method'
=>
'get'
]],
//清理经纪人看客户记录
'selectDailyUncommitted'
=>
[
'task/DailyUncommittedTask/selectDailyUncommitted'
,
[
'method'
=>
'get'
]],
//未提交财务日报的门店
'saveLookUser'
=>
[
'task/SaveLookUserHistoryTask/saveLookUser'
,
[
'method'
=>
'get'
]],
//保存经纪人看客户的记录
]);
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