GeneralmallController.class.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * lionfish 商城系统
  4. *
  5. * ==========================================================================
  6. * @link http://www.liofis.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license http://www.liofis.com/license.html License
  9. * ==========================================================================
  10. * 商城模块
  11. * @author fish
  12. *
  13. */
  14. namespace Home\Controller;
  15. class GeneralmallController extends CommonController
  16. {
  17. protected function _initialize()
  18. {
  19. parent::_initialize();
  20. }
  21. public function get_index_info()
  22. {
  23. $_GPC = I('request.');
  24. $gid = isset($gpc['gid']) ? intval($gpc['gid']) : 0;
  25. $navigat_list = M('lionfish_comshop_generalmall_navigat')->field('id,navname,thumb,link,type,appid')->where("enabled=1")->order('displayorder desc')->select();
  26. if (!empty($navigat_list)) {
  27. foreach ($navigat_list as $key => $val) {
  28. $val['thumb'] = tomedia($val['thumb']);
  29. $navigat_list[$key] = $val;
  30. }
  31. } else {
  32. $navigat_list = array();
  33. }
  34. $slider_list = M('lionfish_comshop_generalmall_adv')->where(array('enabled' => 1, 'type' => 'slider'))->order('displayorder desc, id desc')->select();
  35. if (!empty($slider_list)) {
  36. foreach ($slider_list as $key => $val) {
  37. $val['image'] = tomedia($val['thumb']);
  38. $slider_list[$key] = $val;
  39. }
  40. } else {
  41. $slider_list = array();
  42. }
  43. $res = array();
  44. $res['navigat_list'] = $navigat_list;
  45. $res['slider_list'] = $slider_list;
  46. $res['shoname'] = D('Home/Front')->get_config_by_name('shoname');
  47. $res['theme'] = D('Home/Front')->get_config_by_name('index_list_theme_type');
  48. $res['index_type_first_name'] = D('Home/Front')->get_config_by_name('index_type_first_name');
  49. $res['category_list'] = D('Home/GoodsCategory')->get_index_goods_category($gid);
  50. $res['index_list_top_image'] = "";
  51. $index_list_top_image = D('Home/Front')->get_config_by_name('index_list_top_image');
  52. if( !empty($res['index_list_top_image']) )
  53. {
  54. $res['index_list_top_image'] = tomedia($index_list_top_image);
  55. }
  56. $res['index_list_top_image_on'] = D('Home/Front')->get_config_by_name('index_list_top_image_on');
  57. $tabbar_out_type = D('Home/Front')->get_config_by_name('tabbar_out_type');
  58. $res['showTabbar'] = $tabbar_out_type==8 ? true: false;
  59. $res['is_show_list_timer'] = D('Home/Front')->get_config_by_name('is_show_list_timer');
  60. $res['is_show_list_count'] = D('Home/Front')->get_config_by_name('is_show_list_count');
  61. $result = array('code' => 0, 'data' => $res);
  62. echo json_encode($result);
  63. die();
  64. }
  65. }