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
055d217d
Commit
055d217d
authored
Jul 20, 2022
by
zhangjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
2bae583b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
12 deletions
+27
-12
user.php
center/controllers/user.php
+12
-12
constants.php
esf_core/config/constants.php
+2
-0
user_model.php
esf_core/models/user_model.php
+13
-0
No files found.
center/controllers/user.php
View file @
055d217d
...
...
@@ -1910,16 +1910,9 @@ class User extends MY_Controller
}
}
// 订单号
$transaction_id
=
$this
->
package_model
->
getTransactionId
(
$packageType
);
// 使用优惠券
if
(
GB_CITY
==
'nj'
){
if
(
isset
(
$use_coupon
)
&&
$use_coupon
==
1
)
{
$couponRes
=
$this
->
user_model
->
useCoupon
(
$transaction_id
,
$this
->
user_id
,
$coupon_id
,
$price
);
if
(
$couponRes
[
'result'
]
==
1
)
{
$price
=
$price
-
$couponRes
[
'data'
][
'price'
];
}
if
(
GB_CITY
==
'nj'
)
{
if
(
isset
(
$use_coupon
)
&&
$use_coupon
==
1
)
{
$couponRes
=
$this
->
user_model
->
checkCoupon
(
$this
->
user_id
,
$coupon_id
,
$price
);
}
}
...
...
@@ -1988,7 +1981,7 @@ class User extends MY_Controller
$tblArr
=
array
(
'sell'
=>
1
,
'rent'
=>
2
);
$tableId
=
$tblArr
[
$tbl
];
$orderData
=
array
();
$orderData
[
'transaction_id'
]
=
$t
ransaction_id
;
$orderData
[
'transaction_id'
]
=
$t
his
->
package_model
->
getTransactionId
(
$packageType
)
;
$orderData
[
'user_id'
]
=
$this
->
user_id
;
$orderData
[
'house_type'
]
=
$tableId
;
$orderData
[
'house_id'
]
=
$houseId
;
...
...
@@ -1999,7 +1992,7 @@ class User extends MY_Controller
$orderData
[
'package_keyword'
]
=
$packageKeyword
;
}
// 优惠券字段
if
(
$couponRes
[
'result'
]
==
1
)
{
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_id'
]
=
isset
(
$couponRes
[
'data'
][
'id'
]
)
?
$couponRes
[
'data'
][
'id'
]
:
0
;
...
...
@@ -2017,6 +2010,13 @@ class User extends MY_Controller
return
$this
->
jump
(
USER_CENTER
,
'订单创建失败'
,
3000
,
'warning'
);
}
// 使用优惠券
if
(
GB_CITY
==
'nj'
){
if
(
isset
(
$use_coupon
)
&&
$use_coupon
==
1
)
{
$this
->
user_model
->
useCoupon
(
$orderData
[
'transaction_id'
],
$this
->
user_id
,
$coupon_id
,
$price
);
}
}
$data
=
$this
->
getWxPayCodeByHouse365
(
$orderId
);
if
(
$data
[
'status'
]
!=
1
){
return
$this
->
jump
(
USER_CENTER
,
$data
[
'msg'
],
3000
,
'warning'
);
...
...
esf_core/config/constants.php
View file @
055d217d
...
...
@@ -414,6 +414,8 @@ define('GB_NEWRENT_INDEX_URL', 'http://newrent.house365.com/sell/index');
// 退出地址
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'
);
if
(
$_SERVER
[
'SERVER_ADDR'
]
==
'192.168.105.106'
)
...
...
esf_core/models/user_model.php
View file @
055d217d
...
...
@@ -6114,6 +6114,19 @@ if($searcharr['infotype']==4){
return
$collect_array
;
}
/**
* 验证优惠券
* @param $user_id
* @param $coupon_id
* @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
;
$couponRes
=
curl_get_contents
(
$url
);
$couponRes
=
!
empty
(
$couponRes
)
?
json_decode
(
$couponRes
,
1
)
:
array
();
return
$couponRes
;
}
/**
* 验证优惠券
* @param $user_id
...
...
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