feat: spu
This commit is contained in:
@@ -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 OptionalListService extends BaseService
|
||||
{
|
||||
public function handle()
|
||||
use CycleTrait;
|
||||
|
||||
/**
|
||||
* @var GoodCache
|
||||
*/
|
||||
#[Inject]
|
||||
protected GoodCache $goodCache;
|
||||
|
||||
/**
|
||||
* @return 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->getOptionalGoodList();
|
||||
|
||||
return $this->return->success('success', ['list' => $data]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user