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
f15e5d3e
Commit
f15e5d3e
authored
Jan 02, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退款推送
parent
850feff8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
PayLogService.php
application/api_broker/service/PayLogService.php
+3
-0
PushMessageService.php
application/api_broker/service/PushMessageService.php
+76
-0
No files found.
application/api_broker/service/PayLogService.php
View file @
f15e5d3e
...
...
@@ -185,6 +185,9 @@ class PayLogService
if
(
$del_img
){
$this
->
delOImg
(
3
,
$del_img
);
}
$service_push
=
new
PushMessageService
();
$service_push
->
pushRefund
(
$agent_id
,
$report_id
,
$order_id
);
return
$insert_id
;
}
...
...
application/api_broker/service/PushMessageService.php
View file @
f15e5d3e
...
...
@@ -314,6 +314,7 @@ class PushMessageService
$result
=
$m_push
->
addAgentIdArray
(
$agent_id
,
$operation_id
,
$type
,
$data
);
break
;
default
:
$data
[
'house_id'
]
=
$house_id
;
$result
=
$m_push
->
addAgentIdArray
(
$agent_id
,
$operation_id
,
$type
,
$data
);
}
return
$result
;
...
...
@@ -377,6 +378,10 @@ class PushMessageService
$type
=
'appointment'
;
$id
=
$v
[
'user_id'
];
break
;
case
9
:
$title
=
'退款'
;
$type
=
''
;
$id
=
$v
[
'user_id'
];
}
$this
->
pushAgentAllDeviceId
(
$v
[
'addressee_id'
],
$title
,
$v
[
'message'
],
$type
,
$id
,
$is_forbidden
,
$v
[
'house_id'
],
$v
[
'order_id'
]);
...
...
@@ -388,4 +393,74 @@ class PushMessageService
}
return
;
}
/**
* 退款推送
*
* @param $agent_id
* @param $report_id
* @param $order_id
* @return bool
*/
public
function
pushRefund
(
$agent_id
,
$report_id
,
$order_id
)
{
try
{
$m_agent
=
new
AAgents
();
//提交人
$agent_data
=
$m_agent
->
getAgentsStoreById
([
'a.id'
=>
$agent_id
],
'a.name,b.store_name'
);
if
(
empty
(
$agent_data
))
{
return
false
;
}
$address
=
$house_id
=
''
;
$agent_id_arr
=
[];
if
(
$order_id
)
{
$m_order
=
new
OrderModel
();
$house_data
=
$m_order
->
getHouseInfoByOrderIdOne
(
'b.internal_address,b.id'
,
[
'a.id'
=>
$order_id
]);
$address
=
$house_data
[
'internal_address'
];
$house_id
=
$house_data
[
'id'
];
$m_house_agent
=
new
GHousesToAgents
();
$house_agent
=
$m_house_agent
->
getAgentHouseOne
(
'agents_id'
,
[
'houses_id'
=>
$house_data
[
'id'
],
'type'
=>
2
]);
//盘方
foreach
(
$house_agent
as
$v
)
{
if
(
$v
>
0
)
{
$agent_id_arr
[]
=
$v
;
}
}
}
if
(
$report_id
)
{
$m_report
=
new
OReportModel
();
$report_data
=
$m_report
->
getAgentByOrderId
(
'a.report_agent_id,a.user_id,b.store_id,b.district_id'
,
[
'a.id'
=>
$report_id
]);
$m_user
=
new
Users
();
$user_agent_id
=
$m_user
->
getUserByWhereValue
(
'agent_id'
,
[
'id'
=>
$report_data
[
0
][
'user_id'
]]);
//客方
if
(
$user_agent_id
)
{
$agent_id_arr
[]
=
$user_agent_id
;
}
if
(
$report_data
[
0
][
'report_agent_id'
])
{
//报备人
$agent_id_arr
[]
=
$report_data
[
0
][
'report_agent_id'
];
$store_agent_id
=
$m_agent
->
getAgentsByWhere
(
'id'
,
[
'store_id'
=>
$report_data
[
0
][
'store_id'
],
'level'
=>
20
]);
//报备人店长
$district_agent_id
=
$m_agent
->
getAgentsByWhere
(
'id'
,
[
'district_id'
=>
$report_data
[
0
][
'district_id'
],
'level'
=>
30
]);
//报备人总监
if
(
$store_agent_id
)
{
$agent_id_arr
[]
=
$store_agent_id
;
}
if
(
$district_agent_id
)
{
$agent_id_arr
[]
=
$district_agent_id
;
}
}
}
$save
[
'order_id'
]
=
$order_id
;
$save
[
'message'
]
=
"[
{
$agent_data
[
'store_name'
]
}
-
{
$agent_data
[
'name'
]
}
]提交[
{
$address
}
,商铺:
{
$house_id
}
]退款"
;
$this
->
record
(
9
,
$house_id
,
$agent_id_arr
,
$agent_id
,
$save
);
$result
[
'status'
]
=
true
;
}
catch
(
\Exception
$e
)
{
$result
[
'status'
]
=
false
;
$result
[
'msg'
]
=
$e
->
getMessage
();
}
return
$result
;
}
}
\ 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