1.缺失信息提交

This commit is contained in:
2025-05-07 12:18:08 +08:00
parent 4da5dc858a
commit 62532ca66a
4 changed files with 729 additions and 0 deletions

View File

@ -0,0 +1,90 @@
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\api\controller;
use app\api\logic\GoodsLogic;
class GoodsController extends BaseApiController
{
public array $notNeedLogin = ['getgoodsdetail', 'getgoodslist','getbestlist','gethostlist','getsearchpage'];
/**
* note 商品列表
* create_time 2020/10/20 11:12
*/
public function getGoodsList(){
$get = $this->request->get();
$goods_list = GoodsLogic::getGoodsList($this->user_id, $get, $this->page_no, $this->page_size);
$this->success('获取成功',$goods_list);
}
/**
* note 商品详情
* create_time 2020/10/20 11:12
*/
public function getGoodsDetail(){
$id = $this->request->get('id');
$goods = GoodsLogic::getGoodsDetail($this->user_id,$id);
if($goods){
$this->_success('获取成功',$goods);
}
$this->_error('商品不存在',[],0,0);
}
/**
* note 首页好物优选
* create_time 2020/10/21 19:04
*/
public function getBestList() {
$goods_list = GoodsLogic::getBestList($this->page_no, $this->page_size);
$this->_success('获取成功', $goods_list);
}
/**
* note 热销商品
* create_time 2020/11/17 9:52
*/
public function getHostList(){
$goods_list = GoodsLogic::getHostList($this->page_no, $this->page_size);
$this->_success('获取成功', $goods_list);
}
/**
* note 获取搜索页数据
* create_time 2020/10/22 16:01
*/
public function getSearchPage(){
$limit = $this->request->get('limit ',10);
$list = GoodsLogic::getSearchPage($this->user_id,$limit);
$this->_success('',$list);
}
/**
* note 清空搜索记录
* create_time 2020/12/18 10:26
*/
public function clearSearch(){
$result = GoodsLogic::clearSearch($this->user_id);
if($result){
$this->_success('清理成功','');
}
$this->_error('清理失败','');
}
}