UtilController.class.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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 Seller\Controller;
  15. class UtilController extends CommonController{
  16. protected function _initialize(){
  17. parent::_initialize();
  18. $this->full = intval($_GPC['full']);
  19. $this->platform = trim($_GPC['platform']);
  20. $this->defaultUrl = trim($_GPC['url']);
  21. $this->allUrls = array(
  22. array(
  23. 'name' => '商城页面',
  24. 'list' => array(
  25. array('name' => '商城首页', 'url' => '/lionfish_comshop/pages/index/index', 'url_wxapp' => '/lionfish_comshop/pages/index/index'),
  26. array('name' => '购物车', 'url' => '/lionfish_comshop/pages/order/shopCart', 'url_wxapp' => '/lionfish_comshop/pages/order/shopCart'),
  27. array('name' => '团长申请页面', 'url' => '/lionfish_comshop/pages/groupCenter/apply', 'url_wxapp' => '/lionfish_comshop/pages/groupCenter/apply'),
  28. array('name' => '团长申请介绍页面', 'url' => '/lionfish_comshop/pages/groupCenter/recruit', 'url_wxapp' => '/lionfish_comshop/pages/groupCenter/recruit'),
  29. array('name' => '供应商申请页面', 'url' => '/lionfish_comshop/pages/supply/apply', 'url_wxapp' => '/lionfish_comshop/pages/supply/apply'),
  30. array('name' => '供应商介绍页面地址', 'url' => '/lionfish_comshop/pages/supply/recruit', 'url_wxapp' => '/lionfish_comshop/pages/supply/recruit'),
  31. array('name' => '会员表单信息收集页面', 'url' => '/lionfish_comshop/pages/form/apply', 'url_wxapp' => '/lionfish_comshop/pages/form/apply'),
  32. array('name' => '分类页', 'url' => '/lionfish_comshop/pages/type/index', 'url_wxapp' => '/lionfish_comshop/pages/type/index'),
  33. array('name' => '余额充值', 'url' => '/lionfish_comshop/pages/user/charge', 'url_wxapp' => '/lionfish_comshop/pages/user/charge'),
  34. array('name' => '视频商品列表', 'url' => '/lionfish_comshop/moduleA/video/index', 'url_wxapp' => '/lionfish_comshop/moduleA/video/index'),
  35. array('name' => '群接龙', 'url' => '/lionfish_comshop/moduleA/solitaire/index', 'url_wxapp' => '/lionfish_comshop/moduleA/solitaire/index'),
  36. ),
  37. ),
  38. /**
  39. array(
  40. 'name' => '商品属性',
  41. 'list' => array(
  42. array('name' => '分类搜索', 'url' => '/lionfish_comshop/pages/goods/search', 'url_wxapp' => '/lionfish_comshop/pages/goods/search'),
  43. ),
  44. ),
  45. **/
  46. array(
  47. 'name' => '会员中心',
  48. 'list' => array(
  49. array('name' => '会员中心', 'url' => '/lionfish_comshop/pages/user/me', 'url_wxapp' => '/lionfish_comshop/pages/user/me'),
  50. array('name' => '订单列表', 'url' => '/lionfish_comshop/pages/order/index', 'url_wxapp' => '/lionfish_comshop/pages/order/index'),
  51. array('name' => '关于我们', 'url' => '/lionfish_comshop/pages/user/articleProtocol?about=1', 'url_wxapp' => '/lionfish_comshop/pages/user/articleProtocol?about=1'),
  52. array('name' => '常见帮助', 'url' => '/lionfish_comshop/pages/user/protocol', 'url_wxapp' => '/lionfish_comshop/pages/user/protocol'),
  53. // array('name' => '订单列表', 'url' => '/lionfish_comshop/pages/order/pintuan', 'url_wxapp' => '/lionfish_comshop/pages/order/pintuan'),
  54. // array('name' => '拼团列表', 'url' => '/lionfish_comshop/pages/order/pintuan', 'url_wxapp' => '/lionfish_comshop/pages/order/pintuan'),
  55. // array('name' => '我的收藏', 'url' => '/lionfish_comshop/pages/dan/myfav', 'url_wxapp' => '/lionfish_comshop/pages/dan/myfav'),
  56. // array('name' => '我的优惠券', 'url' => '/lionfish_comshop/pages/dan/quan', 'url_wxapp' => '/lionfish_comshop/pages/dan/quan'),
  57. ),
  58. ),
  59. array(
  60. 'name' => '其他',
  61. 'list' => array(
  62. array('name' => '供应商列表', 'url' => '/lionfish_comshop/pages/supply/index', 'url_wxapp' => '/lionfish_comshop/pages/supply/index'),
  63. array('name' => '专题列表', 'url' => '/lionfish_comshop/moduleA/special/list', 'url_wxapp' => '/lionfish_comshop/pages/special/list'),
  64. array('name' => '拼团首页', 'url' => '/lionfish_comshop/moduleA/pin/index', 'url_wxapp' => '/lionfish_comshop/moduleA/pin/index'),
  65. array('name' => '付费会员首页', 'url' => '/lionfish_comshop/moduleA/vip/upgrade', 'url_wxapp' => '/lionfish_comshop/moduleA/vip/upgrade'),
  66. array('name' => '积分签到', 'url' => '/lionfish_comshop/moduleA/score/signin', 'url_wxapp' => '/lionfish_comshop/moduleA/score/signin'),
  67. array('name' => '菜谱', 'url' => '/lionfish_comshop/moduleA/menu/index', 'url_wxapp' => '/lionfish_comshop/moduleA/menu/index'),
  68. array('name' => '整点秒杀', 'url' => '/lionfish_comshop/moduleA/seckill/list', 'url_wxapp' => '/lionfish_comshop/moduleA/seckill/list'),
  69. array('name' => '直播列表', 'url' => '/lionfish_comshop/moduleB/live/index', 'url_wxapp' => '/lionfish_comshop/moduleB/live/index'),
  70. )
  71. )
  72. );
  73. }
  74. public function selecturl()
  75. {
  76. $platform = $this->platform;
  77. $full = $this->full;
  78. $allUrls = $this->allUrls;
  79. $this->display();
  80. }
  81. public function query()
  82. {
  83. $type = I('request.type');
  84. $kw = I('request.kw');
  85. $full = I('request.full');
  86. $platform = I('request.platform');
  87. $this->type = $type;
  88. $this->kw = $kw;
  89. $this->full = $full;
  90. $this->platform = $platform;
  91. if (!empty($kw) && !empty($type)) {
  92. if ($type == 'good') {
  93. $list = M()->query('SELECT id,goodsname as title,productprice,price as marketprice,sales,type FROM ' .
  94. C('DB_PREFIX') . 'lionfish_comshop_goods WHERE grounding=1 and total > 0
  95. AND goodsname LIKE "'.'%' . $kw . '%'.'" ');
  96. if (!empty($list)) {
  97. foreach ($list as &$val) {
  98. $thumb = M('lionfish_comshop_goods_images')->where( array('goods_id' => $val['id']) )->order('id asc')->find();
  99. $val['thumb'] = tomedia($thumb['image']);
  100. }
  101. }
  102. //$list = set_medias($list, 'thumb');
  103. //thumb
  104. } else if ($type == 'article') {
  105. $list = M('lionfish_comshop_article')->field('id,title')->where( " (title LIKE '%".$kw."%' or id like '%".$kw."%' ) and enabled=1" )->select();
  106. } else if ($type == 'coupon') {
  107. } else if ($type == 'groups') {
  108. } else if ($type == 'sns') {
  109. } else if ($type == 'url') {
  110. $list = $this->searchUrl($this->allUrls, "name", $kw);
  111. } else if ($type == 'special') {
  112. $list = M('lionfish_comshop_special')->field('id,name')->where("name LIKE '%{$kw}%' and enabled=1 ")->select();
  113. }
  114. else if ($type == 'category') {
  115. $list = M('lionfish_comshop_goods_category')->field('id,name')->where( " name LIKE '%{$kw}%' and is_show=1 " )->select();
  116. }
  117. else {
  118. if ($type == 'creditshop') {
  119. }
  120. }
  121. }
  122. $this->list = $list;
  123. $this->display('Util/selecturl_tpl');
  124. }
  125. }
  126. ?>