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
5e261d1d
Commit
5e261d1d
authored
Mar 18, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
77f29f99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
ConvertCouponService.php
application/api/service/ConvertCouponService.php
+11
-4
ImageDepot.php
application/index/controller/ImageDepot.php
+3
-11
Basic.php
application/index/extend/Basic.php
+1
-0
No files found.
application/api/service/ConvertCouponService.php
View file @
5e261d1d
...
...
@@ -59,6 +59,8 @@ class ConvertCouponService
if
(
!
$user_id
or
!
$report_id
or
!
$bargain_id
or
!
$order_id
){
return
false
;
}
big_log
(
'=============客户DI:'
.
$user_id
.
' START================='
);
//验证 客户首次登录时间 是否在 收意向金时间 大于48小时给返现红包兑现
$verification_res
=
$this
->
verificationFirstLoginTime
(
$user_id
);
...
...
@@ -76,15 +78,17 @@ class ConvertCouponService
// 存在未过期 券数等于1直接核销
$coupon_list_count
=
count
(
$coupon_list
);
if
(
$coupon_list_count
==
0
){
return
false
;
}
elseif
(
$coupon_list_count
>
1
){
// 券数大于1 选取金额最大的核销
$coupon_list_new
=
$this
->
getMaxCoupon
(
$coupon_list
);
$coupon_list
=
[];
$coupon_list
[]
=
$
this
->
getMaxCoupon
(
$coupon_list
)
;
$coupon_list
[]
=
$
coupon_list_new
;
}
//修改券状态为已使用
//修改券状态为已使用
$this
->
m_coupon
->
updateUseStatus
(
$coupon_list
[
0
][
'id'
],
1
,
$report_id
,
$bargain_id
,
$order_id
,
date
(
"Y-m-d H:i:s"
,
time
()));
// 将活动奖励金额写入账户余额
...
...
@@ -128,6 +132,7 @@ class ConvertCouponService
public
function
getMaxCoupon
(
$coupon_list
){
$field
=
'money'
;
$temp
=
[];
foreach
(
$coupon_list
as
$k
=>
$v
){
$temp
[]
=
$v
[
$field
];
}
...
...
@@ -229,8 +234,10 @@ class ConvertCouponService
*/
public
function
verificationFirstLoginTime
(
$user_id
){
$user_info
=
$this
->
getUserInfo
(
$user_id
);
if
(
!
$user_info
)
if
(
!
$user_info
){
big_log
(
'客户不存在!'
);
return
false
;
}
$first_login_time
=
$user_info
[
0
][
'first_login_time'
];
if
(
!
$first_login_time
)
{
...
...
@@ -243,7 +250,7 @@ class ConvertCouponService
$pay_log
=
$this
->
m_pay_log
->
getPayLogByUserId
(
'a.create_time'
,
$params
);
$pay_log_time
=
$pay_log
[
'create_time'
];
if
(
!
$pay_log_time
){
big_log
(
'客户
首次登录时间为空
'
);
big_log
(
'客户
不存在收意向金
'
);
return
false
;
}
$pay_hour
=
(
strtotime
(
$pay_log_time
)
-
strtotime
(
$first_login_time
))
/
3600
;
...
...
application/index/controller/ImageDepot.php
View file @
5e261d1d
...
...
@@ -181,18 +181,10 @@ class ImageDepot extends Basic
public
function
ceshi
()
{
// $this->m_pay_log = new OPayLogModel();
$service
=
new
ConvertCouponService
();
$service
->
convertCoupon
(
135281
,
12
,
12
,
12
);
//核销红包
// $s_convert = new ConvertCouponService();
// $s_convert = new OPayLogModel();
// // $s_convert->convertCoupon();
// $s_convert->adddata();
$first_login_time
=
'2019-03-10 11:04:21'
;
$pay_log_time
=
'2019-03-12 15:50:27'
;
$hour
=
floor
((
strtotime
(
$pay_log_time
)
-
strtotime
(
$first_login_time
))
/
3600
);
dump
(
$hour
);
exit
;
dump
(
0
);
exit
;
}
...
...
application/index/extend/Basic.php
View file @
5e261d1d
...
...
@@ -88,6 +88,7 @@ class Basic extends Controller
'index/checkReferrer'
,
'index/getActivityCoupon'
,
'index/userAccountBalanceList'
,
'index/ceshi'
,
);
/**
...
...
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