|
@@ -8,6 +8,8 @@ use app\admin\model\Porder; |
|
@@ -8,6 +8,8 @@ use app\admin\model\Porder; |
8
|
use think\Db;
|
8
|
use think\Db;
|
9
|
use Yansongda\Pay\Pay;
|
9
|
use Yansongda\Pay\Pay;
|
10
|
use app\admin\model\Account;
|
10
|
use app\admin\model\Account;
|
|
|
11
|
+use app\admin\model\User;
|
|
|
12
|
+use app\admin\model\Message;
|
11
|
use think\Log;
|
13
|
use think\Log;
|
12
|
use fast\Http;
|
14
|
use fast\Http;
|
13
|
use think\Validate;
|
15
|
use think\Validate;
|
|
@@ -195,9 +197,13 @@ class Wxpay extends Api |
|
@@ -195,9 +197,13 @@ class Wxpay extends Api |
195
|
//你可以在这里你的业务处理逻辑,比如处理你的订单状态、给会员加余额等等功能
|
197
|
//你可以在这里你的业务处理逻辑,比如处理你的订单状态、给会员加余额等等功能
|
196
|
$data = $pay->verify();
|
198
|
$data = $pay->verify();
|
197
|
if($data['return_code'] == 'SUCCESS' && $data['result_code'] == 'SUCCESS') {
|
199
|
if($data['return_code'] == 'SUCCESS' && $data['result_code'] == 'SUCCESS') {
|
|
|
200
|
+ $userModel = new User();
|
|
|
201
|
+ $user = $userModel->where(['openid'=>$data['openid']])->find();
|
198
|
$accountModel = new Account();
|
202
|
$accountModel = new Account();
|
199
|
- Log::info($data);
|
|
|
200
|
- Log::info('充值回调');
|
203
|
+ $money = $data['total_fee']/100;
|
|
|
204
|
+ $account = $accountModel::create(['uid'=>$user['id'],'type'=>config('site.pay_charge'),'money'=>$money]);
|
|
|
205
|
+ $messageModel = new Message();
|
|
|
206
|
+ $messageModel::create(['aid'=>$account->id,'title'=>config('site.message')]);
|
201
|
//下面这句必须要执行,且在此之前不能有任何输出
|
207
|
//下面这句必须要执行,且在此之前不能有任何输出
|
202
|
echo $pay->success();
|
208
|
echo $pay->success();
|
203
|
}
|
209
|
}
|