11 changed files with 761 additions and 400 deletions
-
85app/AdminAgent/Controllers/StatementController.php
-
16app/AdminAgent/Repositories/Statement.php
-
2app/AdminAgent/routes.php
-
85app/AdminGuide/Controllers/StatementController.php
-
16app/AdminGuide/Repositories/Statement.php
-
2app/AdminGuide/routes.php
-
85app/AdminSupplier/Controllers/StatementController.php
-
16app/AdminSupplier/Repositories/Statement.php
-
1app/AdminSupplier/routes.php
-
832dcat_admin_ide_helper.php
-
17resources/lang/zh_CN/statement.php
@ -0,0 +1,85 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\AdminAgent\Controllers; |
||||
|
|
||||
|
use App\AdminAgent\Repositories\Statement; |
||||
|
use App\Common\StatementType; |
||||
|
use App\Traits\DemandTraits; |
||||
|
use Dcat\Admin\Admin; |
||||
|
use Dcat\Admin\Form; |
||||
|
use Dcat\Admin\Grid; |
||||
|
use Dcat\Admin\Show; |
||||
|
use Dcat\Admin\Http\Controllers\AdminController; |
||||
|
|
||||
|
class StatementController extends AdminController |
||||
|
{ |
||||
|
/** |
||||
|
* Make a grid builder. |
||||
|
* |
||||
|
* @return Grid |
||||
|
*/ |
||||
|
protected function grid() |
||||
|
{ |
||||
|
return Grid::make(new Statement(), function (Grid $grid) { |
||||
|
$grid->model()->where([ |
||||
|
'access_id'=> Admin::user()->id, |
||||
|
'access_type' => DemandTraits::$col[0] |
||||
|
]); |
||||
|
$grid->column('id')->sortable(); |
||||
|
$grid->column('price'); |
||||
|
$grid->column('type')->using(StatementType::array()); |
||||
|
$grid->column('created_at'); |
||||
|
$grid->column('updated_at')->sortable(); |
||||
|
$grid->disableCreateButton(); |
||||
|
$grid->disableActions(); |
||||
|
$grid->disableRowSelector(); |
||||
|
$grid->filter(function (Grid\Filter $filter) { |
||||
|
$filter->equal('id'); |
||||
|
|
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Make a show builder. |
||||
|
* |
||||
|
* @param mixed $id |
||||
|
* |
||||
|
* @return Show |
||||
|
*/ |
||||
|
protected function detail($id) |
||||
|
{ |
||||
|
return Show::make($id, new Statement(), function (Show $show) { |
||||
|
$show->field('id'); |
||||
|
$show->field('price'); |
||||
|
$show->field('type'); |
||||
|
$show->field('user_id'); |
||||
|
$show->field('user_type'); |
||||
|
$show->field('access_id'); |
||||
|
$show->field('access_type'); |
||||
|
$show->field('created_at'); |
||||
|
$show->field('updated_at'); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Make a form builder. |
||||
|
* |
||||
|
* @return Form |
||||
|
*/ |
||||
|
protected function form() |
||||
|
{ |
||||
|
return Form::make(new Statement(), function (Form $form) { |
||||
|
$form->display('id'); |
||||
|
$form->text('price'); |
||||
|
$form->text('type'); |
||||
|
$form->text('user_id'); |
||||
|
$form->text('user_type'); |
||||
|
$form->text('access_id'); |
||||
|
$form->text('access_type'); |
||||
|
|
||||
|
$form->display('created_at'); |
||||
|
$form->display('updated_at'); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\AdminAgent\Repositories; |
||||
|
|
||||
|
use App\Models\Statement as Model; |
||||
|
use Dcat\Admin\Repositories\EloquentRepository; |
||||
|
|
||||
|
class Statement extends EloquentRepository |
||||
|
{ |
||||
|
/** |
||||
|
* Model. |
||||
|
* |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $eloquentClass = Model::class; |
||||
|
} |
||||
@ -0,0 +1,85 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\AdminGuide\Controllers; |
||||
|
|
||||
|
use App\AdminGuide\Repositories\Statement; |
||||
|
use App\Common\StatementType; |
||||
|
use App\Traits\DemandTraits; |
||||
|
use Dcat\Admin\Admin; |
||||
|
use Dcat\Admin\Form; |
||||
|
use Dcat\Admin\Grid; |
||||
|
use Dcat\Admin\Show; |
||||
|
use Dcat\Admin\Http\Controllers\AdminController; |
||||
|
|
||||
|
class StatementController extends AdminController |
||||
|
{ |
||||
|
/** |
||||
|
* Make a grid builder. |
||||
|
* |
||||
|
* @return Grid |
||||
|
*/ |
||||
|
protected function grid() |
||||
|
{ |
||||
|
return Grid::make(new Statement(), function (Grid $grid) { |
||||
|
$grid->model()->where([ |
||||
|
'access_id'=> Admin::user()->id, |
||||
|
'access_type' => DemandTraits::$col[2] |
||||
|
]); |
||||
|
$grid->column('id')->sortable(); |
||||
|
$grid->column('price'); |
||||
|
$grid->column('type')->using(StatementType::array()); |
||||
|
$grid->column('created_at'); |
||||
|
$grid->column('updated_at')->sortable(); |
||||
|
$grid->disableCreateButton(); |
||||
|
$grid->disableActions(); |
||||
|
$grid->disableRowSelector(); |
||||
|
$grid->filter(function (Grid\Filter $filter) { |
||||
|
$filter->equal('id'); |
||||
|
|
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Make a show builder. |
||||
|
* |
||||
|
* @param mixed $id |
||||
|
* |
||||
|
* @return Show |
||||
|
*/ |
||||
|
protected function detail($id) |
||||
|
{ |
||||
|
return Show::make($id, new Statement(), function (Show $show) { |
||||
|
$show->field('id'); |
||||
|
$show->field('price'); |
||||
|
$show->field('type'); |
||||
|
$show->field('user_id'); |
||||
|
$show->field('user_type'); |
||||
|
$show->field('access_id'); |
||||
|
$show->field('access_type'); |
||||
|
$show->field('created_at'); |
||||
|
$show->field('updated_at'); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Make a form builder. |
||||
|
* |
||||
|
* @return Form |
||||
|
*/ |
||||
|
protected function form() |
||||
|
{ |
||||
|
return Form::make(new Statement(), function (Form $form) { |
||||
|
$form->display('id'); |
||||
|
$form->text('price'); |
||||
|
$form->text('type'); |
||||
|
$form->text('user_id'); |
||||
|
$form->text('user_type'); |
||||
|
$form->text('access_id'); |
||||
|
$form->text('access_type'); |
||||
|
|
||||
|
$form->display('created_at'); |
||||
|
$form->display('updated_at'); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\AdminGuide\Repositories; |
||||
|
|
||||
|
use App\Models\Statement as Model; |
||||
|
use Dcat\Admin\Repositories\EloquentRepository; |
||||
|
|
||||
|
class Statement extends EloquentRepository |
||||
|
{ |
||||
|
/** |
||||
|
* Model. |
||||
|
* |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $eloquentClass = Model::class; |
||||
|
} |
||||
@ -0,0 +1,85 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\AdminSupplier\Controllers; |
||||
|
|
||||
|
use App\AdminSupplier\Repositories\Statement; |
||||
|
use App\Common\StatementType; |
||||
|
use App\Traits\DemandTraits; |
||||
|
use Dcat\Admin\Admin; |
||||
|
use Dcat\Admin\Form; |
||||
|
use Dcat\Admin\Grid; |
||||
|
use Dcat\Admin\Show; |
||||
|
use Dcat\Admin\Http\Controllers\AdminController; |
||||
|
|
||||
|
class StatementController extends AdminController |
||||
|
{ |
||||
|
/** |
||||
|
* Make a grid builder. |
||||
|
* |
||||
|
* @return Grid |
||||
|
*/ |
||||
|
protected function grid() |
||||
|
{ |
||||
|
return Grid::make(new Statement(), function (Grid $grid) { |
||||
|
$grid->model()->where([ |
||||
|
'access_id'=> Admin::user()->id, |
||||
|
'access_type' => DemandTraits::$col[1] |
||||
|
]); |
||||
|
$grid->column('id')->sortable(); |
||||
|
$grid->column('price'); |
||||
|
$grid->column('type')->using(StatementType::array()); |
||||
|
$grid->column('created_at'); |
||||
|
$grid->column('updated_at')->sortable(); |
||||
|
$grid->disableCreateButton(); |
||||
|
$grid->disableActions(); |
||||
|
$grid->disableRowSelector(); |
||||
|
$grid->filter(function (Grid\Filter $filter) { |
||||
|
$filter->equal('id'); |
||||
|
|
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Make a show builder. |
||||
|
* |
||||
|
* @param mixed $id |
||||
|
* |
||||
|
* @return Show |
||||
|
*/ |
||||
|
protected function detail($id) |
||||
|
{ |
||||
|
return Show::make($id, new Statement(), function (Show $show) { |
||||
|
$show->field('id'); |
||||
|
$show->field('price'); |
||||
|
$show->field('type'); |
||||
|
$show->field('user_id'); |
||||
|
$show->field('user_type'); |
||||
|
$show->field('access_id'); |
||||
|
$show->field('access_type'); |
||||
|
$show->field('created_at'); |
||||
|
$show->field('updated_at'); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Make a form builder. |
||||
|
* |
||||
|
* @return Form |
||||
|
*/ |
||||
|
protected function form() |
||||
|
{ |
||||
|
return Form::make(new Statement(), function (Form $form) { |
||||
|
$form->display('id'); |
||||
|
$form->text('price'); |
||||
|
$form->text('type'); |
||||
|
$form->text('user_id'); |
||||
|
$form->text('user_type'); |
||||
|
$form->text('access_id'); |
||||
|
$form->text('access_type'); |
||||
|
|
||||
|
$form->display('created_at'); |
||||
|
$form->display('updated_at'); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\AdminSupplier\Repositories; |
||||
|
|
||||
|
use App\Models\Statement as Model; |
||||
|
use Dcat\Admin\Repositories\EloquentRepository; |
||||
|
|
||||
|
class Statement extends EloquentRepository |
||||
|
{ |
||||
|
/** |
||||
|
* Model. |
||||
|
* |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $eloquentClass = Model::class; |
||||
|
} |
||||
832
dcat_admin_ide_helper.php
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,17 @@ |
|||||
|
<?php |
||||
|
return [ |
||||
|
'labels' => [ |
||||
|
'Statement' => '余额流水', |
||||
|
'statement' => '余额流水', |
||||
|
], |
||||
|
'fields' => [ |
||||
|
'price' => '金额', |
||||
|
'type' => '类型', |
||||
|
'user_id' => '代理商id', |
||||
|
'user_type' => '用户类型', |
||||
|
'access_id' => '关联', |
||||
|
'access_type' => '关联类型 目前有订单 和提现', |
||||
|
], |
||||
|
'options' => [ |
||||
|
], |
||||
|
]; |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue