|
|
@@ -12,29 +12,33 @@ class Search extends Controller
|
|
|
{
|
|
|
public function main()
|
|
|
{
|
|
|
- $kw = $this->getQuery()->string("kw")?:$this->getQuery()->string("args_0");
|
|
|
+ $kw = $this->getQuery()->string("kw") ?: $this->getQuery()->string("args_0");
|
|
|
$bids = $this->getQuery()->string("bids");
|
|
|
$cid = $this->getQuery()->string("cid");
|
|
|
- $page = $this->getQuery()->string("args_1");
|
|
|
- $request=[
|
|
|
- 'r'=>'l',
|
|
|
- 'u'=>Site::getData("user_tag")
|
|
|
+ $request = [
|
|
|
+ 'r' => 'l',
|
|
|
+ 'u' => Site::getData("user_tag")
|
|
|
];
|
|
|
- if ($kw){
|
|
|
- $request['kw']=urldecode($kw);
|
|
|
+ if ($kw) {
|
|
|
+ $request['kw'] = urldecode($kw);
|
|
|
}
|
|
|
- if ($bids){
|
|
|
- $request['bids']=$bids;
|
|
|
+ if ($bids) {
|
|
|
+ $request['bids'] = $bids;
|
|
|
}
|
|
|
- if ($cid){
|
|
|
- $request['cid']=$cid;
|
|
|
+ if ($cid) {
|
|
|
+ $request['cid'] = $cid;
|
|
|
}
|
|
|
+ $page = $this->getQuery()->string("args_1");
|
|
|
if ($page){
|
|
|
- $request['page']=$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));
|
|
|
+ $url = Site::getData('site_url') . "/tao.php?" . http_build_query($request);
|
|
|
+ $content = Dataoke::parse(file_get_contents($url));
|
|
|
$this->setCache($content);
|
|
|
}
|
|
|
|