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
ae240936
Commit
ae240936
authored
Mar 14, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送
parent
f13969a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
CouponService.php
application/api/service/CouponService.php
+3
-1
PushClientService.php
application/api/service/PushClientService.php
+15
-1
RegisterService.php
application/api/service/RegisterService.php
+6
-1
No files found.
application/api/service/CouponService.php
View file @
ae240936
...
...
@@ -32,10 +32,11 @@ class CouponService{
* @param int $user_id
* @param int $invitee_id
* @param int $type
* @param int $first_show
* @return mixed
* @throws \think\exception\PDOException
*/
public
function
sendCoupon
(
int
$user_id
,
int
$invitee_id
,
int
$type
)
{
public
function
sendCoupon
(
int
$user_id
,
int
$invitee_id
,
int
$type
,
$first_show
=
0
)
{
$result
[
'status'
]
=
'successful'
;
$result
[
'msg'
]
=
'发券成功'
;
$result
[
'data'
]
=
[];
...
...
@@ -70,6 +71,7 @@ class CouponService{
$save_data
[
'invitee_id'
]
=
$invitee_id
;
}
$save_data
[
'status'
]
=
0
;
$save_data
[
'first_show'
]
=
$first_show
;
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
m_coupon
->
startTrans
();
$coupon_untils
=
new
CouponNoEncodingUntils
();
...
...
application/api/service/PushClientService.php
View file @
ae240936
...
...
@@ -33,7 +33,7 @@ class PushClientService
* @param int $operation_id
* @return bool
*/
public
function
record
(
int
$report_id
,
int
$order_id
,
int
$type
,
$message
,
int
$operation_id
)
public
function
record
(
int
$report_id
,
int
$order_id
,
int
$type
,
$message
,
int
$operation_id
,
$addressee_id
=
0
)
{
$order
=
new
OrderModel
();
...
...
@@ -42,6 +42,10 @@ class PushClientService
$report
=
new
OReportModel
();
$user_id
=
$report
->
getFieldValue
(
'user_id'
,
[
'id'
=>
$report_id
]);
if
(
empty
(
$user_id
))
{
$user_id
=
$addressee_id
;
}
if
(
empty
(
$message
))
{
$m_agent
=
new
AAgents
();
$message
=
$m_agent
->
getAgentsById
(
$operation_id
,
'name'
);
...
...
@@ -70,6 +74,16 @@ class PushClientService
$type
=
'evaluate'
;
$content
=
'同联商业邀请您评价经纪人'
.
$v
[
'message'
]
.
'对商铺的带看服务'
;
break
;
case
1
:
$title
=
"新人专享返现红包"
;
$type
=
'first_login'
;
$content
=
$v
[
'message'
];
break
;
case
2
:
$title
=
"邀请成交返现红包"
;
$type
=
'referrer_coupon'
;
$content
=
$v
[
'message'
];
break
;
}
$this
->
pushAgentAllDeviceId
(
$v
[
'operation_id'
],
$title
,
$content
,
$type
,
$v
[
'user_id'
],
$is_forbidden
,
$v
[
'house_id'
],
$v
[
'order_id'
],
$v
[
'message'
]);
...
...
application/api/service/RegisterService.php
View file @
ae240936
...
...
@@ -124,12 +124,17 @@ class RegisterService
$jwt_data
[
'phone'
]
=
$phone
;
$coupon_service
=
new
CouponService
();
$service
=
new
PushClientService
();
if
(
!
empty
(
$first_login_time
))
{
$coupon_service
->
sendCoupon
((
int
)
$id
,
0
,
0
);
$coupon_service
->
sendCoupon
((
int
)
$id
,
0
,
0
,
1
);
$content
=
'恭喜您您获得500元的新人专享返现红包,成交后可兑现'
;
$service
->
record
(
0
,
0
,
1
,
$content
,
0
,
$id
);
}
if
(
!
empty
(
$registration_time
)
&&
$referrer_source
==
10
&&
$referrer_id
)
{
$coupon_service
->
sendCoupon
((
int
)
$referrer_id
,
$id
,
2
);
$content
=
'恭喜您您获得500元的邀请成交返现红包,好友成交后可兑现'
;
$service
->
record
(
0
,
0
,
2
,
$content
,
0
,
$referrer_id
);
}
$jwt
=
new
JwtUntils
();
...
...
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