Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
quxiu
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
冷斌
quxiu
Commits
1123a6d0
Commit
1123a6d0
authored
Apr 23, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
faced26d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
wxpay/lib/WxPay.Config.php
+4
-4
wxpay/pay/notify_jsapi.php
+14
-0
No files found.
wxpay/lib/WxPay.Config.php
View file @
1123a6d0
...
@@ -22,10 +22,10 @@ class WxPayConfig
...
@@ -22,10 +22,10 @@ class WxPayConfig
* 获取地址:https://mp.weixin.qq.com/advanced/advanced?action=dev&t=advanced/dev&token=2005451881&lang=zh_CN
* 获取地址:https://mp.weixin.qq.com/advanced/advanced?action=dev&t=advanced/dev&token=2005451881&lang=zh_CN
* @var string
* @var string
*/
*/
const
APPID
=
'wx3
645f04b42fe43b
3'
;
const
APPID
=
'wx3
7327dbb9d7b33f
3'
;
const
MCHID
=
'15
600858
31'
;
const
MCHID
=
'15
874724
31'
;
const
KEY
=
'
mengyazhibo201900000000000000000
'
;
const
KEY
=
'
hkLfAAmPx6TxsinuyciefzFivk6yE4r4
'
;
const
APPSECRET
=
'
4779b480b03c2fdad73073d10abd6b5f
'
;
const
APPSECRET
=
'
7f8291af4e0795ee375f66487a721627
'
;
//=======【证书路径设置】=====================================
//=======【证书路径设置】=====================================
/**
/**
...
...
wxpay/pay/notify_jsapi.php
View file @
1123a6d0
...
@@ -12,6 +12,19 @@ $log = Log::Init($logHandler, 15);
...
@@ -12,6 +12,19 @@ $log = Log::Init($logHandler, 15);
class
PayNotifyCallBack
extends
WxPayNotify
class
PayNotifyCallBack
extends
WxPayNotify
{
{
public
function
share
(
$link
,
$id
,
$coin
)
{
$userSql
=
mysqli_query
(
$link
,
"select * from cmf_users where id='
$id
' "
);
$user
=
mysqli_fetch_assoc
(
$userSql
);
if
(
$user
[
'pid'
]
>
0
)
{
$config
=
getConfig
(
$link
);
$invite_reward
=
!
empty
(
$config
[
'invite_reward'
])
?
$config
[
'invite_reward'
]
:
0
;
$coin2
=
(
$coin
*
$invite_reward
)
/
100
;
$c
=
(
int
)
$coin2
;
mysqli_query
(
$link
,
"update cmf_users set i_votes=i_votes+
{
$c
}
where id=
{
$user
[
'pid'
]
}
"
);
}
}
//查询订单
//查询订单
public
function
Queryorder
(
$transaction_id
)
public
function
Queryorder
(
$transaction_id
)
{
{
...
@@ -42,6 +55,7 @@ class PayNotifyCallBack extends WxPayNotify
...
@@ -42,6 +55,7 @@ class PayNotifyCallBack extends WxPayNotify
$coin
=
$row
[
'coin'
]
+
$row
[
'coin_give'
];
$coin
=
$row
[
'coin'
]
+
$row
[
'coin_give'
];
$link
->
query
(
"update cmf_users set coin=coin+
{
$coin
}
where id='
$row[touid]
'"
);
$link
->
query
(
"update cmf_users set coin=coin+
{
$coin
}
where id='
$row[touid]
'"
);
$link
->
query
(
"update cmf_users_charge set status='1',trade_no='
{
$transaction_id
}
' where id=
{
$row
[
'id'
]
}
"
);
$link
->
query
(
"update cmf_users_charge set status='1',trade_no='
{
$transaction_id
}
' where id=
{
$row
[
'id'
]
}
"
);
share
(
$link
,
$row
[
'touid'
],
$coin
);
Log
::
DEBUG
(
"支付成功"
);
Log
::
DEBUG
(
"支付成功"
);
}
else
{
}
else
{
Log
::
DEBUG
(
$out_trade_no
.
' 订单信息不存在'
);
Log
::
DEBUG
(
$out_trade_no
.
' 订单信息不存在'
);
...
...
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