Search.php 807 B

123456789101112131415161718192021222324252627282930313233343536
  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 Search extends Controller
  7. {
  8. protected function main()
  9. {
  10. $kw = $this->getQuery()->string("args_0");
  11. $bids = $this->getQuery()->string("bids");
  12. $cid = $this->getQuery()->string("cid");
  13. $request=[
  14. 'r'=>'l',
  15. 'u'=>Site::getData("user_tag")
  16. ];
  17. if ($kw){
  18. $request['kw']=urldecode($kw);
  19. }
  20. if ($bids){
  21. $request['bids']=$bids;
  22. }
  23. if ($cid){
  24. $request['cid']=$cid;
  25. }
  26. $url = Site::getData('site_url') . "/tao.php?".http_build_query($request);
  27. echo Dataoke::parse(file_get_contents($url));
  28. }
  29. }