Browse Source

user_id

develop
李可松 4 years ago
parent
commit
26121eff75
  1. 7
      app/Http/Controllers/Api/SharePayController.php

7
app/Http/Controllers/Api/SharePayController.php

@ -10,6 +10,7 @@ use EasyWeChat\Factory;
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
use EasyWeChat\Kernel\Exceptions\InvalidConfigException;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Cache;
/**
* 跳转支付
@ -24,6 +25,12 @@ class SharePayController extends Controller
if (!$order_id) {
return $this->error('无效的ID');
}
$this->user_id = Cache::get(request()->header('Authentication'));
if (!$this->user_id) {
return $this->error('获取用户信息失败');
}
//用户openid
$openid = User::query()->where('id', $this->user_id)->value('openid'); //此处要用where,value()用find有BUG

Loading…
Cancel
Save