轮播图全路径
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
namespace app\admin\controller;
|
namespace app\admin\controller;
|
||||||
|
|
||||||
use app\common\controller\BaseController;
|
use app\common\controller\BaseController;
|
||||||
|
use app\common\service\OssService;
|
||||||
use app\common\traits\crud\CrudControllerTrait;
|
use app\common\traits\crud\CrudControllerTrait;
|
||||||
use app\common\service\BannerService;
|
use app\common\service\BannerService;
|
||||||
|
|
||||||
@@ -32,4 +33,24 @@ class BannerController extends BaseController
|
|||||||
return $this->error($e->getMessage());
|
return $this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表页数据格式化
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function indexFormat($data)
|
||||||
|
{
|
||||||
|
if (isset($data['created_at']))
|
||||||
|
$data['created_at'] = date('Y-m-d H:i:s', $data['created_at']);
|
||||||
|
if (isset($data['updated_at']))
|
||||||
|
$data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']);
|
||||||
|
if (isset($data['image_url']) && !empty($data['image_url'])){
|
||||||
|
$ossservice = new OssService();
|
||||||
|
$data['image_url_pull'] = $ossservice->generatePrivateUrl($data['image_url']);
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -79,9 +79,9 @@ class BasicDataService
|
|||||||
$cacheKey = self::SYSTEM_CODE_KEY;
|
$cacheKey = self::SYSTEM_CODE_KEY;
|
||||||
|
|
||||||
// 如果集合已存在,直接返回
|
// 如果集合已存在,直接返回
|
||||||
if (Redis::exists($cacheKey)) {
|
// if (Redis::exists($cacheKey)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
$systemCodes = $this->getAllSystemCodes();
|
$systemCodes = $this->getAllSystemCodes();
|
||||||
if (empty($systemCodes)) {
|
if (empty($systemCodes)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user