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
b4845bec
Commit
b4845bec
authored
Jul 19, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
830a49f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
44 deletions
+53
-44
StoreFee.php
application/api_broker/controller/StoreFee.php
+28
-31
StoreFeeValidate.php
application/api_broker/validate/StoreFeeValidate.php
+25
-13
No files found.
application/api_broker/controller/StoreFee.php
View file @
b4845bec
...
...
@@ -46,34 +46,31 @@ class StoreFee extends Basic
*/
public
function
report
()
{
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'report_agent_id'
])
||
!
isset
(
$params
[
'report_agent_phone'
])
||
!
isset
(
$params
[
'report_store_id'
])
||
!
isset
(
$params
[
'user_id'
])
||
!
isset
(
$params
[
'house_ids'
])
||
!
isset
(
$params
[
'vehicle'
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
$params
=
$this
->
params
;
$params
=
array
(
'type'
=>
1
,
'fee_item'
=>
100
,
'total_fee'
=>
123.43
,
'agent_id'
=>
11
,
'store_id'
=>
12
,
'assume_fee'
=>
111
,
'site_id'
=>
10001
,
);
$checkResult
=
$this
->
validate
(
$params
,
"StoreFeeValidate.addApplyFor"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
/* $params = array(
"report_agent_id" => 1,//报备经纪人id
"report_agent_phone" => '13817616471',//报备经纪人id
"report_store_id" => 1,//门店id
"user_id" => 1,//用户id
"house_ids" => "1,2,3",//楼盘id
"vehicle" => 10,//交通工具
"intro" => "123123123",//备注
"predict_see_time" => time(),//预计到看时间
);*/
$agent_id
=
$params
[
"report_agent_id"
];
$agent_phone
=
$params
[
"report_agent_phone"
];
$store_id
=
$params
[
"report_store_id"
];
$user_id
=
$params
[
"user_id"
];
$house_ids
=
$params
[
"house_ids"
];
$vehicle
=
$params
[
"vehicle"
];
$intro
=
$params
[
"intro"
];
$predict_see_time
=
$params
[
"predict_see_time"
];
$type
=
$params
[
"type"
];
$fee_item
=
$params
[
"fee_item"
];
$total_fee
=
$params
[
"total_fee"
];
$agent_id
=
$params
[
"agent_id"
];
$store_id
=
$params
[
"store_id"
];
$assume_fee
=
$params
[
"vehicle"
];
$site_id
=
$params
[
"assume_fee"
];
$predict_see_time
=
$params
[
"site_id"
];
//todo 验证用户id是否正常
$userArr
=
$this
->
service_
->
verifyUser
(
$user_id
);
/*
$userArr = $this->service_->verifyUser($user_id);
if (!$userArr) {
return $this->response("101", "不存在此用户");
}
...
...
@@ -82,7 +79,7 @@ class StoreFee extends Basic
if ($is_ok > 0) {
$this->userService->setUserSites($user_id, $this->siteId);//设置用户站点 朱伟 2018-10-22
/*记录推送*/
$push = new PushMessageService();
$house_ids_arr = explode(',', $house_ids);
...
...
@@ -91,11 +88,11 @@ class StoreFee extends Basic
$push->pushReportMessage($v, $agent_id, 1, $this->agentId, $user_id); //推送报备信息
}
}
/*记录推送*/
return $this->response("200", "request success", []);
} else {
return $this->response("101", "save exception");
}
}
*/
}
...
...
@@ -120,7 +117,7 @@ class StoreFee extends Basic
"page_size"=>15
);*/
$checkResult
=
$this
->
validate
(
$params
,
"
PerformanceValidate.verifyCollectionList
"
);
$checkResult
=
$this
->
validate
(
$params
,
"
StoreFeeValidate.addApplyFor
"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
...
...
@@ -133,8 +130,8 @@ class StoreFee extends Basic
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$result
=
[];
$agentModel
=
new
AAgents
();
$agents_data
=
$agentModel
->
getAgentInfo
(
'id,level'
,
$this
->
agentId
);
$agentModel
=
new
AAgents
();
$agents_data
=
$agentModel
->
getAgentInfo
(
'id,level'
,
$this
->
agentId
);
if
(
isset
(
$params
[
"is_all"
])
&&
$params
[
"is_all"
]
==
1
)
{
$check_type
=
1
;
if
(
$agents_data
[
"level"
]
<
30
)
{
...
...
application/api_broker/validate/StoreFeeValidate.php
View file @
b4845bec
...
...
@@ -11,26 +11,37 @@ use think\Validate;
* Time : 14:51
* Intro:
*/
class
Bargain
Validate
extends
Validate
class
StoreFee
Validate
extends
Validate
{
protected
$rule
=
[
'submit_agent_id'
=>
'require|number'
,
'status'
=>
'require|number|in:0,1,2,3,4,5'
,
'is_my_correlation'
=>
'require|number|in:0,1'
,
'type'
=>
'require|number'
,
'fee_item'
=>
'require|number'
,
'total_fee'
=>
'require|number'
,
'agent_id'
=>
'require|number'
,
'store_id'
=>
'require|number'
,
'assume_fee'
=>
'require|number'
,
'site_id'
=>
'require|number'
,
];
protected
$message
=
[
'submit_agent_id.require'
=>
'经纪人为必填字段'
,
'submit_agent_id.number'
=>
'经纪人id只能为数字'
,
'status.require'
=>
'状态参数不能为空'
,
'status.number'
=>
'状态参数只能为数字'
,
'status.in'
=>
'状态错误'
,
'is_my_correlation.require'
=>
'与我相关不能为空'
,
'is_my_correlation.number'
=>
'与我相关只能是数字'
,
'is_my_correlation.in'
=>
'与我相关错误'
,
'type.require'
=>
'报销类型为必填字段'
,
'type.number'
=>
'报销类型只能为数字'
,
'fee_item.require'
=>
'费用项目不能为空'
,
'fee_item.number'
=>
'费用项目只能为数字'
,
'total_fee.require'
=>
'费用总金额不能为空'
,
'total_fee.number'
=>
'费用总金额只能为数字'
,
'agent_id.require'
=>
'申请人不能为空'
,
'agent_id.number'
=>
'申请人只能为数字'
,
'store_id.require'
=>
'门店不能为空'
,
'store_id.number'
=>
'状门店只能为数字'
,
'assume_fee.require'
=>
'费用承担金额不能为空'
,
'assume_fee.number'
=>
'费用承担金额只能为数字'
,
'site_id.require'
=>
'站点不能为空'
,
'site_id.number'
=>
'站点只能为数字'
,
];
protected
$scene
=
[
'
bargainList'
=>
[
'submit_agent_id'
,
'status'
,
'is_my_correlation'
],
'
addApplyFor'
=>
[
'type'
,
'fee_item'
,
'total_fee'
,
'agent_id'
,
'store_id'
,
'assume_fee'
,
'site_id'
],
];
}
\ No newline at end of file
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