38 lines
1012 B
PHP
38 lines
1012 B
PHP
<?php
|
|
namespace app\common\controller;
|
|
|
|
use app\common\controller\BaseController;
|
|
use app\common\service\OssService;
|
|
use app\common\traits\crud\CrudControllerTrait;
|
|
use app\common\service\PostCategoryService;
|
|
|
|
class PostCategoryController extends BaseController
|
|
{
|
|
use CrudControllerTrait;
|
|
|
|
protected $service;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->service = new PostCategoryService();
|
|
}
|
|
|
|
/**
|
|
* 列表页数据格式化
|
|
*
|
|
* @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 (!empty($data['icon'])){
|
|
$ossservice = new OssService();
|
|
$data['icon_pull'] = $ossservice->generatePrivateUrl($data['icon']);
|
|
}
|
|
return $data;
|
|
}
|
|
} |