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
18646874
Commit
18646874
authored
Apr 16, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成交报告推送
parent
91fb5896
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
17 deletions
+48
-17
OrderLogService.php
application/api_broker/service/OrderLogService.php
+2
-3
PushMessageService.php
application/api_broker/service/PushMessageService.php
+39
-11
GHousesToAgents.php
application/model/GHousesToAgents.php
+7
-3
No files found.
application/api_broker/service/OrderLogService.php
View file @
18646874
...
...
@@ -115,8 +115,7 @@ class OrderLogService
{
$bargain_arr
=
[];
$father_id
=
0
;
$agent_arr
=
[];
array_push
(
$agent_arr
,[
$submit_agent_id
]);
foreach
(
$commission_arr
as
$commission_val
)
{
if
(
isset
(
$commission_val
[
"role"
])
&&
isset
(
$commission_val
[
"agent_id"
])
&&
isset
(
$commission_val
[
"scale"
])
&&
isset
(
$commission_val
[
"scale_fee"
]))
{
...
...
@@ -136,7 +135,7 @@ class OrderLogService
$houseNumUpdateService
->
updateHouseNumByBargain
(
$order_id
);
$push_message
=
new
PushMessageService
();
$push_message
->
pushBargainMessage
(
$
agent_arr
,
$
report_id
);
//推送
$push_message
->
pushBargainMessage
(
$report_id
);
//推送
}
//todo if bill_arr not null, save database table
...
...
application/api_broker/service/PushMessageService.php
View file @
18646874
...
...
@@ -14,6 +14,7 @@ use app\model\AAgents;
use
app\model\AStore
;
use
app\model\GHousesToAgents
;
use
app\model\OReportModel
;
use
app\model\Users
;
class
PushMessageService
{
...
...
@@ -81,33 +82,60 @@ class PushMessageService
/**
* 成交报告推送
*
* @param array $agent_id
* @param int $report_id
* @return bool|void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
pushBargainMessage
(
$agent_id
=
[],
$report_id
=
0
){
if
(
!
is_array
(
$agent_id
))
{
return
false
;
}
public
function
pushBargainMessage
(
$report_id
=
0
){
$agent
=
new
AAgents
();
$ge_tui
=
new
GeTuiUntils
();
$agent_
data
=
$agent
->
getAgentAllById
(
$agent_id
,
'id,device_id'
);
$field
=
'house_
title,report_agent_name,report_store
_id'
;
$agent_
house
=
new
GHousesToAgents
(
);
$user
=
new
Users
();
$field
=
'house_
id,house_title,report_agent_name,report_store_id,user
_id'
;
$report
=
new
OReportModel
();
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$report_id
]);
$user_agent_id
=
$user
->
getUserById
(
'agent_id'
,
$report_data
[
'user_id'
]);
$key
=
0
;
//客方
if
(
!
empty
(
$user_agent_id
[
'agent_id'
]))
{
$agent_data
[
$key
][
'id'
]
=
$user_agent_id
[
'agent_id'
];
$device_id
=
$agent
->
getAgentsById
(
$user_agent_id
[
'agent_id'
],
'device_id'
);
$agent_data
[
$key
][
'device_id'
]
=
$device_id
[
'device_id'
];
$key
++
;
}
$device_id
=
$agent
->
getAgentInfo
(
'id,device_id'
,
''
,
[
'store_id'
=>
$report_data
[
'report_store_id'
],
'level'
=>
[
'in'
,
'20,40'
]
]);
//店长
if
(
$device_id
[
'device_id'
])
{
$agent_data
[
$key
][
'id'
]
=
$device_id
[
'id'
];
$agent_data
[
$key
][
'device_id'
]
=
$device_id
[
'device_id'
];
$key
++
;
}
//独家方和盘方
$agent_houser_data
=
$agent_house
->
getHousesAgents
(
$report_data
[
'house_id'
],
'b.id,b.device_id'
,[
'type'
=>
[
'in'
,
'2,3'
]]);
foreach
(
$agent_houser_data
as
$v
)
{
if
(
!
empty
(
$v
[
'device_id'
]))
{
$agent_data
[
$key
][
'id'
]
=
$v
[
'id'
];
$agent_data
[
$key
][
'device_id'
]
=
$v
[
'device_id'
];
$key
++
;
}
}
$store
=
new
AStore
();
$store_name
=
$store
->
getStoreKeyById
(
'store_name'
,
$report_data
[
'report_store_id'
]);
$content
=
"恭喜【
{
$store_name
}
】店【
{
$report_data
[
'report_agent_name'
]
}
】成交【
{
$report_data
[
'house_title'
]
}
】商铺一套"
;
foreach
(
$agent_data
as
$k
=>
$v
)
{
$ge_tui
->
public_push_message_for_one
(
$v
[
'id'
],
$v
[
'device_id'
],
'成交'
,
$content
);
dump
(
$ge_tui
->
public_push_message_for_one
(
$v
[
'id'
],
$v
[
'device_id'
],
'成交就是这么简单'
,
$content
)
);
}
return
;
...
...
application/model/GHousesToAgents.php
View file @
18646874
...
...
@@ -181,19 +181,23 @@ class GHousesToAgents extends BaseModel
* 楼盘对应的经纪人信息
*
* @param $houses_id
* @param string $feild
* @param string $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHousesAgents
(
$houses_id
)
public
function
getHousesAgents
(
$houses_id
,
$feild
=
'b.id,name,a.type,b.phone'
,
$where
=
''
)
{
$select_data
=
$this
->
field
(
'b.id,name,a.type,b.phone'
)
->
alias
(
'a'
)
$select_data
=
$this
->
field
(
$feild
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agents_id = b.id'
,
'LEFT'
)
->
where
([
'houses_id'
=>
$houses_id
,
'is_del'
=>
0
])
->
select
();
])
->
where
(
$where
)
->
select
();
return
$select_data
;
}
...
...
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