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
ecbc9c91
Commit
ecbc9c91
authored
Jul 18, 2022
by
zhangjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
49cca158
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
34 deletions
+71
-34
user.php
center/controllers/user.php
+49
-34
constants.php
esf_core/config/constants.php
+2
-0
user_model.php
esf_core/models/user_model.php
+20
-0
No files found.
center/controllers/user.php
View file @
ecbc9c91
...
@@ -1814,8 +1814,10 @@ class User extends MY_Controller
...
@@ -1814,8 +1814,10 @@ class User extends MY_Controller
$packageKeyword
=
intval
(
$this
->
input
->
post
(
'package_keyword'
,
true
));
$packageKeyword
=
intval
(
$this
->
input
->
post
(
'package_keyword'
,
true
));
$day
=
intval
(
$this
->
input
->
post
(
'day_'
.
$packageType
,
true
));
$day
=
intval
(
$this
->
input
->
post
(
'day_'
.
$packageType
,
true
));
$payType
=
addslashes
(
$this
->
input
->
post
(
'pay_type'
,
true
));
$payType
=
addslashes
(
$this
->
input
->
post
(
'pay_type'
,
true
));
//
租房8折优惠券 20200507添加
//
是否使用优惠券
$use_coupon
=
intval
(
$this
->
input
->
post
(
'use_coupon'
,
true
));
$use_coupon
=
intval
(
$this
->
input
->
post
(
'use_coupon'
,
true
));
// 优惠券ID
$coupon_id
=
intval
(
$this
->
input
->
post
(
'coupon_id'
,
true
));
$from_url
=
$this
->
input
->
post
(
'from_url'
,
true
);
$from_url
=
$this
->
input
->
post
(
'from_url'
,
true
);
if
(
empty
(
$packageId
)
||
empty
(
$houseId
)
||
empty
(
$tbl
)
||
empty
(
$packageType
)
||
(
!
in_array
(
$packageType
,
array
(
4
,
5
))
&&
empty
(
$day
))
||
empty
(
$payType
)
||
!
in_array
(
$payType
,
$payTypeArr
)){
if
(
empty
(
$packageId
)
||
empty
(
$houseId
)
||
empty
(
$tbl
)
||
empty
(
$packageType
)
||
(
!
in_array
(
$packageType
,
array
(
4
,
5
))
&&
empty
(
$day
))
||
empty
(
$payType
)
||
!
in_array
(
$payType
,
$payTypeArr
)){
return
$this
->
jump
(
USER_CENTER
,
'参数缺失'
,
3000
,
'warning'
);
return
$this
->
jump
(
USER_CENTER
,
'参数缺失'
,
3000
,
'warning'
);
...
@@ -1870,40 +1872,53 @@ class User extends MY_Controller
...
@@ -1870,40 +1872,53 @@ class User extends MY_Controller
}
}
// 列表套餐8折券使用 20200507
// 列表套餐8折券使用 20200507
// 优惠券修改为 6折
// 优惠券修改为 6折
if
(
GB_CITY
==
'nj'
&&
$packageType
==
2
&&
$tbl
==
'rent'
){
// if( GB_CITY == 'nj' && $packageType == 2 && $tbl == 'rent'){
//
// //
$checkbox_status
=
0
;
// $checkbox_status = 0;
// 检查是否有可用的优惠券,如果有则使用,如果无,则跳转提示
// // 检查是否有可用的优惠券,如果有则使用,如果无,则跳转提示
$userInfoData
=
$this
->
user_model
->
getuserdetail
(
$this
->
user_id
);
// $userInfoData = $this->user_model->getuserdetail($this->user_id);
$passport_uid
=
$userInfoData
?
$userInfoData
[
'passport_uid'
]
:
0
;
// $passport_uid = $userInfoData ? $userInfoData['passport_uid'] : 0;
//
// 测试数据
// // 测试数据
$couponUserIdArr
=
array
(
'1785149'
,
'3367096'
,
'4112782'
);
// $couponUserIdArr = array('1785149','3367096','4112782');
if
(
in_array
(
$this
->
user_id
,
$couponUserIdArr
)
){
// if( in_array($this->user_id,$couponUserIdArr) ){
$price
=
0.05
;
// $price = 0.05;
}
// }
//
if
(
isset
(
$use_coupon
)
&&
$use_coupon
==
1
){
// if( isset($use_coupon) && $use_coupon == 1){
//
$check_coupon
=
$this
->
rent_coupon_model
->
checkCoupon
(
$passport_uid
);
// $check_coupon = $this->rent_coupon_model->checkCoupon($passport_uid);
if
(
!
$check_coupon
){
// if( !$check_coupon ){
$from_url
=
$from_url
?
$from_url
:
USER_CENTER
;
// $from_url = $from_url ? $from_url : USER_CENTER;
return
$this
->
jumpNew
(
$from_url
,
'已有待支付订单,勿重复下单!<br/>请30分钟后再试。'
,
3000
,
'warning'
);
// return $this->jumpNew($from_url,'已有待支付订单,勿重复下单!<br/>请30分钟后再试。',3000,'warning');
}
// }
$checkbox_status
=
1
;
// $checkbox_status = 1;
// 列表优先套餐8折
// // 列表优先套餐8折
// 修改为6折 20200927
// // 修改为6折 20200927
$price
=
sprintf
(
"%.2f"
,
$price
*
0.6
);
// $price = sprintf("%.2f",$price * 0.6);
// 锁定半小时
// // 锁定半小时
$this
->
rent_coupon_model
->
lockCoupon
(
$passport_uid
);
// $this->rent_coupon_model->lockCoupon($passport_uid);
//
//
}
// }
//
// // 设置8折优惠券的选中状态
// $this->rent_coupon_model->setCheckbox($passport_uid,$checkbox_status);
//
// }
}
}
}
// 设置8折优惠券的选中状态
// 订单号
$this
->
rent_coupon_model
->
setCheckbox
(
$passport_uid
,
$checkbox_status
);
$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'
];
}
}
}
}
}
}
...
@@ -1973,7 +1988,7 @@ class User extends MY_Controller
...
@@ -1973,7 +1988,7 @@ class User extends MY_Controller
$tblArr
=
array
(
'sell'
=>
1
,
'rent'
=>
2
);
$tblArr
=
array
(
'sell'
=>
1
,
'rent'
=>
2
);
$tableId
=
$tblArr
[
$tbl
];
$tableId
=
$tblArr
[
$tbl
];
$orderData
=
array
();
$orderData
=
array
();
$orderData
[
'transaction_id'
]
=
$t
his
->
package_model
->
getTransactionId
(
$packageType
)
;
$orderData
[
'transaction_id'
]
=
$t
ransaction_id
;
$orderData
[
'user_id'
]
=
$this
->
user_id
;
$orderData
[
'user_id'
]
=
$this
->
user_id
;
$orderData
[
'house_type'
]
=
$tableId
;
$orderData
[
'house_type'
]
=
$tableId
;
$orderData
[
'house_id'
]
=
$houseId
;
$orderData
[
'house_id'
]
=
$houseId
;
...
...
esf_core/config/constants.php
View file @
ecbc9c91
...
@@ -413,6 +413,8 @@ define('GB_UCENTER_LOGIN_URL', 'https://ucenter.house365.com/index/login');
...
@@ -413,6 +413,8 @@ define('GB_UCENTER_LOGIN_URL', 'https://ucenter.house365.com/index/login');
define
(
'GB_NEWRENT_INDEX_URL'
,
'http://newrent.house365.com/sell/index'
);
define
(
'GB_NEWRENT_INDEX_URL'
,
'http://newrent.house365.com/sell/index'
);
// 退出地址
// 退出地址
define
(
'GB_LOGOUT_URL'
,
'http://passport.house365.com/index/logout'
);
define
(
'GB_LOGOUT_URL'
,
'http://passport.house365.com/index/logout'
);
// 验证优惠券
define
(
'GB_USE_COUPON_URL'
,
'http://newrent.house365.com/api/tf-app/use-coupon'
);
if
(
$_SERVER
[
'SERVER_ADDR'
]
==
'192.168.105.106'
)
if
(
$_SERVER
[
'SERVER_ADDR'
]
==
'192.168.105.106'
)
{
{
...
...
esf_core/models/user_model.php
View file @
ecbc9c91
...
@@ -6114,6 +6114,26 @@ if($searcharr['infotype']==4){
...
@@ -6114,6 +6114,26 @@ if($searcharr['infotype']==4){
return
$collect_array
;
return
$collect_array
;
}
}
/**
* 验证优惠券
* @param $user_id
* @param $coupon_id
* @param $price
*/
public
function
useCoupon
(
$order_code
,
$user_id
,
$coupon_id
,
$price
)
{
$params
=
array
(
'order_code'
=>
$order_code
,
'coupon_id'
=>
$coupon_id
,
'price'
=>
$price
,
'uid'
=>
$user_id
,
'business_type'
=>
2
,
);
$url
=
GB_USE_COUPON_URL
;
$couonRes
=
request_post
(
$url
,
$params
);
$couonRes
=
!
empty
(
$couonRes
)
?
json_decode
(
$couonRes
,
1
)
:
array
();
return
$couonRes
;
}
function
request_post
(
$url
=
''
,
$param
=
''
)
{
function
request_post
(
$url
=
''
,
$param
=
''
)
{
if
(
empty
(
$url
)
||
empty
(
$param
))
{
if
(
empty
(
$url
)
||
empty
(
$param
))
{
return
false
;
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