添加管理者津贴明细
parent
e6eceb6dd1
commit
7b29f6957f
|
|
@ -108,7 +108,7 @@ class AdController extends AdminController
|
|||
->move('ac/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload();
|
||||
->autoUpload()->retainable();
|
||||
$form->radio('jump_type')->options([
|
||||
'0'=>__('admin_message.ad.jump_type.radio.0'),
|
||||
'1'=>__('admin_message.ad.jump_type.radio.1'),
|
||||
|
|
|
|||
|
|
@ -128,14 +128,14 @@ class ArticleController extends AdminController
|
|||
->move('articles/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload();
|
||||
->autoUpload()->retainable();
|
||||
$form->radio('media_type')
|
||||
->when(1, function (Form $form) {
|
||||
$form->multipleImage('media_content1')
|
||||
->move('articles/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload()->autoSave(false)->customFormat(function ($v) {
|
||||
->autoUpload()->autoSave(false)->retainable()->customFormat(function ($v) {
|
||||
$v = [];
|
||||
if ($this->model()->media_type == 1) {
|
||||
$v = json_decode($this->model()->media_content, true);
|
||||
|
|
|
|||
|
|
@ -107,6 +107,9 @@ class DealerEarningController extends AdminController
|
|||
$builder = DealerEarning::with(['user', 'payer']);
|
||||
$column->row(Show::make($id, $builder, function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('type_name')->as(function () {
|
||||
return $this->type_name;
|
||||
})->label();
|
||||
$show->field('user.phone');
|
||||
// $show->field('earningable_type');
|
||||
// $show->field('earningable_id');
|
||||
|
|
@ -203,10 +206,9 @@ class DealerEarningController extends AdminController
|
|||
$grid->column('order_completed_at', '结算时间');
|
||||
$grid->disableCreateButton();
|
||||
$grid->disableActions();
|
||||
$grid->disablePagination();
|
||||
// $grid->disablePagination();
|
||||
});
|
||||
break;
|
||||
break;
|
||||
case DealerManageSubsidy::class://管理补贴
|
||||
$builder = DealerManageSubsidyLog::with(['order', 'product'])->where('user_id', $earning->earningable->user_id)->whereBetween('order_completed_at', [$earning->earningable->start_at, $earning->earningable->end_at]);
|
||||
$grid = Grid::make($builder, function (Grid $grid) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\DealerManagerSalesLog;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class DealerManagerSalesLogController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = DealerManagerSalesLog::with(['user', 'order', 'product']);
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('user.phone', '手机号');
|
||||
$grid->column('lvl', '等级')->display(function () {
|
||||
return $this->lvl->text();
|
||||
});
|
||||
$grid->column('order.sn', '订单编号');
|
||||
$grid->column('product.name', '商品名称');
|
||||
$grid->column('sales_volume', '销量');
|
||||
$grid->column('order_completed_at', '结算时间');
|
||||
$grid->column('created_at')->sortable();
|
||||
|
||||
$grid->disableCreateButton();
|
||||
$grid->disableActions();
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel(false);
|
||||
$filter->equal('user.phone', '手机号')->width(3);
|
||||
$filter->between('order_completed_at', '结算时间')->dateTime()->width(7);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new DealerManagerSalesLog(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('user_id');
|
||||
$show->field('order_id');
|
||||
$show->field('product_id');
|
||||
$show->field('lvl');
|
||||
$show->field('sales_volume');
|
||||
$show->field('order_completed_at');
|
||||
$show->field('created_at');
|
||||
$show->field('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a form builder.
|
||||
*
|
||||
* @return Form
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
return Form::make(new DealerManagerSalesLog(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->text('user_id');
|
||||
$form->text('order_id');
|
||||
$form->text('product_id');
|
||||
$form->text('lvl');
|
||||
$form->text('sales_volume');
|
||||
$form->text('order_completed_at');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -116,13 +116,13 @@ class DealerProductController extends AdminController
|
|||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->retainable()
|
||||
->autoUpload();
|
||||
->autoUpload()->retainable();
|
||||
$form->multipleImage('images')
|
||||
->move('dealer-products/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->retainable()
|
||||
->autoUpload();
|
||||
->autoUpload()->retainable();
|
||||
$form->editor('description');
|
||||
$form->currency('price')->symbol('¥')->required();
|
||||
$form->currency('manager_subsidy')->symbol('¥')->required();
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class ProductCategoryController extends AdminController
|
|||
->move('product-categories/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload();
|
||||
->autoUpload()->retainable();
|
||||
$form->switch('is_show');
|
||||
$form->switch('is_recommend');
|
||||
$form->number('sort')->min(0)->default(0);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class ProductFeatureController extends AdminController
|
|||
->move('product-features/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload();
|
||||
->autoUpload()->retainable();
|
||||
$form->text('remarks');
|
||||
|
||||
$form->display('created_at');
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class ShareBgController extends AdminController
|
|||
->move('share-bgs/'.Carbon::now()->toDateString())
|
||||
->saveFullUrl()
|
||||
->removable(false)
|
||||
->autoUpload()->required();
|
||||
->autoUpload()->retainable()->required();
|
||||
$form->number('x')->min(0)->default(0)->required();
|
||||
$form->number('y')->min(0)->default(0)->required();
|
||||
$form->number('size')->min(0)->default(0)->required();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\DealerManagerSalesLog as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class DealerManagerSalesLog extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -181,6 +181,9 @@ Route::group([
|
|||
$router->get('dealer-earnings-manager', 'DealerEarningController@index')->name('dealer_earnings.manager');
|
||||
$router->get('dealer-earnings-purchase', 'DealerEarningController@index')->name('dealer_earnings.purchase');
|
||||
|
||||
//批零明细
|
||||
$router->get('dealer-manager-sales-logs', 'DealerManagerSalesLogController@index')->name('dealer_manager_sales_logs.index');
|
||||
|
||||
/** 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');
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ class DealerManagerSalesLog extends Model
|
|||
'order_completed_at',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 此津贴所属订单
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -334,6 +334,11 @@ class AdminMenuSeeder extends Seeder
|
|||
'icon' => '',
|
||||
'uri' => 'dealer-earnings-manager?filter-earningable_type[]=dealer_manager_subsidy',
|
||||
],
|
||||
[
|
||||
'title'=>'管理者津贴明细',
|
||||
'icon' => '',
|
||||
'uri'=>'dealer-manager-sales-logs',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
|
|||
|
|
@ -159,15 +159,17 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection change_amount
|
||||
* @property Grid\Column|Collection change_from_purchase_subsidy_id
|
||||
* @property Grid\Column|Collection purchase_subsidy_id
|
||||
* @property Grid\Column|Collection change_sales_value
|
||||
* @property Grid\Column|Collection before_lvl
|
||||
* @property Grid\Column|Collection change_lvl
|
||||
* @property Grid\Column|Collection bonds
|
||||
* @property Grid\Column|Collection contracted_lvl_at
|
||||
* @property Grid\Column|Collection self_sales_value
|
||||
* @property Grid\Column|Collection team_sales_value
|
||||
* @property Grid\Column|Collection failed_reason
|
||||
* @property Grid\Column|Collection jobable_id
|
||||
* @property Grid\Column|Collection jobable_type
|
||||
* @property Grid\Column|Collection change_revenue
|
||||
* @property Grid\Column|Collection change_sales_value
|
||||
* @property Grid\Column|Collection pre_income_id
|
||||
* @property Grid\Column|Collection pre_income_job_id
|
||||
* @property Grid\Column|Collection agent_level
|
||||
|
|
@ -451,15 +453,17 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection change_amount(string $label = null)
|
||||
* @method Grid\Column|Collection change_from_purchase_subsidy_id(string $label = null)
|
||||
* @method Grid\Column|Collection purchase_subsidy_id(string $label = null)
|
||||
* @method Grid\Column|Collection change_sales_value(string $label = null)
|
||||
* @method Grid\Column|Collection before_lvl(string $label = null)
|
||||
* @method Grid\Column|Collection change_lvl(string $label = null)
|
||||
* @method Grid\Column|Collection bonds(string $label = null)
|
||||
* @method Grid\Column|Collection contracted_lvl_at(string $label = null)
|
||||
* @method Grid\Column|Collection self_sales_value(string $label = null)
|
||||
* @method Grid\Column|Collection team_sales_value(string $label = null)
|
||||
* @method Grid\Column|Collection failed_reason(string $label = null)
|
||||
* @method Grid\Column|Collection jobable_id(string $label = null)
|
||||
* @method Grid\Column|Collection jobable_type(string $label = null)
|
||||
* @method Grid\Column|Collection change_revenue(string $label = null)
|
||||
* @method Grid\Column|Collection change_sales_value(string $label = null)
|
||||
* @method Grid\Column|Collection pre_income_id(string $label = null)
|
||||
* @method Grid\Column|Collection pre_income_job_id(string $label = null)
|
||||
* @method Grid\Column|Collection agent_level(string $label = null)
|
||||
|
|
@ -748,15 +752,17 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection change_amount
|
||||
* @property Show\Field|Collection change_from_purchase_subsidy_id
|
||||
* @property Show\Field|Collection purchase_subsidy_id
|
||||
* @property Show\Field|Collection change_sales_value
|
||||
* @property Show\Field|Collection before_lvl
|
||||
* @property Show\Field|Collection change_lvl
|
||||
* @property Show\Field|Collection bonds
|
||||
* @property Show\Field|Collection contracted_lvl_at
|
||||
* @property Show\Field|Collection self_sales_value
|
||||
* @property Show\Field|Collection team_sales_value
|
||||
* @property Show\Field|Collection failed_reason
|
||||
* @property Show\Field|Collection jobable_id
|
||||
* @property Show\Field|Collection jobable_type
|
||||
* @property Show\Field|Collection change_revenue
|
||||
* @property Show\Field|Collection change_sales_value
|
||||
* @property Show\Field|Collection pre_income_id
|
||||
* @property Show\Field|Collection pre_income_job_id
|
||||
* @property Show\Field|Collection agent_level
|
||||
|
|
@ -1040,15 +1046,17 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection change_amount(string $label = null)
|
||||
* @method Show\Field|Collection change_from_purchase_subsidy_id(string $label = null)
|
||||
* @method Show\Field|Collection purchase_subsidy_id(string $label = null)
|
||||
* @method Show\Field|Collection change_sales_value(string $label = null)
|
||||
* @method Show\Field|Collection before_lvl(string $label = null)
|
||||
* @method Show\Field|Collection change_lvl(string $label = null)
|
||||
* @method Show\Field|Collection bonds(string $label = null)
|
||||
* @method Show\Field|Collection contracted_lvl_at(string $label = null)
|
||||
* @method Show\Field|Collection self_sales_value(string $label = null)
|
||||
* @method Show\Field|Collection team_sales_value(string $label = null)
|
||||
* @method Show\Field|Collection failed_reason(string $label = null)
|
||||
* @method Show\Field|Collection jobable_id(string $label = null)
|
||||
* @method Show\Field|Collection jobable_type(string $label = null)
|
||||
* @method Show\Field|Collection change_revenue(string $label = null)
|
||||
* @method Show\Field|Collection change_sales_value(string $label = null)
|
||||
* @method Show\Field|Collection pre_income_id(string $label = null)
|
||||
* @method Show\Field|Collection pre_income_job_id(string $label = null)
|
||||
* @method Show\Field|Collection agent_level(string $label = null)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'DealerManagerSalesLog' => '管理者津贴明细',
|
||||
'dealer-manager-sales-logs' => '管理者津贴明细',
|
||||
],
|
||||
'fields' => [
|
||||
'user_id' => '用户手机号',
|
||||
'order_id' => '订单',
|
||||
'product_id' => '商品',
|
||||
'lvl' => '等级',
|
||||
'sales_volume' => '商品销量',
|
||||
'order_completed_at' => '订单完成时间',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
Loading…
Reference in New Issue