Detail.php 700 B

1234567891011121314151617181920212223242526272829
  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. $id = $this->getQuery()->intval("id");
  11. $u = Site::getData("user_tag");
  12. $url = sprintf(Site::getData('site_url') . "/tao.php?r=l/d&id=%s&u=%s", $id, $u);
  13. $content= Dataoke::parse(file_get_contents($url));
  14. $this->setCache($content);
  15. }
  16. protected function after()
  17. {
  18. $id = $this->getQuery()->intval("id");
  19. $site_url = Site::getData('site_url') . "/product/" . $id . ".html";
  20. $this->addSitemap($site_url);
  21. }
  22. }