mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-22 19:44:02 +08:00
35 lines
631 B
PHP
35 lines
631 B
PHP
<?php
|
|
|
|
namespace App\Services\Logic\Vip;
|
|
|
|
use App\Repos\Vip as VipRepo;
|
|
use App\Services\Logic\Service;
|
|
|
|
class OptionList extends Service
|
|
{
|
|
|
|
public function handle()
|
|
{
|
|
$vipRepo = new VipRepo();
|
|
|
|
$vips = $vipRepo->findAll(['deleted' => 0]);
|
|
|
|
if ($vips->count() == 0) {
|
|
return [];
|
|
}
|
|
|
|
$result = [];
|
|
|
|
foreach ($vips as $vip) {
|
|
$result[] = [
|
|
'id' => $vip->id,
|
|
'title' => $vip->title,
|
|
'expiry' => $vip->expiry,
|
|
'price' => $vip->price,
|
|
];
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
|
|
} |