Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
U
User
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
zhangjun
User
Commits
82d87465
Commit
82d87465
authored
Jul 20, 2022
by
zhangjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
055d217d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
user.php
center/controllers/user.php
+5
-1
constants.php
esf_core/config/constants.php
+2
-0
package_model.php
esf_core/models/package_model.php
+5
-0
user_model.php
esf_core/models/user_model.php
+14
-1
No files found.
center/controllers/user.php
View file @
82d87465
...
...
@@ -1910,9 +1910,13 @@ class User extends MY_Controller
}
}
// 使用优惠券
if
(
GB_CITY
==
'nj'
)
{
if
(
isset
(
$use_coupon
)
&&
$use_coupon
==
1
)
{
$couponRes
=
$this
->
user_model
->
checkCoupon
(
$this
->
user_id
,
$coupon_id
,
$price
);
if
(
isset
(
$couponRes
[
'result'
]
)
&&
$couponRes
[
'result'
]
==
1
)
{
$price
=
$price
-
$couponRes
[
'data'
][
'coupon_price'
]
;
}
}
}
...
...
@@ -1994,7 +1998,7 @@ class User extends MY_Controller
// 优惠券字段
if
(
isset
(
$couponRes
[
'result'
]
)
&&
$couponRes
[
'result'
]
==
1
)
{
$orderData
[
'coupon_name'
]
=
isset
(
$couponRes
[
'data'
][
'name'
]
)
?
iconv
(
'utf-8'
,
'gbk'
,
$couponRes
[
'data'
][
'name'
])
:
0
;
$orderData
[
'coupon_price'
]
=
isset
(
$couponRes
[
'data'
][
'
price'
]
)
?
$couponRes
[
'data'
][
'
price'
]
:
0
;
$orderData
[
'coupon_price'
]
=
isset
(
$couponRes
[
'data'
][
'
coupon_price'
]
)
?
$couponRes
[
'data'
][
'coupon_
price'
]
:
0
;
$orderData
[
'coupon_id'
]
=
isset
(
$couponRes
[
'data'
][
'id'
]
)
?
$couponRes
[
'data'
][
'id'
]
:
0
;
}
$orderData
[
'package_days'
]
=
$day
;
...
...
esf_core/config/constants.php
View file @
82d87465
...
...
@@ -417,6 +417,8 @@ define('GB_LOGOUT_URL', 'http://passport.house365.com/index/logout');
define
(
'GB_CHECK_COUPON_URL'
,
'http://newrent.house365.com/api/tf-app/check-coupon-personal'
);
// 使用优惠券
define
(
'GB_USE_COUPON_URL'
,
'http://newrent.house365.com/api/tf-app/use-coupon'
);
// 更新优惠券
define
(
'GB_UPDATE_COUPON_URL'
,
'http://newrenttest.house365.com/api/tf-app/use-coupon'
);
if
(
$_SERVER
[
'SERVER_ADDR'
]
==
'192.168.105.106'
)
{
...
...
esf_core/models/package_model.php
View file @
82d87465
...
...
@@ -552,6 +552,11 @@ class Package_model extends MY_Model
//订单状态更新成功,设置缓存5分钟内不再允许更新
$this
->
memcached_class
->
add
(
$cacheKey
,
1
,
300
);
//更新优惠券
if
(
GB_CITY
==
'nj'
&&
$orderInfo
[
'coupon_id'
]
>
0
)
{
$this
->
user_model
->
updateCouponStatus
(
$orderInfo
[
'user_id'
],
$orderInfo
[
'coupon_id'
]
);
}
$data
=
array
();
$tableArray
=
array
(
1
=>
'sell'
,
2
=>
'rent'
);
$tbl
=
$tableArray
[
$orderInfo
[
'house_type'
]];
...
...
esf_core/models/user_model.php
View file @
82d87465
...
...
@@ -6121,7 +6121,7 @@ if($searcharr['infotype']==4){
* @param $price
*/
public
function
checkCoupon
(
$user_id
,
$coupon_id
,
$price
,
$business_type
=
0
)
{
$url
=
GB_
USE
_COUPON_URL
.
'?uid='
.
$user_id
.
'&coupon_id='
.
$coupon_id
.
'&price='
.
$price
.
'&business_type='
.
$business_type
;
$url
=
GB_
CHECK
_COUPON_URL
.
'?uid='
.
$user_id
.
'&coupon_id='
.
$coupon_id
.
'&price='
.
$price
.
'&business_type='
.
$business_type
;
$couponRes
=
curl_get_contents
(
$url
);
$couponRes
=
!
empty
(
$couponRes
)
?
json_decode
(
$couponRes
,
1
)
:
array
();
return
$couponRes
;
...
...
@@ -6147,6 +6147,19 @@ if($searcharr['infotype']==4){
return
$couonRes
;
}
/**
* 验证优惠券
* @param $user_id
* @param $coupon_id
*/
public
function
updateCouponStatus
(
$user_id
,
$coupon_id
)
{
$url
=
GB_UPDATE_COUPON_URL
.
'?uid='
.
$user_id
.
'&coupon_id='
.
$coupon_id
;
$couponRes
=
curl_get_contents
(
$url
);
$couponRes
=
!
empty
(
$couponRes
)
?
json_decode
(
$couponRes
,
1
)
:
array
();
return
$couponRes
;
}
function
request_post
(
$url
=
''
,
$param
=
''
)
{
if
(
empty
(
$url
)
||
empty
(
$param
))
{
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