作者 lihan
1 个管道 的构建 通过 耗费 0 秒

支付宝

... ... @@ -102,7 +102,7 @@ class OrderController extends HomeBaseController
if ($request->isPost()) {
$post = $request->param();
$data['user_id'] = session('user.id');
$data['order_sn'] = date('YmdHis') . rand(0, 9999);
$data['order_sn'] = date('YmdHis') . rand(1000, 9999);
$data['activity_id'] = $post['activity_id'];
$data['schedule_id'] = $post['schedule_id'];
$data['add_time'] = time();
... ... @@ -430,15 +430,13 @@ class OrderController extends HomeBaseController
//支付宝异步回调
public function alipayNotify()
{
//print_r(cache('zfb'));
$zfb = cache('zfb');
$zfb['out_trade_no'] = '2018';
require EXTEND_PATH . '/alipay/config.php';
require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
$alipay = new \AlipayTradeService($config);
$return = request()->param();
//cache('zfb', $return);
var_dump($alipay->check(cache('zfb')));
if($alipay->check($return)) {
Db::name('user')->where(['id'=>10])->setInc('balance', 1);
}
}
}
\ No newline at end of file
... ...