登录
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
namespace app\common\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\model\Country;
|
||||
use app\common\model\SysAccount;
|
||||
use app\common\model\SysCurrency;
|
||||
use app\common\model\User;
|
||||
use app\common\service\OssService;
|
||||
use app\common\traits\crud\CrudControllerTrait;
|
||||
use app\common\service\FinReceiptHisService;
|
||||
use support\Request;
|
||||
|
||||
class FinReceiptHisController extends BaseController
|
||||
{
|
||||
use CrudControllerTrait;
|
||||
|
||||
protected $service;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->service = new FinReceiptHisService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表页数据格式化
|
||||
*
|
||||
* @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['arrived_at']))
|
||||
$data['arrived_at'] = date('Y-m-d H:i:s', $data['arrived_at']);
|
||||
if (isset($data['received_at']))
|
||||
$data['received_at'] = date('Y-m-d H:i:s', $data['received_at']);
|
||||
if (isset($data['account_id'])) { //收款账号
|
||||
$data['account_name'] = SysAccount::where('id', $data['account_id'])->value('account_name')??'';
|
||||
$data['account_short_desc'] = SysAccount::where('id', $data['account_id'])->value('short_desc')??'';
|
||||
}
|
||||
if (isset($data['country_id'])) //付款来源国家
|
||||
$data['country_name'] = Country::where('id', $data['country_id'])->value('cn_addr')??'';
|
||||
if (isset($data['currency_id'])) //付款币种
|
||||
$data['currency_name'] = SysCurrency::where('id', $data['currency_id'])->value('currency_name')??'';
|
||||
if (!empty($data['fx_receipt_file'])){
|
||||
$data['fx_receipt_file_full'] = (new OssService)->generatePrivateUrl($data['fx_receipt_file']);
|
||||
}elseif (isset($data['fx_receipt_file'])){
|
||||
$data['fx_receipt_file_full'] = '';
|
||||
}
|
||||
|
||||
if (isset($data['created_by']))
|
||||
$data['created_by'] = User::where('id', $data['created_by'])->value('name')??'';
|
||||
if (isset($data['updated_by']))
|
||||
$data['updated_by'] = User::where('id', $data['updated_by'])->value('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['arrived_at']))
|
||||
$data['arrived_at'] = date('Y-m-d H:i:s', $data['arrived_at']);
|
||||
if (isset($data['received_at']))
|
||||
$data['received_at'] = date('Y-m-d H:i:s', $data['received_at']);
|
||||
if (isset($data['account_id'])){ //收款账号
|
||||
$data['account_name'] = SysAccount::where('id', $data['account_id'])->value('account_name')??'';
|
||||
$data['account_short_desc'] = SysAccount::where('id', $data['account_id'])->value('short_desc')??'';
|
||||
}
|
||||
if (isset($data['country_id'])) //付款来源国家
|
||||
$data['country_name'] = Country::where('id', $data['country_id'])->value('cn_addr')??'';
|
||||
if (isset($data['currency_id'])) //付款币种
|
||||
$data['currency_name'] = SysCurrency::where('id', $data['currency_id'])->value('currency_name')??'';
|
||||
if (!empty($data['fx_receipt_file'])){
|
||||
$data['fx_receipt_file_full'] = (new OssService)->generatePrivateUrl($data['fx_receipt_file']);
|
||||
}elseif (isset($data['fx_receipt_file'])){
|
||||
$data['fx_receipt_file_full'] = '';
|
||||
}
|
||||
|
||||
if (isset($data['created_by']))
|
||||
$data['created_by'] = User::where('id', $data['created_by'])->value('name')??'';
|
||||
if (isset($data['updated_by']))
|
||||
$data['updated_by'] = User::where('id', $data['updated_by'])->value('name')??'';
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user