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
b040ed78
Commit
b040ed78
authored
Mar 13, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日报周报
parent
f3d54268
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
3 deletions
+153
-3
MyCenter.php
application/api_broker/controller/MyCenter.php
+50
-0
OrderLog.php
application/api_broker/controller/OrderLog.php
+25
-0
MyCenterService.php
application/api_broker/service/MyCenterService.php
+60
-0
OrderLogService.php
application/api_broker/service/OrderLogService.php
+15
-3
route.php
application/route.php
+3
-0
No files found.
application/api_broker/controller/MyCenter.php
0 → 100644
View file @
b040ed78
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\MyCenterService
;
use
think\Exception
;
use
think\Request
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/12
* Time : 下午1:34
* Intro:
*/
class
MyCenter
extends
Basic
{
private
$service_
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
MyCenterService
();
}
/**
* 我得个人中心
* @return \think\Response
*/
public
function
center
(){
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 1
);*/
if
(
!
isset
(
$params
[
"agent_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
try
{
$result
=
$this
->
service_
->
center
(
$params
[
"agent_id"
]);
if
(
$result
){
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
catch
(
Exception
$exception
){
return
$this
->
response
(
"101"
,
"request error, msg:"
.
$exception
);
}
}
}
application/api_broker/controller/OrderLog.php
View file @
b040ed78
...
@@ -351,4 +351,28 @@ class OrderLog extends Basic
...
@@ -351,4 +351,28 @@ class OrderLog extends Basic
}
}
public
function
searchAgents
(){
$params
=
$this
->
params
;
$params
=
array
(
"keyword"
=>
"138"
);
if
(
!
isset
(
$params
[
"keyword"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
try
{
$result
=
$this
->
service_
->
searchAgents
(
$params
[
"keyword"
]);
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
catch
(
Exception
$e
)
{
return
$this
->
response
(
"101"
,
"request error,msg:"
.
$e
);
}
}
}
}
\ No newline at end of file
application/api_broker/service/MyCenterService.php
0 → 100644
View file @
b040ed78
<?php
namespace
app\api_broker\service
;
use
app\model\AAgents
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/12
* Time : 下午1:47
* Intro:
*/
class
MyCenterService
{
private
$agentModel
;
const
USER_LEVEL_FIST
=
"【业务员】"
;
//经纪人
const
USER_LEVEL_SECOND
=
"【店长】"
;
//店长
const
USER_LEVEL_THIRD
=
"【总监】"
;
//总监
function
__construct
()
{
$this
->
agentModel
=
new
AAgents
();
}
/**
* 我得个人中心
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public
function
center
(
$agent_id
){
$field
=
"a.id,a.store_id,a.auth_group_id,a.district_id,a.level,a.name,a.phone,a.sex,a.img,a.status,b.store_name,
c.district_name"
;
$params
[
"agent_id"
]
=
$agent_id
;
$result
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
$params
);
if
(
count
(
$result
)
<=
0
){
return
null
;
}
$result
=
$result
[
0
];
$result
[
"name"
]
=
self
::
USER_LEVEL_FIST
;
if
(
$result
[
"level"
]
==
20
){
$result
[
"name"
]
=
self
::
USER_LEVEL_SECOND
;
}
elseif
(
$result
[
"level"
]
==
30
||
$result
[
"level"
]
==
40
){
$result
[
"name"
]
=
self
::
USER_LEVEL_THIRD
;
}
$result
[
"sign"
]
=
$result
[
"district_name"
]
.
$result
[
"store_name"
];
if
(
!
empty
(
$result
[
"img"
])){
$result
[
"img"
]
=
HEADERIMGURL
.
$result
[
"img"
];
}
//todo 需要计算暂时没做。
$result
[
"money_total"
]
=
1000
;
return
$result
;
}
}
\ No newline at end of file
application/api_broker/service/OrderLogService.php
View file @
b040ed78
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\api_broker\service
;
namespace
app\api_broker\service
;
use
app\model\AAgents
;
use
app\model\FollowUpLogModel
;
use
app\model\FollowUpLogModel
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OMarchInModel
;
...
@@ -155,7 +156,7 @@ class OrderLogService
...
@@ -155,7 +156,7 @@ class OrderLogService
c.user_pic,c.sex"
;
c.user_pic,c.sex"
;
$result
=
$orderModel
->
selectOrderDetail
(
$field
,
$where_
);
$result
=
$orderModel
->
selectOrderDetail
(
$field
,
$where_
);
foreach
(
$result
as
$k
=>
$v
){
foreach
(
$result
as
$k
=>
$v
){
$result
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
//
$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$result
[
$k
][
"user_pic"
]
=
HEADERIMGURL
.
$v
[
"user_pic"
];
$result
[
$k
][
"user_pic"
]
=
HEADERIMGURL
.
$v
[
"user_pic"
];
}
}
return
$result
;
return
$result
;
...
@@ -319,7 +320,7 @@ class OrderLogService
...
@@ -319,7 +320,7 @@ class OrderLogService
return
null
;
return
null
;
}
else
{
}
else
{
foreach
(
$result
as
$k
=>
$v
){
foreach
(
$result
as
$k
=>
$v
){
$result
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
//
$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$ids_str
.=
$v
[
"id"
]
.
","
;
$ids_str
.=
$v
[
"id"
]
.
","
;
}
}
$ids_str
=
rtrim
(
$ids_str
,
","
);
$ids_str
=
rtrim
(
$ids_str
,
","
);
...
@@ -353,7 +354,7 @@ class OrderLogService
...
@@ -353,7 +354,7 @@ class OrderLogService
$filed
=
"a.id,a.create_time,b.user_phone,b.user_name,b.user_id,d.id as house_id,d.internal_title,d.internal_address"
;
$filed
=
"a.id,a.create_time,b.user_phone,b.user_name,b.user_id,d.id as house_id,d.internal_title,d.internal_address"
;
$result
=
$bargainModel
->
selectBargainList
(
$filed
,
$params
,
$pageNo
,
$pageSize
);
$result
=
$bargainModel
->
selectBargainList
(
$filed
,
$params
,
$pageNo
,
$pageSize
);
foreach
(
$result
as
$k
=>
$v
){
foreach
(
$result
as
$k
=>
$v
){
$result
[
$k
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$v
[
"user_phone"
]);
//
$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$result
[
$k
][
"create_time"
]
=
date
(
"Y-m-d"
,
strtotime
(
$v
[
"create_time"
]));
$result
[
$k
][
"create_time"
]
=
date
(
"Y-m-d"
,
strtotime
(
$v
[
"create_time"
]));
}
}
return
$result
;
return
$result
;
...
@@ -370,5 +371,15 @@ class OrderLogService
...
@@ -370,5 +371,15 @@ class OrderLogService
}
}
public
function
searchAgents
(
$keyWord
){
$params
[
"phone|name"
]
=
array
(
"like"
,
"%
$keyWord
%"
);
$field
=
"id,store_id,auth_group_id,district_id,level,name,phone"
;
$agentModel
=
new
AAgents
();
return
$agentModel
->
searchAgentsByKeyword
(
$field
,
$params
);
}
}
}
\ No newline at end of file
application/route.php
View file @
b040ed78
...
@@ -303,6 +303,9 @@ Route::group('broker', [
...
@@ -303,6 +303,9 @@ Route::group('broker', [
'dayStatement'
=>
[
'api_broker/Statement/dayStatement'
,
[
'method'
=>
'get|post'
]
],
'dayStatement'
=>
[
'api_broker/Statement/dayStatement'
,
[
'method'
=>
'get|post'
]
],
'center'
=>
[
'api_broker/MyCenter/center'
,
[
'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