feat : catering
This commit is contained in:
46
app/Service/Admin/Catering/Option/CycleListService.php
Normal file
46
app/Service/Admin/Catering/Option/CycleListService.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin\Catering\Option;
|
||||
|
||||
use App\Model\OrderMealCateringLog;
|
||||
use App\Model\OrderOptionCateringLog;
|
||||
use App\Service\Admin\Catering\CateringBaseService;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class CycleListService extends CateringBaseService
|
||||
{
|
||||
/**
|
||||
* @var OrderOptionCateringLog
|
||||
*/
|
||||
#[Inject]
|
||||
protected OrderOptionCateringLog $orderOptionCateringLogModel;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): array
|
||||
{
|
||||
$cycleCateringLogs = $this->orderOptionCateringLogModel
|
||||
->where('cycle_id',$this->cycleId)
|
||||
->select(['site_id','quantity','status','id'])
|
||||
->get();
|
||||
|
||||
$res = $this->buildResArr($cycleCateringLogs);
|
||||
|
||||
if (empty($res)) return $this->return->success('success',['list' => []]);
|
||||
|
||||
return $this->return->success('success',['list' => array_values($res)]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user