36 lines
1.0 KiB
PHP
Executable File
36 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\common\basics\Api;
|
|
use app\api\logic\MallNewsLogic;
|
|
use app\common\server\JsonServer;
|
|
|
|
class MallNews extends Api
|
|
{
|
|
public $like_not_need_login = ['list', 'detail'];
|
|
|
|
public function list()
|
|
{
|
|
if($this->request->isGet()) {
|
|
$page = $this->request->get('page_no', $this->page_no);
|
|
$size = $this->request->get('page_size', $this->page_size);
|
|
$data = MallNewsLogic::lists($page, $size);
|
|
return JsonServer::success('获取成功', $data);
|
|
}else{
|
|
return JsonServer::error('请求方式错误');
|
|
}
|
|
}
|
|
|
|
public function detail()
|
|
{
|
|
if($this->request->isGet()) {
|
|
$id = $this->request->get('id');
|
|
$mall_type = $this->request->get('mall_type');
|
|
$data = MallNewsLogic::detail($id, $mall_type);
|
|
return JsonServer::success('获取成功', $data);
|
|
}else{
|
|
return JsonServer::error('请求方式错误');
|
|
}
|
|
}
|
|
} |