Index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace app\index\controller;
  3. use app\common\controller\Frontend;
  4. use think\Config;
  5. use think\Route;
  6. use think\Url;
  7. class Index extends Frontend
  8. {
  9. protected $noNeedLogin = '*';
  10. protected $noNeedRight = '*';
  11. protected $layout = '';
  12. public function index()
  13. {
  14. // $order = \app\api\model\RechargeOrder::get(246);
  15. // \app\api\library\Retail::giveMoney($order);
  16. return $this->view->fetch();
  17. }
  18. /**
  19. * 将用户协议伪装为静态文本
  20. * @param string $name
  21. * @throws \think\db\exception\DataNotFoundException
  22. * @throws \think\db\exception\ModelNotFoundException
  23. * @throws \think\exception\DbException
  24. * @author fuyelk <fuyelk@fuyelk.com>
  25. * @date 2021/07/05 19:40
  26. */
  27. public function agreement($name = '')
  28. {
  29. if (empty($name)) {
  30. echo "";
  31. exit();
  32. }
  33. $data = db('text')->field('desc,text')->where('title', $name)->where('public', 1)->find();
  34. if (empty($data)) {
  35. echo "";
  36. exit();
  37. }
  38. $html = <<<EOF
  39. <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>{$data['desc']}</title></head><body>{$data['text']}</body></html>
  40. EOF;
  41. echo $html;
  42. }
  43. }