Files
bsh_info/app/admin/controller/BannerController.php
T

35 lines
852 B
PHP
Raw Normal View History

2025-11-24 16:34:56 +08:00
<?php
namespace app\admin\controller;
use app\common\controller\BaseController;
use app\common\traits\crud\CrudControllerTrait;
use app\common\service\BannerService;
class BannerController extends BaseController
{
use CrudControllerTrait;
protected $service;
public function __construct()
{
$this->service = new BannerService();
}
/**
* 轮播图模块
* @return \support\Response
*/
public function getBannerModule()
{
try {
$raw = $this->service->getBannerModule();
$data = $this->transformData($raw, method_exists($this, 'indexFormat')
? [$this, 'indexFormat']
: null);
return $this->success($data);
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
}