添加后台账户相关
parent
34c9fb81e1
commit
9d1e38014d
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Extensions\Grid\Tools\Balance\Deduction;
|
||||
use App\Admin\Extensions\Grid\Tools\Balance\Recharge;
|
||||
use App\Admin\Repositories\BalanceLog;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class BalanceLogController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = BalanceLog::with('user');
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->tools(function (Grid\Tools $tools) {
|
||||
$tools->append(new Recharge());
|
||||
$tools->append(new Deduction());
|
||||
});
|
||||
// $grid->column('id')->sortable();
|
||||
$grid->column('user.phone')->copyable();
|
||||
$grid->column('remarks');
|
||||
$grid->column('change_balance')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
});
|
||||
$grid->column('before_balance')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
});
|
||||
|
||||
$grid->column('created_at')->sortable();
|
||||
// $grid->column('updated_at')->sortable();
|
||||
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
|
||||
$grid->disableActions();
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel(false);
|
||||
$filter->equal('user.phone')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new BalanceLog(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('user_id');
|
||||
$show->field('before_balance');
|
||||
$show->field('change_balance');
|
||||
$show->field('remarks');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new BalanceLog(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->text('user_id');
|
||||
$form->text('before_balance');
|
||||
$form->text('change_balance');
|
||||
$form->text('remarks');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\DistributionPreIncome;
|
||||
use App\Models\DistributionPreIncome as DistributionPreIncomeModel;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class DistributionPreIncomeController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = DistributionPreIncome::with(['user', 'user.userInfo.inviterInfo.user', 'order']);
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
// $grid->column('id')->sortable();
|
||||
$grid->column('user.phone')->copyable();
|
||||
$grid->column('user.userInfo.inviterInfo.user.phone', '邀请人手机号')->copyable();
|
||||
$grid->column('order.sn')->copyable();
|
||||
$grid->column('type')->using(DistributionPreIncomeModel::$typeTexts)->label();
|
||||
$grid->column('agent_level')->display(function () {
|
||||
return $this->agent_level_name;
|
||||
})->label();
|
||||
$grid->column('total_amount');
|
||||
$grid->column('total_sales_value');
|
||||
$grid->column('total_revenue');
|
||||
$grid->column('status')->using(DistributionPreIncomeModel::$statusTexts)->dot([
|
||||
0=>'danger',
|
||||
1=>'danger',
|
||||
2=>'success',
|
||||
]);
|
||||
$grid->column('remarks');
|
||||
$grid->column('completed_at');
|
||||
$grid->column('created_at')->sortable();
|
||||
|
||||
$grid->model()->orderBy('order_id', 'desc');
|
||||
$grid->model()->orderBy('id', 'asc');
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel(false);
|
||||
$filter->equal('user.phone')->width(3);
|
||||
$filter->equal('order.sn')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new DistributionPreIncome(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('user_id');
|
||||
$show->field('order_id');
|
||||
$show->field('type');
|
||||
$show->field('agent_level');
|
||||
$show->field('total_amount');
|
||||
$show->field('total_sales_value');
|
||||
$show->field('total_revenue');
|
||||
$show->field('status');
|
||||
$show->field('remarks');
|
||||
$show->field('completed_at');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new DistributionPreIncome(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->text('user_id');
|
||||
$form->text('order_id');
|
||||
$form->text('type');
|
||||
$form->text('agent_level');
|
||||
$form->text('total_amount');
|
||||
$form->text('total_sales_value');
|
||||
$form->text('total_revenue');
|
||||
$form->text('status');
|
||||
$form->text('remarks');
|
||||
$form->text('completed_at');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ use App\Admin\Renderable\UserBalanceLogSimpleTable;
|
|||
use App\Admin\Renderable\UserFansSimpleTable;
|
||||
use App\Admin\Renderable\UserWalletLogSimpleTable;
|
||||
use App\Admin\Repositories\User;
|
||||
use App\Models\User as UserModel;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
|
|
@ -22,7 +23,8 @@ use Dcat\Admin\Layout\Row;
|
|||
use Dcat\Admin\Show;
|
||||
use Dcat\Admin\Widgets\Box;
|
||||
use Dcat\Admin\Widgets\Tab;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Request as RequestFacades;
|
||||
|
||||
class UserController extends AdminController
|
||||
{
|
||||
|
|
@ -196,7 +198,21 @@ class UserController extends AdminController
|
|||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
$form->hidden('register_ip')->value(Request::getClientIp());
|
||||
$form->hidden('register_ip')->value(RequestFacades::getClientIp());
|
||||
});
|
||||
}
|
||||
|
||||
public function users(Request $request)
|
||||
{
|
||||
$phone = $request->input('q');
|
||||
|
||||
$query = UserModel::select('id', 'phone as text');
|
||||
|
||||
if ($phone) {
|
||||
$query->where('phone', 'like', "%$phone%");
|
||||
return $query->paginate(null);
|
||||
}
|
||||
|
||||
return response()->json($query->get());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Extensions\Grid\Tools\Wallet\Deduction;
|
||||
use App\Admin\Extensions\Grid\Tools\Wallet\Recharge;
|
||||
use App\Admin\Repositories\WalletLog;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class WalletLogController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = WalletLog::with('user');
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->tools(function (Grid\Tools $tools) {
|
||||
$tools->append(new Recharge());
|
||||
$tools->append(new Deduction());
|
||||
});
|
||||
// $grid->column('id')->sortable();
|
||||
$grid->column('user.phone')->copyable();
|
||||
$grid->column('remarks');
|
||||
$grid->column('change_balance')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
});
|
||||
$grid->column('before_balance')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
});
|
||||
|
||||
$grid->column('created_at')->sortable();
|
||||
// $grid->column('updated_at')->sortable();
|
||||
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
|
||||
$grid->disableActions();
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel(false);
|
||||
$filter->equal('user.phone')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new WalletLog(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('user_id');
|
||||
$show->field('before_balance');
|
||||
$show->field('change_balance');
|
||||
$show->field('remarks');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new WalletLog(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->text('user_id');
|
||||
$form->text('before_balance');
|
||||
$form->text('change_balance');
|
||||
$form->text('remarks');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Extensions\Grid\Tools\Balance;
|
||||
|
||||
use App\Admin\Forms\BalanceDeduction;
|
||||
use Dcat\Admin\Grid\Tools\AbstractTool;
|
||||
use Dcat\Admin\Widgets\Modal;
|
||||
|
||||
class Deduction extends AbstractTool
|
||||
{
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.balance_logs.deduction');
|
||||
}
|
||||
|
||||
/**
|
||||
* 按钮样式定义,默认 btn btn-white waves-effect
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $style = 'btn btn btn-danger';
|
||||
|
||||
/**
|
||||
* 按钮文本
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
return '扣减';
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$form = BalanceDeduction::make();
|
||||
return Modal::make()
|
||||
->lg()
|
||||
->title($this->title())
|
||||
->body($form)
|
||||
->button($this->html());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求参数
|
||||
*
|
||||
* @return array|void
|
||||
*/
|
||||
public function parameters()
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Extensions\Grid\Tools\Balance;
|
||||
|
||||
use App\Admin\Forms\BalanceRecharge;
|
||||
use Dcat\Admin\Grid\Tools\AbstractTool;
|
||||
use Dcat\Admin\Widgets\Modal;
|
||||
|
||||
class Recharge extends AbstractTool
|
||||
{
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.balance_logs.recharge');
|
||||
}
|
||||
|
||||
/**
|
||||
* 按钮样式定义,默认 btn btn-white waves-effect
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $style = 'btn btn btn-warning';
|
||||
|
||||
/**
|
||||
* 按钮文本
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
return '充值';
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$form = BalanceRecharge::make();
|
||||
return Modal::make()
|
||||
->lg()
|
||||
->title($this->title())
|
||||
->body($form)
|
||||
->button($this->html());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求参数
|
||||
*
|
||||
* @return array|void
|
||||
*/
|
||||
public function parameters()
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Extensions\Grid\Tools\Wallet;
|
||||
|
||||
use App\Admin\Forms\WalletDeduction;
|
||||
use Dcat\Admin\Grid\Tools\AbstractTool;
|
||||
use Dcat\Admin\Widgets\Modal;
|
||||
|
||||
class Deduction extends AbstractTool
|
||||
{
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.wallet_logs.deduction');
|
||||
}
|
||||
|
||||
/**
|
||||
* 按钮样式定义,默认 btn btn-white waves-effect
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $style = 'btn btn btn-danger';
|
||||
|
||||
/**
|
||||
* 按钮文本
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
return '扣减';
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$form = WalletDeduction::make();
|
||||
return Modal::make()
|
||||
->lg()
|
||||
->title($this->title())
|
||||
->body($form)
|
||||
->button($this->html());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求参数
|
||||
*
|
||||
* @return array|void
|
||||
*/
|
||||
public function parameters()
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Extensions\Grid\Tools\Wallet;
|
||||
|
||||
use App\Admin\Forms\WalletRecharge;
|
||||
use Dcat\Admin\Grid\Tools\AbstractTool;
|
||||
use Dcat\Admin\Widgets\Modal;
|
||||
|
||||
class Recharge extends AbstractTool
|
||||
{
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.wallet_logs.recharge');
|
||||
}
|
||||
|
||||
/**
|
||||
* 按钮样式定义,默认 btn btn-white waves-effect
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $style = 'btn btn btn-warning';
|
||||
|
||||
/**
|
||||
* 按钮文本
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
return '充值';
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$form = WalletRecharge::make();
|
||||
return Modal::make()
|
||||
->lg()
|
||||
->title($this->title())
|
||||
->body($form)
|
||||
->button($this->html());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求参数
|
||||
*
|
||||
* @return array|void
|
||||
*/
|
||||
public function parameters()
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Forms;
|
||||
|
||||
use App\Models\BalanceLog;
|
||||
use App\Models\User;
|
||||
use App\Services\BalanceService;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Contracts\LazyRenderable;
|
||||
use Dcat\Admin\Traits\LazyWidget;
|
||||
use Dcat\Admin\Widgets\Form;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class BalanceDeduction extends Form implements LazyRenderable
|
||||
{
|
||||
use LazyWidget;
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.wallet_logs.deduction');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the form request.
|
||||
*
|
||||
* @param array $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(array $input)
|
||||
{
|
||||
if (($input['change_balance']??0) <=0) {
|
||||
return $this->response()->error('扣减金额必须大于0');
|
||||
}
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
//获取当前操作人;
|
||||
$adminUser = Admin::user();
|
||||
$user = User::findOrFail($input['user_id']??0);
|
||||
$balanceService = new BalanceService();
|
||||
$balanceService->changeBalance($user, -($input['change_balance']??0), BalanceLog::ACTION_ADMIN_DEDUCTION, '后台扣减', $adminUser);
|
||||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
report($th);
|
||||
return $this->response()->error('操作失败:'.$th->getMessage());
|
||||
}
|
||||
|
||||
return $this->response()
|
||||
->success(__('admin.update_succeeded'))
|
||||
->refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a form here.
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
$this->select('user_id', '用户手机号')->ajax(admin_route('api.users'))->required();
|
||||
$this->currency('change_balance', '扣减金额')->symbol('¥')->default(0)->saving(function ($value) {
|
||||
return bcmul($value, 100);
|
||||
})->required();
|
||||
$this->confirm('是否确认扣减可提?', '提交后该动作无法逆转');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Forms;
|
||||
|
||||
use App\Models\BalanceLog;
|
||||
use App\Models\User;
|
||||
use App\Services\BalanceService;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Contracts\LazyRenderable;
|
||||
use Dcat\Admin\Traits\LazyWidget;
|
||||
use Dcat\Admin\Widgets\Form;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class BalanceRecharge extends Form implements LazyRenderable
|
||||
{
|
||||
use LazyWidget;
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.wallet_logs.recharge');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the form request.
|
||||
*
|
||||
* @param array $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(array $input)
|
||||
{
|
||||
if (($input['change_balance']??0) <=0) {
|
||||
return $this->response()->error('充值金额必须大于0');
|
||||
}
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
//获取当前操作人;
|
||||
$adminUser = Admin::user();
|
||||
$user = User::findOrFail($input['user_id']??0);
|
||||
$balanceService = new BalanceService();
|
||||
$balanceService->changeBalance($user, $input['change_balance']??0, BalanceLog::ACTION_ADMIN_RECHARGE, '后台充值', $adminUser);
|
||||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
report($th);
|
||||
return $this->response()->error('操作失败:'.$th->getMessage());
|
||||
}
|
||||
|
||||
return $this->response()
|
||||
->success(__('admin.update_succeeded'))
|
||||
->refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a form here.
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
$this->select('user_id', '用户手机号')->ajax(admin_route('api.users'))->required();
|
||||
$this->currency('change_balance', '充值金额')->symbol('¥')->default(0)->saving(function ($value) {
|
||||
return bcmul($value, 100);
|
||||
})->required();
|
||||
$this->confirm('是否确认充值余额?', '提交后该动作无法逆转');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Forms;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\WalletLog;
|
||||
use App\Services\WalletService;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Contracts\LazyRenderable;
|
||||
use Dcat\Admin\Traits\LazyWidget;
|
||||
use Dcat\Admin\Widgets\Form;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class WalletDeduction extends Form implements LazyRenderable
|
||||
{
|
||||
use LazyWidget;
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.wallet_logs.deduction');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the form request.
|
||||
*
|
||||
* @param array $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(array $input)
|
||||
{
|
||||
if (($input['change_balance']??0) <=0) {
|
||||
return $this->response()->error('扣减金额必须大于0');
|
||||
}
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
//获取当前操作人;
|
||||
$adminUser = Admin::user();
|
||||
$user = User::findOrFail($input['user_id']??0);
|
||||
$walletService = new WalletService();
|
||||
$walletService->changeBalance($user, -($input['change_balance']??0), WalletLog::ACTION_ADMIN_DEDUCTION, '后台扣减', $adminUser);
|
||||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
report($th);
|
||||
return $this->response()->error('操作失败:'.$th->getMessage());
|
||||
}
|
||||
|
||||
return $this->response()
|
||||
->success(__('admin.update_succeeded'))
|
||||
->refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a form here.
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
$this->select('user_id', '用户手机号')->ajax(admin_route('api.users'))->required();
|
||||
$this->currency('change_balance', '扣减金额')->symbol('¥')->default(0)->saving(function ($value) {
|
||||
return bcmul($value, 100);
|
||||
})->required();
|
||||
$this->confirm('是否确认扣减可提?', '提交后该动作无法逆转');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Forms;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\WalletLog;
|
||||
use App\Services\WalletService;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Contracts\LazyRenderable;
|
||||
use Dcat\Admin\Traits\LazyWidget;
|
||||
use Dcat\Admin\Widgets\Form;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class WalletRecharge extends Form implements LazyRenderable
|
||||
{
|
||||
use LazyWidget;
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.wallet_logs.recharge');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the form request.
|
||||
*
|
||||
* @param array $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(array $input)
|
||||
{
|
||||
if (($input['change_balance']??0) <=0) {
|
||||
return $this->response()->error('充值金额必须大于0');
|
||||
}
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
//获取当前操作人;
|
||||
$adminUser = Admin::user();
|
||||
$user = User::findOrFail($input['user_id']??0);
|
||||
$walletService = new WalletService();
|
||||
$walletService->changeBalance($user, $input['change_balance']??0, WalletLog::ACTION_ADMIN_RECHARGE, '后台充值', $adminUser);
|
||||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
report($th);
|
||||
return $this->response()->error('操作失败:'.$th->getMessage());
|
||||
}
|
||||
|
||||
return $this->response()
|
||||
->success(__('admin.update_succeeded'))
|
||||
->refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a form here.
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
$this->select('user_id', '用户手机号')->ajax(admin_route('api.users'))->required();
|
||||
$this->currency('change_balance', '充值金额')->symbol('¥')->default(0)->saving(function ($value) {
|
||||
return bcmul($value, 100);
|
||||
})->required();
|
||||
$this->confirm('是否确认充值可提?', '提交后该动作无法逆转');
|
||||
}
|
||||
}
|
||||
|
|
@ -15,11 +15,7 @@ class DistributionPreIncomeSimpleTable extends LazyRenderable
|
|||
$builder->with('logs')->where('user_id', $userId);
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->column('remarks', '备注');
|
||||
$grid->column('status', '状态')->using([
|
||||
0=>'未结算',
|
||||
1=>'结算中',
|
||||
2=>'已结算',
|
||||
])->dot([
|
||||
$grid->column('status', '状态')->using(DistributionPreIncome::$statusTexts)->dot([
|
||||
0=>'danger',
|
||||
1=>'danger',
|
||||
2=>'success',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\BalanceLog as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class BalanceLog extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\DistributionPreIncome as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class DistributionPreIncome extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\WalletLog as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class WalletLog extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -123,6 +123,18 @@ Route::group([
|
|||
'index',
|
||||
])->names('wallet_to_bank_logs');
|
||||
|
||||
$router->resource('distribution-pre-incomes', 'DistributionPreIncomeController')->only([
|
||||
'index',
|
||||
])->names('distribution_pre_incomes');
|
||||
|
||||
$router->resource('wallet-logs', 'WalletLogController')->only([
|
||||
'index',
|
||||
])->names('wallet_logs');
|
||||
|
||||
$router->resource('balance-logs', 'BalanceLogController')->only([
|
||||
'index',
|
||||
])->names('balance_logs');
|
||||
|
||||
/** api接口 **/
|
||||
$router->get('api/product-categories', 'ProductCategoryController@categories')->name('api.product_categories');
|
||||
$router->get('api/product-group-details', 'ProductGroupController@details')->name('api.product_group_details');
|
||||
|
|
@ -131,4 +143,5 @@ Route::group([
|
|||
$router->get('api/coupone-send-tasks', 'CouponSendTaskController@tasks')->name('api.coupon_send_tasks');
|
||||
$router->get('api/orders', 'OrderController@orders')->name('api.orders');
|
||||
$router->get('api/order-products', 'OrderController@orderProducts')->name('api.order_products');
|
||||
$router->get('api/users', 'UserController@users')->name('api.users');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ class BalanceLog extends Model
|
|||
public const ACTION_WALLET_IN = 4;
|
||||
public const ACTION_TRANSFER_OUT = 5;
|
||||
public const ACTION_TRANSFER_IN = 6;
|
||||
public const ACTION_ADMIN_RECHARGE = 7;
|
||||
public const ACTION_ADMIN_DEDUCTION = 8;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
|
@ -31,6 +33,11 @@ class BalanceLog extends Model
|
|||
'remarks',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转账记录
|
||||
*
|
||||
|
|
|
|||
|
|
@ -92,6 +92,14 @@ class DistributionPreIncome extends Model
|
|||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 此预收益的所属订单
|
||||
*/
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(Order::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 此预收益的变更记录
|
||||
*/
|
||||
|
|
@ -99,4 +107,14 @@ class DistributionPreIncome extends Model
|
|||
{
|
||||
return $this->hasMany(DistributionPreIncomeLog::class, 'pre_income_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getAgentLevelNameAttribute()
|
||||
{
|
||||
return UserInfo::$agentLevelTexts[$this->agent_level] ?? '未知';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ class WalletLog extends Model
|
|||
public const ACTION_WITHDRAW_BANK = 4;
|
||||
public const ACTION_WITHDRAW_BALACNE = 5;
|
||||
public const ACTION_WITHDRAW_FAILED = 6;
|
||||
public const ACTION_ADMIN_RECHARGE = 7;
|
||||
public const ACTION_ADMIN_DEDUCTION = 8;
|
||||
public const ACTION_DISTRIBUTION_PRE_INCOME = 10;
|
||||
|
||||
/**
|
||||
|
|
@ -32,6 +34,16 @@ class WalletLog extends Model
|
|||
'remarks',
|
||||
];
|
||||
|
||||
/**
|
||||
* 此提现关联的用户
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现到余额的明细
|
||||
*
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
'wallet_to_bank_log' => \App\Models\WalletToBankLog::class,
|
||||
'balance_log' => \App\Models\BalanceLog::class,
|
||||
'distribution_pre_income' => \App\Models\DistributionPreIncome::class,
|
||||
'admin_users' => \App\Models\Admin\Administrator::class,
|
||||
]);
|
||||
|
||||
JsonResource::withoutWrapping();
|
||||
|
|
|
|||
|
|
@ -217,6 +217,26 @@ class AdminMenuSeeder extends Seeder
|
|||
'icon' => 'fa fa-jpy',
|
||||
'uri'=> '',
|
||||
'children'=>[
|
||||
[
|
||||
'title' =>'预收益',
|
||||
'icon' => '',
|
||||
'uri' => 'distribution-pre-incomes',
|
||||
],
|
||||
[
|
||||
'title' => '可提账户',
|
||||
'icon'=>'',
|
||||
'uri' => 'wallet-logs',
|
||||
],
|
||||
[
|
||||
'title' => '余额账户',
|
||||
'icon' => '',
|
||||
'uri' => 'balance-logs',
|
||||
],
|
||||
[
|
||||
'title' => '积分账户',
|
||||
'icon' => '',
|
||||
'uri' => 'points-logs',
|
||||
],
|
||||
[
|
||||
'title' =>'提现审核',
|
||||
'icon' => '',
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection amount
|
||||
* @property Grid\Column|Collection state
|
||||
* @property Grid\Column|Collection tracking_number
|
||||
* @property Grid\Column|Collection sales_value
|
||||
* @property Grid\Column|Collection v
|
||||
* @property Grid\Column|Collection cate
|
||||
* @property Grid\Column|Collection is_force
|
||||
|
|
@ -89,6 +90,7 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection total_expenses
|
||||
* @property Grid\Column|Collection total_revenue
|
||||
* @property Grid\Column|Collection transferable
|
||||
* @property Grid\Column|Collection is_frozen
|
||||
* @property Grid\Column|Collection continue_click_times
|
||||
* @property Grid\Column|Collection last_click_at
|
||||
* @property Grid\Column|Collection coupon_id
|
||||
|
|
@ -152,7 +154,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection after_expire_at
|
||||
* @property Grid\Column|Collection remain_quantity
|
||||
* @property Grid\Column|Collection gift_for_sku_id
|
||||
* @property Grid\Column|Collection sales_value
|
||||
* @property Grid\Column|Collection max
|
||||
* @property Grid\Column|Collection reason
|
||||
* @property Grid\Column|Collection user_coupon_id
|
||||
|
|
@ -166,6 +167,7 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection shipping_state
|
||||
* @property Grid\Column|Collection is_change
|
||||
* @property Grid\Column|Collection out_trade_no
|
||||
* @property Grid\Column|Collection auto_complete_at
|
||||
* @property Grid\Column|Collection payable_type
|
||||
* @property Grid\Column|Collection payable_id
|
||||
* @property Grid\Column|Collection tokenable_type
|
||||
|
|
@ -229,6 +231,7 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection quota_v2
|
||||
* @property Grid\Column|Collection quota_v1
|
||||
* @property Grid\Column|Collection group_sales_value
|
||||
* @property Grid\Column|Collection pre_growth_value
|
||||
* @property Grid\Column|Collection vip_id
|
||||
* @property Grid\Column|Collection phone_verified_at
|
||||
* @property Grid\Column|Collection email
|
||||
|
|
@ -237,6 +240,9 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection last_login_at
|
||||
* @property Grid\Column|Collection register_ip
|
||||
* @property Grid\Column|Collection status_remark
|
||||
* @property Grid\Column|Collection rate
|
||||
* @property Grid\Column|Collection service_amount
|
||||
* @property Grid\Column|Collection account_amount
|
||||
* @property Grid\Column|Collection withdrawable
|
||||
*
|
||||
* @method Grid\Column|Collection id(string $label = null)
|
||||
|
|
@ -289,6 +295,7 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection amount(string $label = null)
|
||||
* @method Grid\Column|Collection state(string $label = null)
|
||||
* @method Grid\Column|Collection tracking_number(string $label = null)
|
||||
* @method Grid\Column|Collection sales_value(string $label = null)
|
||||
* @method Grid\Column|Collection v(string $label = null)
|
||||
* @method Grid\Column|Collection cate(string $label = null)
|
||||
* @method Grid\Column|Collection is_force(string $label = null)
|
||||
|
|
@ -317,6 +324,7 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection total_expenses(string $label = null)
|
||||
* @method Grid\Column|Collection total_revenue(string $label = null)
|
||||
* @method Grid\Column|Collection transferable(string $label = null)
|
||||
* @method Grid\Column|Collection is_frozen(string $label = null)
|
||||
* @method Grid\Column|Collection continue_click_times(string $label = null)
|
||||
* @method Grid\Column|Collection last_click_at(string $label = null)
|
||||
* @method Grid\Column|Collection coupon_id(string $label = null)
|
||||
|
|
@ -380,7 +388,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection after_expire_at(string $label = null)
|
||||
* @method Grid\Column|Collection remain_quantity(string $label = null)
|
||||
* @method Grid\Column|Collection gift_for_sku_id(string $label = null)
|
||||
* @method Grid\Column|Collection sales_value(string $label = null)
|
||||
* @method Grid\Column|Collection max(string $label = null)
|
||||
* @method Grid\Column|Collection reason(string $label = null)
|
||||
* @method Grid\Column|Collection user_coupon_id(string $label = null)
|
||||
|
|
@ -394,6 +401,7 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection shipping_state(string $label = null)
|
||||
* @method Grid\Column|Collection is_change(string $label = null)
|
||||
* @method Grid\Column|Collection out_trade_no(string $label = null)
|
||||
* @method Grid\Column|Collection auto_complete_at(string $label = null)
|
||||
* @method Grid\Column|Collection payable_type(string $label = null)
|
||||
* @method Grid\Column|Collection payable_id(string $label = null)
|
||||
* @method Grid\Column|Collection tokenable_type(string $label = null)
|
||||
|
|
@ -457,6 +465,7 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection quota_v2(string $label = null)
|
||||
* @method Grid\Column|Collection quota_v1(string $label = null)
|
||||
* @method Grid\Column|Collection group_sales_value(string $label = null)
|
||||
* @method Grid\Column|Collection pre_growth_value(string $label = null)
|
||||
* @method Grid\Column|Collection vip_id(string $label = null)
|
||||
* @method Grid\Column|Collection phone_verified_at(string $label = null)
|
||||
* @method Grid\Column|Collection email(string $label = null)
|
||||
|
|
@ -465,6 +474,9 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection last_login_at(string $label = null)
|
||||
* @method Grid\Column|Collection register_ip(string $label = null)
|
||||
* @method Grid\Column|Collection status_remark(string $label = null)
|
||||
* @method Grid\Column|Collection rate(string $label = null)
|
||||
* @method Grid\Column|Collection service_amount(string $label = null)
|
||||
* @method Grid\Column|Collection account_amount(string $label = null)
|
||||
* @method Grid\Column|Collection withdrawable(string $label = null)
|
||||
*/
|
||||
class Grid {}
|
||||
|
|
@ -522,6 +534,7 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection amount
|
||||
* @property Show\Field|Collection state
|
||||
* @property Show\Field|Collection tracking_number
|
||||
* @property Show\Field|Collection sales_value
|
||||
* @property Show\Field|Collection v
|
||||
* @property Show\Field|Collection cate
|
||||
* @property Show\Field|Collection is_force
|
||||
|
|
@ -550,6 +563,7 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection total_expenses
|
||||
* @property Show\Field|Collection total_revenue
|
||||
* @property Show\Field|Collection transferable
|
||||
* @property Show\Field|Collection is_frozen
|
||||
* @property Show\Field|Collection continue_click_times
|
||||
* @property Show\Field|Collection last_click_at
|
||||
* @property Show\Field|Collection coupon_id
|
||||
|
|
@ -613,7 +627,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection after_expire_at
|
||||
* @property Show\Field|Collection remain_quantity
|
||||
* @property Show\Field|Collection gift_for_sku_id
|
||||
* @property Show\Field|Collection sales_value
|
||||
* @property Show\Field|Collection max
|
||||
* @property Show\Field|Collection reason
|
||||
* @property Show\Field|Collection user_coupon_id
|
||||
|
|
@ -627,6 +640,7 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection shipping_state
|
||||
* @property Show\Field|Collection is_change
|
||||
* @property Show\Field|Collection out_trade_no
|
||||
* @property Show\Field|Collection auto_complete_at
|
||||
* @property Show\Field|Collection payable_type
|
||||
* @property Show\Field|Collection payable_id
|
||||
* @property Show\Field|Collection tokenable_type
|
||||
|
|
@ -690,6 +704,7 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection quota_v2
|
||||
* @property Show\Field|Collection quota_v1
|
||||
* @property Show\Field|Collection group_sales_value
|
||||
* @property Show\Field|Collection pre_growth_value
|
||||
* @property Show\Field|Collection vip_id
|
||||
* @property Show\Field|Collection phone_verified_at
|
||||
* @property Show\Field|Collection email
|
||||
|
|
@ -698,6 +713,9 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection last_login_at
|
||||
* @property Show\Field|Collection register_ip
|
||||
* @property Show\Field|Collection status_remark
|
||||
* @property Show\Field|Collection rate
|
||||
* @property Show\Field|Collection service_amount
|
||||
* @property Show\Field|Collection account_amount
|
||||
* @property Show\Field|Collection withdrawable
|
||||
*
|
||||
* @method Show\Field|Collection id(string $label = null)
|
||||
|
|
@ -750,6 +768,7 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection amount(string $label = null)
|
||||
* @method Show\Field|Collection state(string $label = null)
|
||||
* @method Show\Field|Collection tracking_number(string $label = null)
|
||||
* @method Show\Field|Collection sales_value(string $label = null)
|
||||
* @method Show\Field|Collection v(string $label = null)
|
||||
* @method Show\Field|Collection cate(string $label = null)
|
||||
* @method Show\Field|Collection is_force(string $label = null)
|
||||
|
|
@ -778,6 +797,7 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection total_expenses(string $label = null)
|
||||
* @method Show\Field|Collection total_revenue(string $label = null)
|
||||
* @method Show\Field|Collection transferable(string $label = null)
|
||||
* @method Show\Field|Collection is_frozen(string $label = null)
|
||||
* @method Show\Field|Collection continue_click_times(string $label = null)
|
||||
* @method Show\Field|Collection last_click_at(string $label = null)
|
||||
* @method Show\Field|Collection coupon_id(string $label = null)
|
||||
|
|
@ -841,7 +861,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection after_expire_at(string $label = null)
|
||||
* @method Show\Field|Collection remain_quantity(string $label = null)
|
||||
* @method Show\Field|Collection gift_for_sku_id(string $label = null)
|
||||
* @method Show\Field|Collection sales_value(string $label = null)
|
||||
* @method Show\Field|Collection max(string $label = null)
|
||||
* @method Show\Field|Collection reason(string $label = null)
|
||||
* @method Show\Field|Collection user_coupon_id(string $label = null)
|
||||
|
|
@ -855,6 +874,7 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection shipping_state(string $label = null)
|
||||
* @method Show\Field|Collection is_change(string $label = null)
|
||||
* @method Show\Field|Collection out_trade_no(string $label = null)
|
||||
* @method Show\Field|Collection auto_complete_at(string $label = null)
|
||||
* @method Show\Field|Collection payable_type(string $label = null)
|
||||
* @method Show\Field|Collection payable_id(string $label = null)
|
||||
* @method Show\Field|Collection tokenable_type(string $label = null)
|
||||
|
|
@ -918,6 +938,7 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection quota_v2(string $label = null)
|
||||
* @method Show\Field|Collection quota_v1(string $label = null)
|
||||
* @method Show\Field|Collection group_sales_value(string $label = null)
|
||||
* @method Show\Field|Collection pre_growth_value(string $label = null)
|
||||
* @method Show\Field|Collection vip_id(string $label = null)
|
||||
* @method Show\Field|Collection phone_verified_at(string $label = null)
|
||||
* @method Show\Field|Collection email(string $label = null)
|
||||
|
|
@ -926,6 +947,9 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection last_login_at(string $label = null)
|
||||
* @method Show\Field|Collection register_ip(string $label = null)
|
||||
* @method Show\Field|Collection status_remark(string $label = null)
|
||||
* @method Show\Field|Collection rate(string $label = null)
|
||||
* @method Show\Field|Collection service_amount(string $label = null)
|
||||
* @method Show\Field|Collection account_amount(string $label = null)
|
||||
* @method Show\Field|Collection withdrawable(string $label = null)
|
||||
*/
|
||||
class Show {}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'BalanceLog' => '余额账户',
|
||||
'balance-logs' => '余额账户',
|
||||
],
|
||||
'fields' => [
|
||||
'user_id' => '用户ID',
|
||||
'user'=>[
|
||||
'phone' => '手机号',
|
||||
],
|
||||
'before_balance' => '变更前(¥)',
|
||||
'change_balance' => '变更金额(¥)',
|
||||
'remarks' => '备注',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'DistributionPreIncome' => '预收益',
|
||||
'distribution-pre-incomes' => '预收益',
|
||||
],
|
||||
'fields' => [
|
||||
'user_id' => '用户ID',
|
||||
'order_id' => '订单ID',
|
||||
'type' => '收益类型',
|
||||
'agent_level' => '代理等级',
|
||||
'total_amount' => '总金额',
|
||||
'total_sales_value' => '总销售',
|
||||
'total_revenue' => '总收益',
|
||||
'status' => '状态',
|
||||
'remarks' => '备注',
|
||||
'completed_at' => '结算时间',
|
||||
'user'=>[
|
||||
'phone'=>'手机号',
|
||||
],
|
||||
'order'=>[
|
||||
'sn'=>'订单编号',
|
||||
],
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'WalletLog' => '可提账户',
|
||||
'wallet-logs' => '可提账户',
|
||||
],
|
||||
'fields' => [
|
||||
'user_id' => '用户ID',
|
||||
'user'=>[
|
||||
'phone' => '手机号',
|
||||
],
|
||||
'before_balance' => '变更前(¥)',
|
||||
'change_balance' => '变更金额(¥)',
|
||||
'remarks' => '备注',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
Loading…
Reference in New Issue