40 lines
894 B
PHP
40 lines
894 B
PHP
<?php
|
|
/**
|
|
* This service file is part of item.
|
|
*
|
|
* @author ctexthuang
|
|
* @contact ctexthuang@qq.com
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Service\Admin\Good;
|
|
|
|
use App\Model\Cycle;
|
|
use App\Service\Admin\BaseService;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
|
|
class CycleService extends BaseService
|
|
{
|
|
/**
|
|
* @var Cycle $cycleModel
|
|
*/
|
|
#[Inject]
|
|
protected Cycle $cycleModel;
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function handle(): array
|
|
{
|
|
$arr = $this->cycleModel->whereBetween('dates',[
|
|
date('Y-m-d',strtotime('-10 day',time())),
|
|
date('Y-m-d',strtotime('+10 day',time())),
|
|
])->orderBy('dates')->select(['id','dates'])->get();
|
|
if (empty($arr)) return $this->return->success('success',['list' => []]);
|
|
|
|
$arr = $arr->toArray();
|
|
|
|
return $this->return->success('success',['list' => $arr]);
|
|
}
|
|
} |