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
e204ccc5
Commit
e204ccc5
authored
Mar 13, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
超过有效期的券改过期
parent
6b3f74b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
4 deletions
+60
-4
ConvertCouponService.php
application/api/service/ConvertCouponService.php
+5
-4
route.php
application/route.php
+2
-0
UpdateCouponTask.php
application/task/controller/UpdateCouponTask.php
+53
-0
No files found.
application/api/service/ConvertCouponService.php
View file @
e204ccc5
...
@@ -51,7 +51,7 @@ class ConvertCouponService
...
@@ -51,7 +51,7 @@ class ConvertCouponService
return
false
;
return
false
;
}
}
//验证 客户首次登录时间 是否在 收意向金时间
之间是否大于48小时 才
给返现红包兑现
//验证 客户首次登录时间 是否在 收意向金时间
大于48小时
给返现红包兑现
$verification_res
=
$this
->
verificationFirstLoginTime
(
$user_id
);
$verification_res
=
$this
->
verificationFirstLoginTime
(
$user_id
);
if
(
!
$verification_res
){
if
(
!
$verification_res
){
return
false
;
return
false
;
...
@@ -73,7 +73,7 @@ class ConvertCouponService
...
@@ -73,7 +73,7 @@ class ConvertCouponService
}
elseif
(
$coupon_list_count
>
1
){
}
elseif
(
$coupon_list_count
>
1
){
// 券数大于1 选取金额最大的核销
// 券数大于1 选取金额最大的核销
$coupon_list
=
[];
$coupon_list
=
[];
$coupon_list
=
$this
->
getMaxCoupon
(
$coupon_list
);
$coupon_list
[]
=
$this
->
getMaxCoupon
(
$coupon_list
);
}
}
//修改券状态为已使用
//修改券状态为已使用
$this
->
m_coupon
->
updateStatus
(
$coupon_list
[
0
][
'id'
],
2
);
$this
->
m_coupon
->
updateStatus
(
$coupon_list
[
0
][
'id'
],
2
);
...
@@ -162,7 +162,8 @@ class ConvertCouponService
...
@@ -162,7 +162,8 @@ class ConvertCouponService
$params
[
'a.referrer_id'
]
=
$referrer_id
;
$params
[
'a.referrer_id'
]
=
$referrer_id
;
$params
[
'b.return_action'
]
=
2
;
$params
[
'b.return_action'
]
=
2
;
}
else
{
}
else
{
$params
[
'b.return_action'
]
=
array
(
"in"
,
"0,1"
);
// $params['b.return_action'] = array("in","0,1");
$params
[
'b.return_action'
]
=
1
;
}
}
$params
[
'a.status'
]
=
0
;
$params
[
'a.status'
]
=
0
;
return
$this
->
m_coupon
->
getCouponJoinActivity
(
$field
,
$params
);
return
$this
->
m_coupon
->
getCouponJoinActivity
(
$field
,
$params
);
...
@@ -220,7 +221,7 @@ class ConvertCouponService
...
@@ -220,7 +221,7 @@ class ConvertCouponService
$pay_log_time
=
$pay_log
[
'create_time'
];
$pay_log_time
=
$pay_log
[
'create_time'
];
if
(
!
$pay_log_time
)
if
(
!
$pay_log_time
)
return
false
;
return
false
;
$pay_hour
=
floor
((
strtotime
(
$pay_log_time
)
-
strtotime
(
$first_login_time
))
/
3600
)
;
$pay_hour
=
(
strtotime
(
$pay_log_time
)
-
strtotime
(
$first_login_time
))
/
3600
;
if
(
$pay_hour
<
48
){
if
(
$pay_hour
<
48
){
return
false
;
return
false
;
}
}
...
...
application/route.php
View file @
e204ccc5
...
@@ -592,6 +592,8 @@ Route::group('task', [
...
@@ -592,6 +592,8 @@ Route::group('task', [
'updateActivityStatus'
=>
[
'task/UpdateActivityTask/updateActivityStatus'
,
[
'method'
=>
'get'
]],
'updateActivityStatus'
=>
[
'task/UpdateActivityTask/updateActivityStatus'
,
[
'method'
=>
'get'
]],
'updateForActivityBegins'
=>
[
'task/UpdateActivityTask/updateForActivityBegins'
,
[
'method'
=>
'get'
]],
'updateForActivityBegins'
=>
[
'task/UpdateActivityTask/updateForActivityBegins'
,
[
'method'
=>
'get'
]],
'updateCouponExpired'
=>
[
'task/UpdateCouponTask/updateCouponExpired'
,
[
'method'
=>
'get'
]],
//超过有效期的券改过期
]);
]);
Route
::
group
(
'broker'
,
[
Route
::
group
(
'broker'
,
[
...
...
application/task/controller/UpdateCouponTask.php
0 → 100644
View file @
e204ccc5
<?php
namespace
app\task\controller
;
use
app\model\CCoupon
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019/3/8
* Time: 4:53 PM
*/
class
UpdateCouponTask
{
private
$m_coupon
;
function
__construct
()
{
$this
->
m_coupon
=
new
CCoupon
();
}
/**
* 超过有效期的券改过期
*/
public
function
updateCouponExpired
()
{
$field
=
'a.id,a.activity_id,a.create_time,b.money,b.use_period'
;
$params
[
'a.status'
]
=
1
;
$coupon_list
=
$this
->
m_coupon
->
getCouponJoinActivity
(
$field
,
$params
);
if
(
!
$coupon_list
){
exit
;
}
// 循环查看是否过期
foreach
(
$coupon_list
as
$k
=>
$v
)
{
if
(
$v
[
'use_period'
]
<
0
){
continue
;
}
#发券日期大于最后使用日期
if
(
$v
[
'create_time'
]
>
date
(
"Y-m-d H:i:s"
,
strtotime
(
"+
{
$v
[
'use_period'
]
}
day"
,
strtotime
(
$v
[
'use_period'
])))){
$this
->
m_coupon
->
updateStatus
(
$v
[
'id'
],
3
);
}
}
exit
;
}
}
\ 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