Files
hyperf_service/app/Service/Api/Driver/GetSiteListService.php
2025-04-08 11:00:42 +08:00

53 lines
1.1 KiB
PHP

<?php
/**
* This service file is part of item.
*
* @author ctexthuang
* @contact ctexthuang@qq.com
*/
declare(strict_types=1);
namespace App\Service\Api\Driver;
use App\Constants\Admin\CateringCode;
use App\Constants\Common\GoodCode;
use App\Exception\ErrException;
use App\Model\OrderMealCateringLog;
use App\Model\OrderOptionCateringLog;
use App\Model\Site;
use App\Model\Sku;
use Hyperf\Di\Annotation\Inject;
class GetSiteListService extends BaseDriverService
{
/**
* @var Sku
*/
#[Inject]
protected Sku $skuModel;
/**
* @var array
*/
protected array $siteIds;
/**
* @return array
*/
public function handle(): array
{
$res = $this->getTodayList();
if (empty($res)) $res = $this->buildListData();
$status = $this->driverStatusModel->where('driver_id',$this->adminInfo->id)->where('cycle_id',$this->cycleId)->first();
return $this->return->success('success', ['list' => $res ,'status' => !empty($status)]);
}
// private function setCache() {} //todo 赶时间 后续优化
}