Detail.php 797 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Heanup\App\Api\Controller;
  3. use Heanup\App\Api\Config\Site;
  4. use Heanup\App\Api\Controller;
  5. use Heanup\App\Api\Model\Dataoke;
  6. class Detail extends Controller
  7. {
  8. protected function main()
  9. {
  10. if (isMobile()) {
  11. header("location: /tao.php");
  12. die();
  13. }
  14. $id = $this->getQuery()->intval("id");
  15. $u = Site::getData("user_tag");
  16. $url = sprintf(Site::getData('site_url') . "/tao.php?r=l/d&id=%s&u=%s", $id, $u);
  17. $content= Dataoke::parse(file_get_contents($url));
  18. $this->setCache($content);
  19. }
  20. protected function after()
  21. {
  22. $id = $this->getQuery()->intval("id");
  23. $site_url = Site::getData('site_url') . "/product/" . $id . ".html";
  24. $this->addSitemap($site_url);
  25. }
  26. }