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
40890ffb
Commit
40890ffb
authored
Jun 27, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记录客户拨打经纪人次数
parent
f275a0ab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
36 deletions
+94
-36
Broker.php
application/api/controller/Broker.php
+51
-25
AAgents.php
application/model/AAgents.php
+42
-11
route.php
application/route.php
+1
-0
No files found.
application/api/controller/Broker.php
View file @
40890ffb
<?php
namespace
app\api\controller
;
use
app\api\extend\Basic
;
use
app\api_broker\service\PushMessageService
;
use
app\model\AAgents
;
use
app\model\Agents
;
use
app\model\Evaluate
;
use
app\model\EvaluateSign
;
use
app\model\OBargainModel
;
use
app\model\Remarks
;
/**
* Description of Agents
...
...
@@ -18,7 +16,8 @@ use app\model\Remarks;
* @time :11:15:05
* Intro :
*/
class
Broker
extends
Basic
{
class
Broker
extends
Basic
{
/**
* 咨询经纪人
...
...
@@ -28,7 +27,8 @@ class Broker extends Basic{
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
index
()
{
public
function
index
()
{
$params
=
$this
->
params
;
$data
[
'status'
]
=
101
;
$data
[
'data'
]
=
[];
...
...
@@ -45,7 +45,7 @@ class Broker extends Basic{
$agent_client
=
0
;
if
(
!
empty
(
$this
->
userId
)
&&
(
$this
->
params
[
'source'
]
!=
'B-APP'
))
{
$agent_client
=
$agents
->
getAgentClient
(
$fields
,
[
'c.id'
=>
$this
->
userId
]);
$agent_client
=
$agents
->
getAgentClient
(
$fields
,
[
'c.id'
=>
$this
->
userId
]);
}
$where
[
'c.houses_id'
]
=
$params
[
'house_id'
];
...
...
@@ -57,10 +57,10 @@ class Broker extends Basic{
}
if
(
!
empty
(
$list
))
{
foreach
(
$list
as
$k
=>
$v
)
{
$v
[
'head_portrait'
]
=
AGENTHEADERIMGURL
.
$v
[
'img'
];
foreach
(
$list
as
$k
=>
$v
)
{
$v
[
'head_portrait'
]
=
AGENTHEADERIMGURL
.
$v
[
'img'
];
if
(
$list
[
$k
][
'evaluate_grade'
])
{
$evaluate_grade
=
floor
((
$list
[
$k
][
'evaluate_grade'
]
/
2
)
/
$list
[
$k
][
'evaluate'
]);
$evaluate_grade
=
floor
((
$list
[
$k
][
'evaluate_grade'
]
/
2
)
/
$list
[
$k
][
'evaluate'
]);
}
else
{
$evaluate_grade
=
0
;
}
...
...
@@ -77,7 +77,7 @@ class Broker extends Basic{
$data
[
'msg'
]
=
'house_id 为空'
;
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
...
...
@@ -86,10 +86,11 @@ class Broker extends Basic{
* @return \think\Response
* @throws \Exception
*/
public
function
appraiser
()
{
public
function
appraiser
()
{
$params
=
$this
->
params
;
$data
[
'status'
]
=
101
;
$data
[
'data'
]
=
array
()
;
$data
[
'data'
]
=
[]
;
$data
[
'msg'
]
=
''
;
if
(
empty
(
$params
[
'agents_id'
]))
{
...
...
@@ -108,7 +109,7 @@ class Broker extends Basic{
}
$date
=
date
(
'Y-m-d H:i:s'
);
$id_arr
=
array
()
;
$id_arr
=
[]
;
if
(
isset
(
$params
[
'sign_name'
]))
{
$evaluate_sign
=
new
EvaluateSign
();
foreach
(
$params
[
'sign_name'
]
as
$v
)
{
...
...
@@ -142,7 +143,7 @@ class Broker extends Basic{
]);
if
(
$evaluate
->
id
)
{
$data
[
'data'
]
=
[
'id'
=>
$evaluate
->
id
];
$data
[
'data'
]
=
[
'id'
=>
$evaluate
->
id
];
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
'评价成功'
;
}
else
{
...
...
@@ -160,10 +161,11 @@ class Broker extends Basic{
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
commentAndDeal
()
{
public
function
commentAndDeal
()
{
$params
=
$this
->
params
;
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
array
()
;
$data
[
'data'
]
=
[]
;
$data
[
'msg'
]
=
''
;
if
(
$params
[
'agent_id'
])
{
...
...
@@ -183,7 +185,7 @@ class Broker extends Basic{
//评价列表信息
$result
[
'evaluate'
]
=
$evaluate
->
getEvaluate
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields_evaluate
,
''
,
$params
[
'agent_id'
]);
//成交记录
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainOrderList
(
$pageNo
,
$pageSize
,
''
,
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]
]);
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainOrderList
(
$pageNo
,
$pageSize
,
''
,
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]
]);
$data
[
'data'
]
=
$result
;
break
;
case
1
:
...
...
@@ -193,7 +195,7 @@ class Broker extends Basic{
break
;
case
2
:
//成交记录
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainOrderList
(
$pageNo
,
$pageSize
,
''
,
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]
]);
$result
[
'journalAccounts'
]
=
$bargain
->
getBargainOrderList
(
$pageNo
,
$pageSize
,
''
,
$bargain_fields
,
[
'a.agent_id'
=>
$this
->
params
[
'agent_id'
]
]);
$data
[
'data'
]
=
$result
;
break
;
default
:
...
...
@@ -216,10 +218,11 @@ class Broker extends Basic{
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
brokerDetail
()
{
public
function
brokerDetail
()
{
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
array
()
;
$data
[
'data'
]
=
[]
;
$data
[
'msg'
]
=
''
;
if
(
$this
->
params
[
'agent_id'
])
{
...
...
@@ -233,10 +236,33 @@ class Broker extends Basic{
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
public
function
testtest
()
{
$push
=
new
PushMessageService
();
// $push->pushReportMessage(2362,3670,1);
// $push->pushMarchInMessage(26964);
$push
->
pushBargainMessage
(
26989
);
/**
* 记录客户拨打经纪人次数
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
recordCallNum
()
{
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
[];
$data
[
'msg'
]
=
''
;
if
(
$this
->
params
[
'agent_id'
]
>
0
)
{
$m_agents
=
new
AAgents
();
$agents_data
=
$m_agents
->
getAgentInfo
(
'id,update_time,call_number'
,
$this
->
params
[
'agent_id'
]);
$insert_data
[
'update_time'
]
=
$agents_data
[
'update_time'
];
$insert_data
[
'call_number'
]
=
$agents_data
[
'call_number'
]
+
1
;
$data
[
'data'
]
=
$m_agents
->
editData
(
$insert_data
,
$agents_data
[
'id'
]);
}
else
{
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
'agent_id is null'
;
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
application/model/AAgents.php
View file @
40890ffb
...
...
@@ -312,11 +312,6 @@ class AAgents extends BaseModel
return
$this
->
save
([
'password'
=>
md5
(
$pwd
)
],
[
'id'
=>
$id
]);
}
public
function
saveList
()
{
}
/**
* 分页列表
* @param int $p
...
...
@@ -343,13 +338,16 @@ class AAgents extends BaseModel
return
$data
;
}
/**
* 统计任务获取经纪人列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsListByTask
(
$pageNo
=
1
,
$pageSize
=
15
,
$field
=
"id"
)
{
...
...
@@ -358,7 +356,6 @@ class AAgents extends BaseModel
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
...
...
@@ -373,8 +370,12 @@ class AAgents extends BaseModel
/**
* 批量获取经纪人
*
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsByStoreId
(
$params
)
{
...
...
@@ -386,7 +387,13 @@ class AAgents extends BaseModel
return
$result
;
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
countAgentNum
(
$params
)
{
$where_
=
$whereOr_
=
[];
...
...
@@ -413,7 +420,14 @@ class AAgents extends BaseModel
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsInfoByAgentId
(
$field
,
$params
)
{
$where_
=
[];
...
...
@@ -444,6 +458,13 @@ class AAgents extends BaseModel
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreOrDistrict
(
$params
){
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
"id,name,img"
)
...
...
@@ -453,6 +474,14 @@ class AAgents extends BaseModel
return
$result
;
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
searchAgentsByKeyword
(
$field
,
$params
)
{
...
...
@@ -508,13 +537,15 @@ class AAgents extends BaseModel
->
value
(
'id'
);
}
/**
* 根据id检查是否有权限
*
* @param $agents_id
* @param $rule
* @return mixed
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentsAuthIds
(
$agents_id
,
$rule
)
{
...
...
application/route.php
View file @
40890ffb
...
...
@@ -264,6 +264,7 @@ Route::group('api', [
'brokerDetail'
=>
[
'api/broker/brokerDetail'
,
[
'method'
=>
'get'
]
],
//经纪人详情
//post broker
'appraiser'
=>
[
'api/broker/appraiser'
,
[
'method'
=>
'post'
]
],
//评价经纪人
'recordCallNum'
=>
[
'api/broker/recordCallNum'
,
[
'method'
=>
'post'
]
],
//记录拨打经纪人号码
//get member
'logout'
=>
[
'api/member/logout'
,
[
'method'
=>
'get'
]
],
...
...
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