Fix
parent
e298e35fc2
commit
6b7e59147a
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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> 待结算";
|
||||
}
|
||||
|
||||
return "<i class='fa fa-circle' style='font-size: 13px;color: {$v->color()}'></i> {$v->text()}";
|
||||
});
|
||||
$grid->column('created_at', '创建时间');
|
||||
$grid->column('id', '操作')->display('查看')->link(function ($value) {
|
||||
return admin_route('dealer_earnings.show', ['dealer_earning' => $this->id]);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue