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
5859adc8
Commit
5859adc8
authored
Mar 18, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
0a86220b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
ConvertCouponService.php
application/api/service/ConvertCouponService.php
+7
-2
No files found.
application/api/service/ConvertCouponService.php
View file @
5859adc8
...
@@ -70,11 +70,13 @@ class ConvertCouponService
...
@@ -70,11 +70,13 @@ class ConvertCouponService
// 根据$user_id 取出 当前客户的 0首次登陆 1邀请登陆 券
// 根据$user_id 取出 当前客户的 0首次登陆 1邀请登陆 券
$coupon_list
=
$this
->
getCoupon
(
$user_id
,
''
);
$coupon_list
=
$this
->
getCoupon
(
$user_id
,
''
);
big_log
(
'1'
.
json_encode
(
$coupon_list
));
if
(
!
$coupon_list
){
if
(
!
$coupon_list
){
return
false
;
return
false
;
}
}
//去除已经过期的优惠券
//去除已经过期的优惠券
$coupon_list
=
$this
->
filterExpireData
(
$coupon_list
);
$coupon_list
=
$this
->
filterExpireData
(
$coupon_list
);
big_log
(
'2'
.
json_encode
(
$coupon_list
));
// 存在未过期 券数等于1直接核销
// 存在未过期 券数等于1直接核销
$coupon_list_count
=
count
(
$coupon_list
);
$coupon_list_count
=
count
(
$coupon_list
);
...
@@ -84,10 +86,13 @@ class ConvertCouponService
...
@@ -84,10 +86,13 @@ class ConvertCouponService
}
elseif
(
$coupon_list_count
>
1
){
}
elseif
(
$coupon_list_count
>
1
){
// 券数大于1 选取金额最大的核销
// 券数大于1 选取金额最大的核销
$coupon_list_new
=
$this
->
getMaxCoupon
(
$coupon_list
);
$coupon_list_new
=
$this
->
getMaxCoupon
(
$coupon_list
);
big_log
(
'3'
.
json_encode
(
$coupon_list
));
$coupon_list
=
[];
$coupon_list
=
[];
$coupon_list
[]
=
$coupon_list_new
;
$coupon_list
[]
=
$coupon_list_new
;
big_log
(
'4'
.
json_encode
(
$coupon_list
));
}
}
big_log
(
'5'
.
json_encode
(
$coupon_list
));
big_log
(
'6'
.
json_encode
(
$coupon_list
[
0
][
'id'
]));
//修改券状态为已使用
//修改券状态为已使用
$this
->
m_coupon
->
updateUseStatus
(
$coupon_list
[
0
][
'id'
],
1
,
$report_id
,
$bargain_id
,
$order_id
,
date
(
"Y-m-d H:i:s"
,
time
()));
$this
->
m_coupon
->
updateUseStatus
(
$coupon_list
[
0
][
'id'
],
1
,
$report_id
,
$bargain_id
,
$order_id
,
date
(
"Y-m-d H:i:s"
,
time
()));
...
@@ -213,7 +218,7 @@ class ConvertCouponService
...
@@ -213,7 +218,7 @@ class ConvertCouponService
//查找邀请人的信息
//查找邀请人的信息
$referrer_res
=
$this
->
getUserInfo
(
$user_id
);
$referrer_res
=
$this
->
getUserInfo
(
$user_id
);
if
(
!
$referrer_res
){
if
(
!
$referrer_res
){
big_log
(
'
为
查询到邀请人'
);
big_log
(
'
未
查询到邀请人'
);
return
false
;
return
false
;
}
}
// 存在邀请人则判断是否是客户
// 存在邀请人则判断是否是客户
...
...
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