获取平安核销的订单号
This commit is contained in:
@@ -15,6 +15,7 @@ class IndexController extends AdminController
|
||||
|
||||
/**
|
||||
* Notes:
|
||||
*
|
||||
* @Author: <C.Jason>
|
||||
* @Date : 2019/9/18 14:50
|
||||
* @return Grid
|
||||
@@ -27,9 +28,9 @@ class IndexController extends AdminController
|
||||
$grid->disableActions();
|
||||
|
||||
$grid->model()
|
||||
->with(['outlet.province', 'outlet.city', 'outlet.district', 'user', 'user.info'])
|
||||
->whereIn('status', [2, 3])
|
||||
->orderBy('id', 'desc');
|
||||
->with(['outlet.province', 'outlet.city', 'outlet.district', 'user', 'user.info'])
|
||||
->whereIn('status', [2, 3])
|
||||
->orderBy('id', 'desc');
|
||||
|
||||
$grid->filter(function ($filter) {
|
||||
$filter->column(1 / 2, function ($filter) {
|
||||
@@ -56,6 +57,7 @@ class IndexController extends AdminController
|
||||
}, '网点名称');
|
||||
|
||||
$filter->equal('type', '类型')->select(Coupon::TYPES);
|
||||
$filter->like('pa_order_id', '平安主订单号');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -64,11 +66,11 @@ class IndexController extends AdminController
|
||||
return $this->user->nickname;
|
||||
});
|
||||
$grid->column('type', '类型')
|
||||
->using(Coupon::TYPES)
|
||||
->label([
|
||||
'1' => 'info',
|
||||
'2' => 'success',
|
||||
]);
|
||||
->using(Coupon::TYPES)
|
||||
->label([
|
||||
'1' => 'info',
|
||||
'2' => 'success',
|
||||
]);
|
||||
|
||||
$grid->column('网点名称/编号')->display(function () {
|
||||
return $this->outlet ? $this->outlet->nickname : $this->outletId;
|
||||
@@ -79,19 +81,20 @@ class IndexController extends AdminController
|
||||
$grid->column('price', '核销金额');
|
||||
$grid->column('total', '订单金额');
|
||||
$grid->column('orderid', '订单id');
|
||||
$grid->column('pa_order_id', '平安主订单号')->hide();
|
||||
|
||||
$grid->column('资金通道结算')->display(function () {
|
||||
$profit = $this->status == 2 ? $this->profit : '0.00';
|
||||
|
||||
return '<span style="color:red">' . $profit . '</span>';
|
||||
return '<span style="color:red">'.$profit.'</span>';
|
||||
});
|
||||
$grid->column('状态')->display(function () {
|
||||
switch ($this->status) {
|
||||
case 2:
|
||||
return '<span style="color:green">' . $this->status_text . '</span>';
|
||||
return '<span style="color:green">'.$this->status_text.'</span>';
|
||||
break;
|
||||
case 3:
|
||||
return '<span style="color:red">' . $this->status_text . '</span>';
|
||||
return '<span style="color:red">'.$this->status_text.'</span>';
|
||||
break;
|
||||
default:
|
||||
return $this->status_text;
|
||||
@@ -123,13 +126,13 @@ class IndexController extends AdminController
|
||||
$success = $query->where('status', 2)->count();
|
||||
$faield = $total - $success;
|
||||
|
||||
return '<label class="label label-success">全部:' . $total . '张</label> '
|
||||
. '<label class="label label-success">成功:' . $success . '张</label> '
|
||||
. '<label class="label label-success">失败:' . $faield . '张</label> '
|
||||
. '<label class="label label-success">核销金额:' . $query->sum('price') . '元</label> '
|
||||
. '<label class="label label-success">资金通道结算:' . $query->sum('profit') . '元</label> '
|
||||
. '<label class="label label-success">打款金额:' . $query->where('is_profit', 1)
|
||||
->sum('profit') . '元</label> ';
|
||||
return '<label class="label label-success">全部:'.$total.'张</label> '
|
||||
.'<label class="label label-success">成功:'.$success.'张</label> '
|
||||
.'<label class="label label-success">失败:'.$faield.'张</label> '
|
||||
.'<label class="label label-success">核销金额:'.$query->sum('price').'元</label> '
|
||||
.'<label class="label label-success">资金通道结算:'.$query->sum('profit').'元</label> '
|
||||
.'<label class="label label-success">打款金额:'.$query->where('is_profit', 1)
|
||||
->sum('profit').'元</label> ';
|
||||
});
|
||||
$grid->disableExport(false);
|
||||
|
||||
@@ -141,13 +144,13 @@ class IndexController extends AdminController
|
||||
return strip_tags($value);
|
||||
});
|
||||
$export->column('redemptionCode', function ($value, $original) {
|
||||
return $value . "\t";
|
||||
return $value."\t";
|
||||
});
|
||||
// $export->column('price', function ($value, $original) {
|
||||
// return $value . "\t";
|
||||
// });
|
||||
$export->column('orderid', function ($value, $original) {
|
||||
return $value . "\t";
|
||||
return $value."\t";
|
||||
});
|
||||
// $export->column('total', function ($value, $original) {
|
||||
// return $value . "\t";
|
||||
@@ -155,7 +158,7 @@ class IndexController extends AdminController
|
||||
$export->column('资金通道结算', function ($value, $original) {
|
||||
return strip_tags($value);
|
||||
});
|
||||
$export->filename('卡券列表' . date("YmdHis"));
|
||||
$export->filename('卡券列表'.date("YmdHis"));
|
||||
});
|
||||
|
||||
return $grid;
|
||||
|
||||
Reference in New Issue
Block a user