微调
This commit is contained in:
@@ -7,6 +7,8 @@ use App\Admin\Actions\User\Profit;
|
||||
use App\Admin\Actions\User\ReCode;
|
||||
use App\Admin\Actions\User\RefD3Key;
|
||||
use App\Admin\Exporters\UsersExport;
|
||||
use App\Admin\Renderable\Unionpay\InData;
|
||||
use App\Admin\Renderable\Unionpay\OutData;
|
||||
use App\Models\Area;
|
||||
use App\Models\UnionpayLog;
|
||||
use App\Models\User;
|
||||
@@ -52,42 +54,30 @@ class IndexController extends AdminController
|
||||
->using(config('unionpay.type'))
|
||||
->label();
|
||||
|
||||
$grid->column('msg_crrltn_id', '消息关联号');
|
||||
// $grid->column('msg_crrltn_id', '消息关联号');
|
||||
$grid->column('msg_time', '报文日期');
|
||||
$grid->column('mkt_code', '券码');
|
||||
$grid->column('msg_sys_sn', '平台流水号');
|
||||
$grid->column('req_serial_no', '查询流水号');
|
||||
$grid->column('req_serial_no', '流水号');
|
||||
$grid->column('orig_req_serial_no', '原流水号');
|
||||
$grid->column('status', '状态')
|
||||
->using(UnionpayLog::STATUS)
|
||||
->label();
|
||||
->label([
|
||||
0 => 'success',
|
||||
1 => 'warning',
|
||||
]);
|
||||
|
||||
// $grid->column('请求参数')->display(function ($title, $column) {
|
||||
// return '点击展开';
|
||||
// })->modal(function ($model) {
|
||||
// $in_source = $this->in_source;
|
||||
// if (is_array($in_source) && count($in_source) > 1) {
|
||||
// foreach ($in_source as $key => $item) {
|
||||
// dump($this->id);
|
||||
// $title[] = $key;
|
||||
// $data[] = $item;
|
||||
// }
|
||||
//
|
||||
// return new Table($title, $data);
|
||||
// }
|
||||
// });
|
||||
$grid->column('in_source', '请求参数')
|
||||
->display(function ($title, $column) {
|
||||
return '点击展开';
|
||||
})->modal(InData::class);
|
||||
|
||||
$grid->column('请求参数')->display(function () {
|
||||
$in_source = $this->in_source;
|
||||
|
||||
return $in_source;
|
||||
})->hide();
|
||||
|
||||
$grid->column('返回信息')->display(function () {
|
||||
$out_source = $this->out_source;
|
||||
|
||||
return $out_source;
|
||||
})->hide();
|
||||
$grid->column('out_source', '返回参数')
|
||||
->display(function ($title, $column) {
|
||||
return '点击展开';
|
||||
})->modal(OutData::class);
|
||||
|
||||
// $grid->column('sett_date', '清算日期');
|
||||
$grid->column('created_at', '注册时间');
|
||||
$grid->disableExport(false);
|
||||
|
||||
|
||||
26
app/Admin/Renderable/Unionpay/InData.php
Normal file
26
app/Admin/Renderable/Unionpay/InData.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Renderable\Unionpay;
|
||||
|
||||
use App\Models\UnionpayLog;
|
||||
use App\Models\User;
|
||||
use Encore\Admin\Widgets\Table;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class InData implements Renderable
|
||||
{
|
||||
|
||||
public function render($key = null)
|
||||
{
|
||||
$log = UnionpayLog::find($key);
|
||||
$in_source = $log->in_source;
|
||||
|
||||
if (is_array($in_source) && count($in_source) > 1) {
|
||||
$table = new Table(['名称', '值'], $in_source, ['panel', ' panel-default']);
|
||||
|
||||
return $table->render();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
25
app/Admin/Renderable/Unionpay/OutData.php
Normal file
25
app/Admin/Renderable/Unionpay/OutData.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Renderable\Unionpay;
|
||||
|
||||
use App\Models\UnionpayLog;
|
||||
use Encore\Admin\Widgets\Table;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
|
||||
class OutData implements Renderable
|
||||
{
|
||||
|
||||
public function render($key = null)
|
||||
{
|
||||
$log = UnionpayLog::find($key);
|
||||
$out_source = $log->out_source;
|
||||
|
||||
if (is_array($out_source) && count($out_source) > 1) {
|
||||
unset($out_source['sign']);
|
||||
$table = new Table(['名称', '值'], $out_source, ['panel ', 'panel-success']);
|
||||
|
||||
return $table->render();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user