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
a5409452
Commit
a5409452
authored
Jul 27, 2022
by
zhangjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
78bac47b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
user.php
center/controllers/user.php
+2
-2
user_model.php
esf_core/models/user_model.php
+7
-4
No files found.
center/controllers/user.php
View file @
a5409452
...
...
@@ -1913,7 +1913,7 @@ 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
,
2
);
$couponRes
=
$this
->
user_model
->
checkCoupon
(
$this
->
user_id
,
$coupon_id
,
$price
,
$packageType
);
if
(
isset
(
$couponRes
[
'result'
]
)
&&
$couponRes
[
'result'
]
==
1
)
{
$price
=
$price
-
$couponRes
[
'data'
][
'coupon_price'
]
;
}
...
...
@@ -2017,7 +2017,7 @@ class User extends MY_Controller
// 使用优惠券
if
(
GB_CITY
==
'nj'
){
if
(
isset
(
$use_coupon
)
&&
$use_coupon
==
1
)
{
$this
->
user_model
->
useCoupon
(
$orderData
[
'transaction_id'
],
$this
->
user_id
,
$coupon_id
,
$price
);
$this
->
user_model
->
useCoupon
(
$orderData
[
'transaction_id'
],
$this
->
user_id
,
$coupon_id
,
$price
,
$packageType
);
}
}
...
...
esf_core/models/user_model.php
View file @
a5409452
...
...
@@ -6119,9 +6119,10 @@ if($searcharr['infotype']==4){
* @param $user_id
* @param $coupon_id
* @param $price
* @param $packageType
*/
public
function
checkCoupon
(
$user_id
,
$coupon_id
,
$price
,
$
business_type
=
0
)
{
$url
=
GB_CHECK_COUPON_URL
.
'?uid='
.
$user_id
.
'&coupon_id='
.
$coupon_id
.
'&price='
.
$price
.
'&
business_type='
.
$business_t
ype
;
public
function
checkCoupon
(
$user_id
,
$coupon_id
,
$price
,
$
packageType
)
{
$url
=
GB_CHECK_COUPON_URL
.
'?uid='
.
$user_id
.
'&coupon_id='
.
$coupon_id
.
'&price='
.
$price
.
'&
package_type='
.
$packageT
ype
;
$couponRes
=
curl_get_contents
(
$url
);
$couponRes
=
!
empty
(
$couponRes
)
?
json_decode
(
$couponRes
,
1
)
:
array
();
return
$couponRes
;
...
...
@@ -6129,17 +6130,19 @@ if($searcharr['infotype']==4){
/**
* 验证优惠券
* @param $order_code
* @param $user_id
* @param $coupon_id
* @param $price
* @param $packageType
*/
public
function
useCoupon
(
$order_code
,
$user_id
,
$coupon_id
,
$price
)
{
public
function
useCoupon
(
$order_code
,
$user_id
,
$coupon_id
,
$price
,
$packageType
)
{
$params
=
array
(
'order_code'
=>
$order_code
,
'coupon_id'
=>
$coupon_id
,
'price'
=>
$price
,
'uid'
=>
$user_id
,
'
business_type'
=>
2
,
'
package_type'
=>
$packageType
,
);
$url
=
GB_USE_COUPON_URL
;
$couonRes
=
$this
->
request_post
(
$url
,
$params
);
...
...
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