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
349e97e3
Commit
349e97e3
authored
Jan 25, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
如果是店长,将员工的消息也搜出来
parent
96b5c7f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
3 deletions
+76
-3
AppChat.php
application/chat/controller/AppChat.php
+36
-1
ImageDepot.php
application/index/controller/ImageDepot.php
+33
-2
AAgents.php
application/model/AAgents.php
+7
-0
No files found.
application/chat/controller/AppChat.php
View file @
349e97e3
...
@@ -15,6 +15,7 @@ use app\chat\extend\Basic;
...
@@ -15,6 +15,7 @@ use app\chat\extend\Basic;
use
app\chat\service\ChatService
;
use
app\chat\service\ChatService
;
use
app\chat\utils\RPush
;
use
app\chat\utils\RPush
;
use
app\extra\RedisPackage
;
use
app\extra\RedisPackage
;
use
app\model\AAgents
;
use
app\model\ChatMsg
;
use
app\model\ChatMsg
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesImgs
;
use
app\model\GHousesImgs
;
...
@@ -483,8 +484,10 @@ class AppChat extends Basic
...
@@ -483,8 +484,10 @@ class AppChat extends Basic
$field
=
"id,addressee_id,type,message,house_id,create_time,is_read"
;
$field
=
"id,addressee_id,type,message,house_id,create_time,is_read"
;
//获取此经纪人的所有盘方楼盘id
//获取此经纪人的所有盘方楼盘id
$params_agent_id
=
$this
->
getAgentIds
(
$params
[
'agent_id'
]);
//如果是店长,将员工的消息也搜出来
$param
[
"addressee_id"
]
=
$params
[
"agent_id"
];
$param
[
"addressee_id"
]
=
array
(
"in"
,
$params_agent_id
);
// $param["addressee_id"] = $params["agent_id"];
$param
[
"type"
]
=
array
(
"in"
,
"1,3"
);
$param
[
"type"
]
=
array
(
"in"
,
"1,3"
);
$msgModel
=
new
MPushMessage
();
$msgModel
=
new
MPushMessage
();
...
@@ -633,4 +636,36 @@ class AppChat extends Basic
...
@@ -633,4 +636,36 @@ class AppChat extends Basic
}
}
/**
* 查询店长下面的业务员id
* @param $agent_id
* @return string
*/
public
function
getAgentIds
(
$agent_id
){
$m_agent
=
new
AAgents
();
$a_res_level
=
$m_agent
->
getAgentFieldById
(
$agent_id
,
'level'
);
dump
(
$a_res_level
);
if
(
$a_res_level
==
20
){
//查询总监下面门店的所有经纪人
$a_res_store_id
=
$m_agent
->
getAgentFieldById
(
$agent_id
,
'store_id'
);
$params
=
[];
$params
[
"store_id"
]
=
$a_res_store_id
;
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$agentsArr
=
$m_agent
->
getAgentsByStoreId
(
$params
);
if
(
count
(
$agentsArr
)
>
0
)
{
$agent_ids
=
""
;
foreach
(
$agentsArr
as
$k
=>
$v
)
{
$agent_ids
.=
$v
[
"id"
]
.
","
;
}
$agent_ids
=
rtrim
(
$agent_ids
,
","
);
//经纪人ID集合
}
//查询总监下面门店的所有经纪人 end
return
$agent_ids
;
}
else
{
return
$agent_id
;
}
}
}
}
application/index/controller/ImageDepot.php
View file @
349e97e3
...
@@ -6,6 +6,7 @@ use app\api_broker\service\VipService;
...
@@ -6,6 +6,7 @@ use app\api_broker\service\VipService;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\index\service\ImageDepotService
;
use
app\index\service\ImageDepotService
;
use
app\index\service\UserService
;
use
app\index\service\UserService
;
use
app\model\AAgents
;
use
app\model\GBusinessDistrict
;
use
app\model\GBusinessDistrict
;
use
app\model\GImageDepot
;
use
app\model\GImageDepot
;
use
think\Cache
;
use
think\Cache
;
...
@@ -177,8 +178,38 @@ class ImageDepot extends Basic
...
@@ -177,8 +178,38 @@ class ImageDepot extends Basic
public
function
ceshi
()
public
function
ceshi
()
{
{
$we_chat_last_notice_lime
=
time
();
// $we_chat_last_notice_lime = time();
return
$this
->
response
(
"200"
,
"成功"
,
$we_chat_last_notice_lime
);
// return $this->response("200", "成功",$we_chat_last_notice_lime);
$getAgentIds
=
$this
->
getAgentIds
(
50
);
dump
(
$getAgentIds
);
}
public
function
getAgentIds
(
$agent_id
){
$m_agent
=
new
AAgents
();
$a_res_level
=
$m_agent
->
getAgentFieldById
(
$agent_id
,
'level'
);
dump
(
$a_res_level
);
if
(
$a_res_level
==
20
){
//查询总监下面门店的所有经纪人
$a_res_store_id
=
$m_agent
->
getAgentFieldById
(
$agent_id
,
'store_id'
);
$params
=
[];
$params
[
"store_id"
]
=
$a_res_store_id
;
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$agentsArr
=
$m_agent
->
getAgentsByStoreId
(
$params
);
if
(
count
(
$agentsArr
)
>
0
)
{
$agent_ids
=
""
;
foreach
(
$agentsArr
as
$k
=>
$v
)
{
$agent_ids
.=
$v
[
"id"
]
.
","
;
}
$agent_ids
=
rtrim
(
$agent_ids
,
","
);
//经纪人ID集合
}
//查询总监下面门店的所有经纪人 end
return
$agent_ids
;
}
else
{
return
$agent_id
;
}
}
}
...
...
application/model/AAgents.php
View file @
349e97e3
...
@@ -1584,4 +1584,10 @@ class AAgents extends BaseModel
...
@@ -1584,4 +1584,10 @@ class AAgents extends BaseModel
return
$result
;
return
$result
;
}
}
public
function
getAgentFieldById
(
$id
,
$fields
)
{
$return
=
$this
->
where
(
'id'
,
$id
)
->
value
(
$fields
);
return
$return
;
}
}
}
\ 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