63 lines
1.9 KiB
PHP
63 lines
1.9 KiB
PHP
<?php
|
|
namespace app\admin\controller;
|
|
|
|
use app\common\controller\BaseController;
|
|
use app\common\model\Country;
|
|
use app\common\traits\crud\CrudControllerTrait;
|
|
use app\admin\service\SysCurrencyService;
|
|
|
|
class SysCurrencyController extends BaseController
|
|
{
|
|
use CrudControllerTrait;
|
|
|
|
protected $service;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->service = new SysCurrencyService();
|
|
}
|
|
|
|
/**
|
|
* 列表页数据格式化
|
|
*
|
|
* @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['last_updated']))
|
|
$data['last_updated'] = date('Y-m-d H:i:s', $data['last_updated']);
|
|
if (isset($data['country_id'])){
|
|
$data['country_name'] = Country::where('id',$data['country_id'])->value('item_label');
|
|
} else {
|
|
$data['country_name'] = '';
|
|
}
|
|
return $data;
|
|
}
|
|
|
|
/**
|
|
* 列表页数据格式化
|
|
*
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
protected function showFormat($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['last_updated']))
|
|
$data['last_updated'] = date('Y-m-d H:i:s', $data['last_updated']);
|
|
if (isset($data['country_id'])){
|
|
$data['country_name'] = Country::where('id',$data['country_id'])->value('item_label');
|
|
} else {
|
|
$data['country_name'] = '';
|
|
}
|
|
return $data;
|
|
}
|
|
} |