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
8576cb84
Commit
8576cb84
authored
Mar 13, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
invitee_id
parent
cc79393d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
CouponService.php
application/api/service/CouponService.php
+7
-7
RegisterService.php
application/api/service/RegisterService.php
+2
-2
No files found.
application/api/service/CouponService.php
View file @
8576cb84
...
@@ -30,12 +30,12 @@ class CouponService{
...
@@ -30,12 +30,12 @@ class CouponService{
* 发券
* 发券
*
*
* @param int $user_id
* @param int $user_id
* @param int $
referrer
_id
* @param int $
invitee
_id
* @param int $type
* @param int $type
* @return mixed
* @return mixed
* @throws \think\exception\PDOException
* @throws \think\exception\PDOException
*/
*/
public
function
sendCoupon
(
int
$user_id
,
int
$
referrer
_id
,
int
$type
)
{
public
function
sendCoupon
(
int
$user_id
,
int
$
invitee
_id
,
int
$type
)
{
$result
[
'status'
]
=
'successful'
;
$result
[
'status'
]
=
'successful'
;
$result
[
'msg'
]
=
'发券成功'
;
$result
[
'msg'
]
=
'发券成功'
;
$result
[
'data'
]
=
[];
$result
[
'data'
]
=
[];
...
@@ -58,7 +58,7 @@ class CouponService{
...
@@ -58,7 +58,7 @@ class CouponService{
return
$result
;
return
$result
;
}
}
$activity_data
=
$this
->
checkUserCoupon
(
$user_id
,
$type
,
$
referrer
_id
);
$activity_data
=
$this
->
checkUserCoupon
(
$user_id
,
$type
,
$
invitee
_id
);
if
(
empty
(
$activity_data
))
{
if
(
empty
(
$activity_data
))
{
$result
[
'status'
]
=
'fail'
;
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'没有可参加的活动'
;
$result
[
'msg'
]
=
'没有可参加的活动'
;
...
@@ -66,8 +66,8 @@ class CouponService{
...
@@ -66,8 +66,8 @@ class CouponService{
}
}
$save_data
=
[];
$save_data
=
[];
$save_data
[
'user_id'
]
=
$user_id
;
$save_data
[
'user_id'
]
=
$user_id
;
if
(
$
referrer
_id
)
{
if
(
$
invitee
_id
)
{
$save_data
[
'
referrer_id'
]
=
$referrer
_id
;
$save_data
[
'
invitee_id'
]
=
$invitee
_id
;
}
}
$save_data
[
'status'
]
=
0
;
$save_data
[
'status'
]
=
0
;
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
...
@@ -129,7 +129,7 @@ class CouponService{
...
@@ -129,7 +129,7 @@ class CouponService{
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
checkUserCoupon
(
int
$user_id
,
int
$type
,
$
referrer
_id
)
public
function
checkUserCoupon
(
int
$user_id
,
int
$type
,
$
invitee
_id
)
{
{
$return_activity
=
[];
$return_activity
=
[];
$time
=
time
();
$time
=
time
();
...
@@ -144,7 +144,7 @@ class CouponService{
...
@@ -144,7 +144,7 @@ class CouponService{
}
}
if
(
$type
==
0
)
{
if
(
$type
==
0
)
{
$count_where
[
'
referrer_id'
]
=
$referrer
_id
;
$count_where
[
'
invitee_id'
]
=
$invitee
_id
;
$num
=
$this
->
m_coupon
->
getCount
(
$count_where
);
$num
=
$this
->
m_coupon
->
getCount
(
$count_where
);
if
(
$num
>
0
)
{
if
(
$num
>
0
)
{
continue
;
continue
;
...
...
application/api/service/RegisterService.php
View file @
8576cb84
...
@@ -125,11 +125,11 @@ class RegisterService
...
@@ -125,11 +125,11 @@ class RegisterService
$coupon_service
=
new
CouponService
();
$coupon_service
=
new
CouponService
();
if
(
!
empty
(
$first_login_time
))
{
if
(
!
empty
(
$first_login_time
))
{
$coupon_service
->
sendCoupon
((
int
)
$id
,
$user_info
[
0
][
'referrer_id'
]
,
0
);
$coupon_service
->
sendCoupon
((
int
)
$id
,
0
,
0
);
}
}
if
(
!
empty
(
$registration_time
)
&&
$referrer_source
==
10
&&
$referrer_id
)
{
if
(
!
empty
(
$registration_time
)
&&
$referrer_source
==
10
&&
$referrer_id
)
{
$coupon_service
->
sendCoupon
((
int
)
$referrer_id
,
0
,
2
);
$coupon_service
->
sendCoupon
((
int
)
$referrer_id
,
$id
,
2
);
}
}
$jwt
=
new
JwtUntils
();
$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