123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- // +----------------------------------------------------------------------
- // | Niucloud-mall 企业快速开发的多应用管理平台
- // +----------------------------------------------------------------------
- // | 官方网址:https://www.niucloud.com
- // +----------------------------------------------------------------------
- // | niucloud团队 版权所有 开源版本可自由商用
- // +----------------------------------------------------------------------
- // | Author: Niucloud Team
- // +----------------------------------------------------------------------
- namespace app\api\controller\shop;
- use app\service\api\shop\ShopMemberService;
- use app\service\api\shop\ShopService;
- use core\base\BaseApiController;
- use think\Response;
- class Shop extends BaseApiController
- {
- /**
- * 店铺列表
- * @return Response
- */
- public function lists()
- {
- $data = $this->request->params([
- ['keyword', ''],
- ['group_id', ''],
- ['category_id', ''],
- ['is_self', ''],
- ]);
- return success((new ShopService())->getPage($data));
- }
- /**
- * 甄选好店列表(web端)
- * @return Response
- */
- public function selectShopLists()
- {
- return success((new ShopService())->getSelectShopLists());
- }
- /**
- * 店铺列表(wap端)
- * @return Response
- */
- public function shopLists()
- {
- $data = $this->request->params([
- ['keyword', ''],
- ['group_id', ''],
- ['category_id', ''],
- ['is_self', ''],
- ]);
- return success((new ShopService())->getShopPage($data));
- }
- /**
- * 店铺列表
- * @return Response
- */
- public function all()
- {
- $data = $this->request->params([
- ['limit', 0],
- ]);
- return success((new ShopService())->getAll($data['limit']));
- }
- /**
- * 店铺详情
- * @param int $id
- * @return Response
- */
- public function info($id)
- {
- return success((new ShopService())->getInfo($id));
- }
- /**
- * 店铺关注
- * @return Response
- */
- public function follow($id, $is_follow)
- {
- (new ShopMemberService())->follow($id, $is_follow);
- return success('SUCCESS');
- }
- /**
- * 获取店铺列表供组件调用
- * @return Response
- */
- public function components()
- {
- $data = $this->request->params([
- [ 'num', 0 ],
- [ 'site_ids', '' ],
- [ 'category_id', 0 ],
- [ 'order', '' ] // 排序方式
- ]);
- return success(( new ShopService() )->getShopComponents($data));
- }
- /**
- * 获取店铺二维码
- */
- public function qrcode($id){
- return success(data: (new ShopService())->getQrcode($id));
- }
- }
|