初始化

缺陷:主题配色需要优化整体的同风格
This commit is contained in:
2026-08-14 23:21:21 +08:00
parent 6e2769c528
commit bcf54c2727
152 changed files with 13521 additions and 141 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Service\wx;
use App\BaseApp\BaseWxService;
use App\Models\business\CarouselModel;
use App\Models\business\CategoryModel;
/**
* 小程序首页:轮播与一级分类,都不要求登录
*/
class WxHomeService extends BaseWxService
{
protected bool $needLogin = false;
public function carousel(): mixed
{
// 只返回启用中的轮播;后台 status=1 表示隐藏
return CarouselModel::where('deleted_at', 0)
->where('status', 0)
->orderBy('sort', 'asc')
->get(['id', 'url', 'to_path', 'sort']);
}
/**
* 分类列表pid=0 为一级
* sort 升序,同值按 id需已执行 05_cc_category_add_sort.sql
*/
public function categoryList(int $pid = 0): mixed
{
return CategoryModel::where('pid', $pid)
->where('deleted_at', 0)
->orderBy('sort', 'asc')
->orderBy('id', 'asc')
->get();
}
}