更新若干功能

This commit is contained in:
2026-08-19 08:16:49 +08:00
parent 4979bb83d2
commit 72bc6502eb
56 changed files with 3627 additions and 343 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Http\Controllers\Wx;
use App\BaseApp\BaseController;
use App\Service\wx\WxPackageService;
use Illuminate\Http\JsonResponse;
/**
* 小程序套餐(热门/列表/详情免登录,一件加入走 Service 内登录校验)
*/
class PackageController extends BaseController
{
protected array $exceptRoute = ['option', 'create', 'update', 'delete'];
public function __construct()
{
parent::__construct();
$this->service = WxPackageService::getInstance();
}
/**
* 首页热门套餐
* @Method GET
*/
public function hot(): JsonResponse
{
return jok($this->service->hot());
}
/**
* 套餐详情p_user_id 为代理商分享来源(与商品详情同一套)
* @Method GET
*/
public function detail(): JsonResponse
{
return jok($this->service->detail(
(int) request()->get('id', 0),
(int) request()->get('p_user_id', 0)
));
}
/**
* 一件加入清单
* @Method POST
*/
public function toList(): JsonResponse
{
return jok($this->service->toList(request()->post()), '已加入清单');
}
}