special.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/9/7
  6. * Time: 下午3:52
  7. */
  8. defined('InShopNC') or exit('Access Invalid!');
  9. require_once(BASE_ROOT_PATH . '/helper/goods_helper.php');
  10. require_once(BASE_ROOT_PATH . '/helper/special_helper.php');
  11. require_once(BASE_ROOT_PATH . '/helper/activity_helper.php');
  12. class specialControl extends mobileHomeControl
  13. {
  14. protected $mb_special;
  15. public function __construct() {
  16. parent::__construct();
  17. $this->mb_special = Model('mb_special');
  18. }
  19. public function indexOp()
  20. {
  21. $special_id = intval($_GET['special_id']);
  22. if($special_id <= 0) {
  23. return self::outerr(errcode::ErrParamter);
  24. }
  25. $special_id = intval($_GET['special_id']);
  26. $ret = $this->get_special($special_id);
  27. self::outsuccess($ret);
  28. }
  29. protected function get_special($special_id)
  30. {
  31. $helper = new special_helper($special_id);
  32. $specials = $helper->format($goods_ids);
  33. if (!empty($goods_ids))
  34. {
  35. $helper = new goods_helper();
  36. $goodsex = $helper->get_summary($goods_ids, $related_goods);
  37. return array('special_list' => $specials,
  38. 'summary' => $goodsex['summary'],
  39. 'groupbuy' => $goodsex['groupbuy'],
  40. 'limitime' => $goodsex['limitime'],
  41. 'bundling' => $goodsex['bundling'],
  42. 'mobile_page' => mobile_page(1));
  43. }
  44. else
  45. {
  46. return array('special_list' => $specials,
  47. 'summary' => array(),
  48. 'groupbuy' => array(),
  49. 'limitime' => array(),
  50. 'bundling' => array(),
  51. 'mobile_page' => mobile_page(1));
  52. }
  53. }
  54. }