goods.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/3/18
  6. * Time: 下午10:11
  7. */
  8. defined('InShopNC') or exit('Access Invalid!');
  9. class goodsControl extends mobileControl
  10. {
  11. public function __construct()
  12. {
  13. parent::__construct();
  14. }
  15. public function detailOp()
  16. {
  17. $commonid = 0;
  18. $goods_id = intval($_GET['goods_id']);
  19. if (empty($_GET['goods_id']) || $goods_id <= 0) {
  20. if (!empty($_GET['goods_commonid'])) {
  21. $commonid = intval($_GET['goods_commonid']);
  22. }
  23. } else {
  24. $info = Model('goods')->getGoodsInfoByID($goods_id, 'goods_commonid');
  25. $commonid = intval($info['goods_commonid']);
  26. }
  27. if ($commonid > 0) {
  28. $items = Model()->table('goods_common')->field('goods_body')->where(array('goods_commonid' => $commonid))->select();
  29. if (!empty($items) && count($items) > 0) {
  30. Tpl::output('goods_body', $items[0]['goods_body']);
  31. }
  32. }
  33. Tpl::showpage('goods_detail');
  34. }
  35. }