Base.php 572 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Services\WeChat;
  3. use App\Models\Common\TokenModel;
  4. class Base
  5. {
  6. protected $publicId;
  7. protected $appId;
  8. protected $appSecret;
  9. protected $accessToken;
  10. protected $nickname;
  11. public function __construct($publicId)
  12. {
  13. $media = TokenModel::where('user_name', $publicId)->first();
  14. $this->publicId = $media->user_name;
  15. $this->appId = $media->appId;
  16. $this->appSecret = $media->app_secret;
  17. $this->accessToken = $media->access_token;
  18. $this->nickname = $media->nick_name;
  19. }
  20. }