feat: sku

This commit is contained in:
2025-01-22 11:37:42 +08:00
parent 7f09afacaf
commit 911c4fcf70
3 changed files with 43 additions and 10 deletions

View File

@@ -10,12 +10,38 @@ declare(strict_types=1);
namespace App\Service\Api\Good;
use App\Cache\Redis\Api\GoodCache;
use App\Service\Api\BaseService;
use App\Service\ServiceTrait\Common\CycleTrait;
use Hyperf\Di\Annotation\Inject;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class MealListService extends BaseService
{
public function handle()
use CycleTrait;
/**
* @var GoodCache
*/
#[Inject]
protected GoodCache $goodCache;
/**
* @return array|array[]
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function handle(): array
{
//todo Write logic
$cycleId = $this->initTodayCycleId();
if (empty($cycleId)) return ['list' => []];
$this->goodCache->cycleId = (int)$cycleId;
$this->goodCache->kitchenId = (int)$this->request->input('kitchen_id');
$data = $this->goodCache->getMealGoodList();
return $this->return->success('success', ['list' => $data]);
}
}