|
@@ -694,26 +694,22 @@ class goodsControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取detail(未启用)
|
|
|
- */
|
|
|
public function detailOp()
|
|
|
{
|
|
|
- return joutput_error(errcode::ErrProtocolDisabled);
|
|
|
+ $commonid = 0;
|
|
|
|
|
|
$goods_id = intval($_GET['goods_id']);
|
|
|
- if (empty($_GET['goods_id']) || $goods_id <= 0) {
|
|
|
+ if (empty($_GET['goods_id']) || $goods_id <= 0)
|
|
|
+ {
|
|
|
if (!empty($_GET['goods_commonid'])) {
|
|
|
$commonid = intval($_GET['goods_commonid']);
|
|
|
}
|
|
|
} else {
|
|
|
- $items = Model()->table('goods')->field('goods_commonid')->where(array('goods_id' => $goods_id))->limit(1)->select();
|
|
|
- if (!empty($items) && count($items) > 0) {
|
|
|
- $commonid = intval($items[0]['goods_commonid']);
|
|
|
- }
|
|
|
+ $info = Model('goods')->getGoodsInfoByID($goods_id,'goods_commonid');
|
|
|
+ $commonid = intval($info['goods_commonid']);
|
|
|
}
|
|
|
|
|
|
- if (isset($commonid) && $commonid > 0) {
|
|
|
+ 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']);
|