Index.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\protocol\controller;
  3. use app\admin\model\Protocol;
  4. use think\Controller;
  5. class Index extends Controller
  6. {
  7. /**
  8. * app端协议
  9. */
  10. public function privacy($t=1): string
  11. {
  12. $info = Protocol::where('type', $t)->find();
  13. $content = '';
  14. if($info) {
  15. $content = $info->content??'';
  16. }
  17. switch($t) {
  18. case 1:
  19. case 4:
  20. $title = 'APP服务协议';
  21. break;
  22. case 2:
  23. case 3:
  24. $title = 'APP隐私协议';
  25. break;
  26. case 5:
  27. $title = '关于我们';
  28. break;
  29. case 6:
  30. $title = '用户注册协议';
  31. break;
  32. default:
  33. $title = '其它政策协议';
  34. }
  35. $this->view->assign('content', $content);
  36. $this->view->assign('title', $title);
  37. return $this->view->fetch('index/privacy');
  38. }
  39. }