商品详情接口优化

feat/task1-c-wallet
Devil 2019-08-31 20:35:19 +08:00
parent 9fb683f42e
commit 799cdaebca
1 changed files with 28 additions and 0 deletions

View File

@ -256,6 +256,12 @@ class Goods extends Common
*/ */
public function Favor() public function Favor()
{ {
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 是否登录 // 是否登录
$this->IsLogin(); $this->IsLogin();
@ -275,6 +281,12 @@ class Goods extends Common
*/ */
public function SpecType() public function SpecType()
{ {
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理 // 开始处理
$params = input('post.'); $params = input('post.');
return GoodsService::GoodsSpecType($params); return GoodsService::GoodsSpecType($params);
@ -290,6 +302,12 @@ class Goods extends Common
*/ */
public function SpecDetail() public function SpecDetail()
{ {
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理 // 开始处理
$params = input('post.'); $params = input('post.');
return GoodsService::GoodsSpecDetail($params); return GoodsService::GoodsSpecDetail($params);
@ -304,8 +322,18 @@ class Goods extends Common
*/ */
public function Comment() public function Comment()
{ {
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 参数 // 参数
$params = input(); $params = input();
if(empty($params['goods_id']))
{
return DataReturn('参数有误', -1);
}
// 分页 // 分页
$number = 10; $number = 10;