stanley-king 7 lat temu
rodzic
commit
7aed92ad67
2 zmienionych plików z 46 dodań i 1 usunięć
  1. 1 1
      helper/predeposit_helper.php
  2. 45 0
      mobile/control/goods_common.php

+ 1 - 1
helper/predeposit_helper.php

@@ -309,7 +309,7 @@ class predeposit_helper
         }
         else
         {
-            return $goods_price;
+            return ($goods_price * (100 - RateMoney::PRED_RATE) / 100);
         }
     }
 

+ 45 - 0
mobile/control/goods_common.php

@@ -110,6 +110,51 @@ class goods_commonControl extends mobileControl
         return $comments;
     }
 
+    public function detailOp()
+    {
+        $commonid = 0;
+        $goods_id = intval($_GET['goods_id']);
+        if (empty($_GET['goods_id']) || $goods_id <= 0) {
+            if (!empty($_GET['goods_commonid'])) {
+                $commonid = intval($_GET['goods_commonid']);
+            }
+        } else {
+            $info = Model('goods')->getGoodsInfoByID($goods_id, 'goods_commonid');
+            $commonid = intval($info['goods_commonid']);
+        }
+
+        if ($commonid > 0) {
+            $items = Model()->table('goods_common')->field('goods_body')->where(array('goods_commonid' => $commonid))->select();
+            if (!empty($items) && count($items) > 0) {
+                Tpl::output('goods_body', $items[0]['goods_body']);
+            }
+        }
+        Tpl::showpage('goods_detail');
+    }
+
+    public function detail_ajaxOp()
+    {
+        $commonid = 0;
+        $goods_id = intval($_GET['goods_id']);
+        if (empty($_GET['goods_id']) || $goods_id <= 0) {
+            if (!empty($_GET['goods_commonid'])) {
+                $commonid = intval($_GET['goods_commonid']);
+            }
+        } else {
+            $info = Model('goods')->getGoodsInfoByID($goods_id, 'goods_commonid');
+            $commonid = intval($info['goods_commonid']);
+        }
+
+        if ($commonid > 0) {
+            $items = Model()->table('goods_common')->field('goods_body')->where(array('goods_commonid' => $commonid))->select();
+            if (!empty($items) && count($items) > 0) {
+                return self::outsuccess(['body' => $items[0]['goods_body']]);
+            }
+        }
+
+        return self::outsuccess(null);
+    }
+
     public function commentsOp()
     {
         $common_id = intval($_GET['goods_commonid']);