| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Heanup\App\Api\Controller;
- use Heanup\App\Api\Config\Site;
- use Heanup\App\Api\Controller;
- use Heanup\App\Api\Model\Dataoke;
- class Search extends Controller
- {
- public function main()
- {
- $kw = $this->getQuery()->string("kw") ?: $this->getQuery()->string("args_0");
- $bids = $this->getQuery()->string("bids");
- $cid = $this->getQuery()->string("cid");
- $request = [
- 'r' => 'l',
- 'u' => Site::getData("user_tag")
- ];
- if ($kw) {
- $request['kw'] = urldecode($kw);
- }
- if ($bids) {
- $request['bids'] = $bids;
- }
- if ($cid) {
- $request['cid'] = $cid;
- }
- $page = $this->getQuery()->string("args_1");
- if ($page){
- $request['page'] = $page;
- }
- $sort = $this->getQuery()->string("s");
- if ($sort) {
- $request['s'] = $sort;
- }
- $url = Site::getData('site_url') . "/tao.php?" . http_build_query($request);
- $content = Dataoke::parse(file_get_contents($url));
- $this->setCache($content);
- }
- }
|