search.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * 圈子首页
  4. *
  5. *
  6. *********************************/
  7. defined('InShopNC') or exit('Access Invalid!');
  8. class searchControl extends BaseCircleControl{
  9. public function __construct(){
  10. parent::__construct();
  11. Language::read('circle');
  12. $this->themeTop();
  13. }
  14. /**
  15. * 话题搜索
  16. */
  17. public function themeOp(){
  18. $model = Model();
  19. $where = array();
  20. if($_GET['keyword'] != ''){
  21. $where['theme_name'] = array('like', '%'.$_GET['keyword'].'%');
  22. }
  23. $count = $model->table('circle_theme')->where($where)->count();
  24. $theme_list = $model->table('circle_theme')->where($where)->page(10,$count)->order('theme_addtime desc')->select();
  25. Tpl::output('count', $count);
  26. Tpl::output('show_page', $model->showpage('2'));
  27. Tpl::output('theme_list', $theme_list);
  28. Tpl::output('search_sign', 'theme');
  29. $this->circleSEO(L('search_theme'));
  30. Tpl::showpage('search.theme');
  31. }
  32. /**
  33. * 圈子搜索
  34. */
  35. public function groupOp(){
  36. $model = Model();
  37. $where = array();
  38. $where['circle_status'] = 1;
  39. if($_GET['keyword'] != ''){
  40. $where['circle_name|circle_tag'] = array('like', '%'.$_GET['keyword'].'%');
  41. }
  42. if(intval($_GET['class_id']) > 0){
  43. $where['class_id'] = intval($_GET['class_id']);
  44. }
  45. $count = $model->table('circle')->where($where)->count();
  46. $circle_list = $model->table('circle')->where($where)->page(10,$count)->select();
  47. Tpl::output('count', $count);
  48. Tpl::output('circle_list', $circle_list);
  49. Tpl::output('show_page', $model->showpage('2'));
  50. Tpl::output('search_sign', 'group');
  51. $this->circleSEO(L('search_circle'));
  52. Tpl::showpage('search.group');
  53. }
  54. }