|
@@ -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']);
|