Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
477a3111
Commit
477a3111
authored
Oct 07, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4c6949fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
21 deletions
+26
-21
application/api/controller/Order.php
+0
-0
application/api/controller/Project.php
+1
-1
application/api/controller/User.php
+11
-1
application/common/model/Order.php
+2
-14
application/config.php
+10
-3
extend/wxpay/Api.php
+1
-1
extend/wxpay/Config.php
+1
-1
No files found.
application/api/controller/Order.php
View file @
477a3111
This diff is collapsed.
Click to expand it.
application/api/controller/Project.php
View file @
477a3111
...
...
@@ -296,7 +296,7 @@ class Project extends Base
// 正常
$project
[
'status'
]
=
0
;
$project
[
'status_text'
]
=
'立即报名'
;
if
(
strtotime
(
$project
[
'sign_endtime'
])
>
time
())
{
if
(
strtotime
(
$project
[
'sign_endtime'
])
<
time
())
{
// 已过期
$project
[
'status'
]
=
1
;
$project
[
'status_text'
]
=
'预约下次'
;
...
...
application/api/controller/User.php
View file @
477a3111
...
...
@@ -156,7 +156,17 @@ class User extends Base
{
//用户UID
$uid
=
$this
->
userinfo
[
0
];
$user
=
UserModel
::
get
(
$uid
);
$user
=
UserModel
::
get
(
$uid
)
->
toArray
();
//过期时间
if
(
$user
[
'is_vip'
]){
if
(
strtotime
(
$user
[
'vip_endtime'
])
>
time
()){
$user
[
'vip_endtime_str'
]
=
'剩余'
.
ceil
((
strtotime
(
$user
[
'vip_endtime'
])
-
time
())
/
86400
)
.
'天'
;
}
else
{
$user
[
'vip_endtime_str'
]
=
'已到期'
;
}
}
else
{
$user
[
'vip_endtime_str'
]
=
''
;
}
$user
[
'hidephone'
]
=
substr_replace
(
$user
[
'phone'
],
'****'
,
3
,
4
);
return
[
'code'
=>
0
,
'msg'
=>
'success'
,
'data'
=>
$user
];
}
...
...
application/common/model/Order.php
View file @
477a3111
...
...
@@ -71,20 +71,8 @@ class Order extends BaseModel
public
static
function
getGroupNumberByProject
(
$pid
,
$sign_limits
)
{
//获取家庭组限制
$project
=
ProjectModel
::
get
(
$pid
);
$order
=
self
::
lock
(
true
)
->
where
([
'status'
=>
config
(
'order_status.no_pay'
),
'created_at'
=>
[
'> time'
,
date
(
'Y-m-d H:i:s'
,
time
()
-
300
)]])
->
whereOr
(
'status'
,
'in'
,
[
config
(
'order_status.pay'
),
config
(
'order_status.wait_comment'
),
config
(
'order_status.complete'
)])
->
select
();
$count
=
0
;
if
(
$order
)
{
foreach
(
$order
as
$k
=>
$v
)
{
if
(
$v
[
'type'
]
==
config
(
'order_type.project'
)){
$count
+=
$v
[
'extras'
][
'sign_limits'
];
}
}
}
if
(
$count
+
$sign_limits
>
$project
[
'sign_limits'
])
{
$project
=
ProjectModel
::
lock
(
true
)
->
find
(
$pid
);
if
(
$project
[
'sign_limits'
]
>=
intval
(
$project
[
'sign_num'
])
+
$sign_limits
)
{
return
true
;
}
return
false
;
...
...
application/config.php
View file @
477a3111
...
...
@@ -322,9 +322,16 @@ $config = [
// +----------------------------------------------------------------------
'wx_pay'
=>
[
'notify_url'
=>
'域名/api/Order/callback'
,
'vip_title'
=>
'美行者会员VIP'
,
'vip_price'
=>
49.00
'notify_url'
=>
'https://app.maveler.com/api/Order/callback'
,
'vip_title'
=>
'美行者会员VIP'
,
'vip_price'
=>
00.01
,
'app_id'
=>
'wx1b834552a7d49bb3'
,
'merchant_id'
=>
'1515838821'
,
'sign_type'
=>
'MD5'
,
'key'
=>
'meixingzheqinziyou2018jqtechgzgy'
,
'app_secret'
=>
'9708059f5f0a280bea0779df44389231'
,
'ssl_cert_path'
=>
''
,
'ssl_key_path'
=>
''
],
];
...
...
extend/wxpay/Api.php
View file @
477a3111
...
...
@@ -2,7 +2,7 @@
require_once
"WxPay.Exception.php"
;
require_once
"WxPay.Config.Interface.php"
;
require_once
"WxPay.Data.php"
;
require_once
"
WxPay.
Config.php"
;
require_once
"Config.php"
;
/**
*
...
...
extend/wxpay/
WxPay.
Config.php
→
extend/wxpay/Config.php
View file @
477a3111
...
...
@@ -33,7 +33,7 @@ class WxPayConfig extends WxPayConfigInterface
}
public
function
GetMerchantId
()
{
return
config
(
'wx_pay.erchant_id'
);
return
config
(
'wx_pay.
m
erchant_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