作者 景龙
1 个管道 的构建 失败 耗费 0 秒

测试充值

... ... @@ -211,11 +211,18 @@ class Wxpay extends Api
if($data['return_code'] == 'SUCCESS' && $data['result_code'] == 'SUCCESS') {
$userModel = new User();
$user = $userModel->where(['openid'=>$data['openid']])->find();
$accountModel = new Account();
$money = $data['total_fee']/100;
$account = $accountModel::create(['uid'=>$user['id'],'type'=>config('site.pay_charge'),'money'=>$money]);
$accountModel->money = $data['total_fee']/100;
$accountModel->uid = $user['id'];
$accountModel->type = config('site.pay_charge');
$accountModel->save();
$messageModel = new Message();
$messageModel::create(['account_id'=>$account->id,'title'=>config('site.message')]);
$messageModel->account_id = $accountModel->id;
$messageModel->type = config('site.pay_charge');
$messageModel->title = config('site.message');
$messageModel->save();
//下面这句必须要执行,且在此之前不能有任何输出
$this->success('成功',$pay->success());
}
... ...