添加新配额账户
parent
2a73a217c3
commit
97ff1a505d
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\QuotaLog;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class QuotaLogController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = QuotaLog::with('user');
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('user.phone', '手机号');
|
||||
$grid->column('change_quota');
|
||||
$grid->column('remarks');
|
||||
$grid->column('created_at')->sortable();
|
||||
// $grid->column('updated_at')->sortable();
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->equal('user.phone')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new QuotaLog(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('user_id');
|
||||
$show->field('change_quota');
|
||||
$show->field('remarks');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new QuotaLog(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->text('user_id');
|
||||
$form->text('change_quota');
|
||||
$form->text('remarks');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\QuotaLog as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class QuotaLog extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -148,6 +148,8 @@ Route::group([
|
|||
'index',
|
||||
])->names('points_logs');
|
||||
|
||||
$router->get('quota-logs', 'QuotaLogController@index')->name('quota_logs.index');
|
||||
|
||||
$router->resource('quota-v1-send-jobs', 'QuotaV1SendJobController')->only([
|
||||
'index', 'create', 'store', 'edit', 'update', 'destroy',
|
||||
])->names('quota_v1_send_jobs');
|
||||
|
|
|
|||
|
|
@ -262,6 +262,11 @@ class AdminMenuSeeder extends Seeder
|
|||
'icon' => '',
|
||||
'uri' => 'points-logs',
|
||||
],
|
||||
[
|
||||
'title' => '新配额账户',
|
||||
'icon' => '',
|
||||
'uri' => 'quota-logs',
|
||||
],
|
||||
[
|
||||
'title' =>'提现审核',
|
||||
'icon' => '',
|
||||
|
|
|
|||
|
|
@ -263,6 +263,10 @@ class AdminPermissionSeeder extends Seeder
|
|||
'name' =>'预收益',
|
||||
'curd' => ['index'],
|
||||
],
|
||||
'quota_logs'=>[
|
||||
'name' =>'新配额账户',
|
||||
'curd' => ['index'],
|
||||
],
|
||||
'quota_v1_send_jobs'=>[
|
||||
'name' => '老配额分红',
|
||||
'curd' => ['index', 'create', 'store', 'edit', 'update', 'destroy'],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'QuotaLog' => '新配额账户',
|
||||
'quota-logs' => '新配额账户',
|
||||
],
|
||||
'fields' => [
|
||||
'user_id' => '用户',
|
||||
'user'=>[
|
||||
'phone' => '手机号',
|
||||
],
|
||||
'change_quota' => '变更的配额',
|
||||
'remarks' => '备注',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
Loading…
Reference in New Issue