feat : wechatPay callback
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
namespace App\Service\Api\Good;
|
namespace App\Service\Api\Good;
|
||||||
|
|
||||||
use App\Cache\Redis\Api\GoodCache;
|
use App\Cache\Redis\Api\GoodCache;
|
||||||
|
use App\Cache\Redis\Api\SiteCache;
|
||||||
use App\Service\Api\BaseService;
|
use App\Service\Api\BaseService;
|
||||||
use App\Service\ServiceTrait\Common\CycleTrait;
|
use App\Service\ServiceTrait\Common\CycleTrait;
|
||||||
use Hyperf\Di\Annotation\Inject;
|
use Hyperf\Di\Annotation\Inject;
|
||||||
@@ -27,6 +28,13 @@ class MealListService extends BaseService
|
|||||||
#[Inject]
|
#[Inject]
|
||||||
protected GoodCache $goodCache;
|
protected GoodCache $goodCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var SiteCache
|
||||||
|
*/
|
||||||
|
#[Inject]
|
||||||
|
protected SiteCache $siteCache;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array|array[]
|
* @return array|array[]
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
@@ -36,10 +44,14 @@ class MealListService extends BaseService
|
|||||||
{
|
{
|
||||||
$cycleId = $this->initTodayCycleId();
|
$cycleId = $this->initTodayCycleId();
|
||||||
|
|
||||||
if (empty($cycleId)) return ['list' => []];
|
if (empty($cycleId)) return $this->return->success('success', ['list' => []]);
|
||||||
|
|
||||||
|
$siteInfo = $this->siteCache->getSiteInfo((int)$this->request->input('site_id'));
|
||||||
|
|
||||||
|
if (empty($siteInfo) || empty($siteInfo['kitchen_id'])) return $this->return->success('success', ['list' => []]);
|
||||||
|
|
||||||
$this->goodCache->cycleId = (int)$cycleId;
|
$this->goodCache->cycleId = (int)$cycleId;
|
||||||
$this->goodCache->kitchenId = (int)$this->request->input('kitchen_id');
|
$this->goodCache->kitchenId = (int)$siteInfo['kitchen_id'];
|
||||||
$data = $this->goodCache->getMealGoodList();
|
$data = $this->goodCache->getMealGoodList();
|
||||||
|
|
||||||
return $this->return->success('success', ['list' => $data]);
|
return $this->return->success('success', ['list' => $data]);
|
||||||
|
|||||||
Reference in New Issue
Block a user