User.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | tester 体验者设置
  5. |--------------------------------------------------------------------------
  6. */
  7. namespace Component\Src;
  8. use Dever;
  9. use Main\Lib\Wechat;
  10. class User
  11. {
  12. public function logo($id)
  13. {
  14. $info = Dever::db('component/user')->one($id);
  15. $oauth = Dever::db('main/oauth')->one($info['oauth_id']);
  16. $wechat = new Wechat($info['project_id'], 'component');
  17. $oauth['oauth'] = $oauth['id'];
  18. $oauth['path'] = 'pages/index/index';
  19. $param = $wechat->param('applet_qrcode', $oauth);
  20. $url = $param['url'];
  21. $html['LOGO'] = '<img src="'.$info['pic'].'" width="150" />';
  22. $html['正式版'] = '<img src="'.$info['qrcode'].'" width="150" />';
  23. if ($url) {
  24. //$version = Dever::db('component/version')->one($id);
  25. $html['体验版'] = '<img src="'.$url.'" width="150" />';
  26. }
  27. $html = Dever::table($html);
  28. return $html;
  29. }
  30. public function qrcode($uid, $id)
  31. {
  32. $version = Dever::db('component/version_log')->one($id);
  33. $info = Dever::db('component/user')->one($uid);
  34. $oauth = Dever::db('main/oauth')->one($info['oauth_id']);
  35. $wechat = new Wechat($info['project_id'], 'component');
  36. $oauth['oauth'] = $oauth['id'];
  37. $oauth['path'] = 'pages/index/index';
  38. $param = $wechat->param('applet_qrcode', $oauth);
  39. $url = $param['url'];
  40. $html['返回信息'] = $version['result'];
  41. if ($url) {
  42. $html['体验版'] = '<img src="'.$url.'" width="150" />';
  43. }
  44. $html = Dever::table($html);
  45. return $html;
  46. }
  47. }