1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 20:52:44 +08:00
2023-12-04 19:46:54 +08:00

43 lines
875 B
PHP

<?php
/**
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
namespace App\Services\Logic\Vip;
use App\Repos\Vip as VipRepo;
use App\Services\Logic\Service as LogicService;
class OptionList extends LogicService
{
public function handle()
{
$vipRepo = new VipRepo();
$where = [
'published' => 1,
'deleted' => 0,
];
$vips = $vipRepo->findAll($where, 'price');
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;
}
}