6
0
Fork 0
release
李静 2022-03-28 10:59:48 +08:00
parent e298e35fc2
commit 6b7e59147a
4 changed files with 13 additions and 14 deletions

View File

@ -70,7 +70,7 @@ class DealerEarningPay extends AbstractTool
$action = DealerWalletAction::PurchaseSubsidyIn;
break;
}
$walletService->changeBalance($earning->user, $earning->total_earnings, $action, '收入-'.$earning->type_name, $earning);
$walletService->changeBalance($earning->user, $earning->total_earnings, $action, '收入-'.$earning->earningable_type_text, $earning);
DB::commit();
} catch (Throwable $th) {
DB::rollBack();

View File

@ -68,7 +68,7 @@ class DealerEarningPay extends Form implements LazyRenderable
break;
}
$walletService->changeBalance($earning->user, $earning->total_earnings, $action, '收入-'.$earning->type_name, $earning);
$walletService->changeBalance($earning->user, $earning->total_earnings, $action, '收入-'.$earning->earningable_type_text, $earning);
DB::commit();
} catch (Throwable $th) {
DB::rollBack();

View File

@ -11,7 +11,7 @@ class DealerEarningSimpleTable extends LazyRenderable
{
public function grid(): Grid
{
$userId = $this->payload['id']??0;
$userId = $this->payload['id'] ?? 0;
$builder = DealerEarning::query();
// dd($userId);
$builder->with(['user', 'payer'])->where(function ($q) use ($userId) {
@ -22,8 +22,8 @@ class DealerEarningSimpleTable extends LazyRenderable
$grid->column('payer_id', '付款人')->display(function () {
return $this->payer_id ? $this->payer?->phone : '公司';
});
$grid->column('type_name', '资金类型')->display(function () {
return $this->type_name;
$grid->column('earningable_type_text', '资金类型')->display(function () {
return $this->earningable_type_text;
})->label();
$grid->column('remark', '备注')->display('详情') // 设置按钮名称
->expand(function () {
@ -39,14 +39,13 @@ class DealerEarningSimpleTable extends LazyRenderable
// $grid->column('fee_rate', '手续费率')->append('%');
// $grid->column('fee', '手续费')->prepend('¥');
$grid->column('total_earnings', '实际金额')->prepend('¥');
$grid->column('status_format', '状态')->display(function ($value) {
return $this->status_format;
})->using([
-1=> '待结算',
0 => '待打款',
1 => '待收款',
2 => '已完成',
])->dot();
$grid->column('status', '状态')->display(function ($v) {
if (! $this->isSettled()) {
return "<i class='fa fa-circle' style='font-size: 13px;color: #b9c3cd'></i>&nbsp;&nbsp;待结算";
}
return "<i class='fa fa-circle' style='font-size: 13px;color: {$v->color()}'></i>&nbsp;&nbsp;{$v->text()}";
});
$grid->column('created_at', '创建时间');
$grid->column('id', '操作')->display('查看')->link(function ($value) {
return admin_route('dealer_earnings.show', ['dealer_earning' => $this->id]);

View File

@ -16,7 +16,7 @@ class DealerEarningSimpleResource extends JsonResource
{
return [
'id' => $this->id,
'type' => $this->type_name,
'type' => $this->earningable_type_text,
'created_at' => $this->created_at->toDateTimeString(),
'total_earnings'=> $this->total_earnings,
'status' => $this->status_format,