Merge branch 'develop' of gitee.com:zi-chunsheng-e-commerce/mall-server
commit
eee6093d80
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Actions\Grid;
|
||||
|
||||
use App\Models\DealerManageSubsidy;
|
||||
use App\Services\Dealer\ManageSubsidyService;
|
||||
use Dcat\Admin\Grid\BatchAction;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class DealerManageSubsidyBatchPay extends BatchAction
|
||||
{
|
||||
protected $title = '<i class="feather grid-action-icon icon-stop-circle"></i> 付款';
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.dealer_manage_subsidies.batch_pay');
|
||||
}
|
||||
|
||||
// 确认弹窗信息
|
||||
public function confirm()
|
||||
{
|
||||
return '您确定要支付选中的管理津贴吗?';
|
||||
}
|
||||
|
||||
// 处理请求
|
||||
public function handle(Request $request)
|
||||
{
|
||||
try {
|
||||
DB::transaction(function () {
|
||||
foreach ($this->getKey() as $id) {
|
||||
$dealerManageSubsidy = DealerManageSubsidy::lockForUpdate()->settled()->find($id);
|
||||
|
||||
if ($dealerManageSubsidy?->isPending()) {
|
||||
(new ManageSubsidyService())->pay($dealerManageSubsidy);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Throwable $e) {
|
||||
return $this->response()->error('操作失败:'.$e->getMessage())->refresh();
|
||||
}
|
||||
|
||||
return $this->response()->success('操作成功')->refresh();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Actions\Grid;
|
||||
|
||||
use App\Models\DealerManageSubsidy;
|
||||
use App\Services\Dealer\ManageSubsidyService;
|
||||
use Dcat\Admin\Grid\RowAction;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DealerManageSubsidyPay extends RowAction
|
||||
{
|
||||
protected $title = '<i class="feather grid-action-icon icon-stop-circle"></i> 付款';
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.dealer_manage_subsidies.pay');
|
||||
}
|
||||
|
||||
// 确认弹窗信息
|
||||
public function confirm()
|
||||
{
|
||||
return '您确定要支付选中的管理津贴吗?';
|
||||
}
|
||||
|
||||
// 处理请求
|
||||
public function handle(Request $request)
|
||||
{
|
||||
DB::transaction(function () {
|
||||
$id = $this->getKey();
|
||||
|
||||
(new ManageSubsidyService())->pay(
|
||||
DealerManageSubsidy::lockForUpdate()->settled()->findOrFail($id)
|
||||
);
|
||||
});
|
||||
|
||||
return $this->response()->success('操作成功')->refresh();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Actions\Grid;
|
||||
|
||||
use App\Models\DealerManagerSubsidy;
|
||||
use App\Services\Dealer\ManagerSubsidyService;
|
||||
use Dcat\Admin\Grid\BatchAction;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class DealerManagerSubsidyBatchPay extends BatchAction
|
||||
{
|
||||
protected $title = '<i class="feather grid-action-icon icon-stop-circle"></i> 付款';
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.dealer_manager_subsidies.batch_pay');
|
||||
}
|
||||
|
||||
// 确认弹窗信息
|
||||
public function confirm()
|
||||
{
|
||||
return '您确定要支付选中的管理者津贴吗?';
|
||||
}
|
||||
|
||||
// 处理请求
|
||||
public function handle(Request $request)
|
||||
{
|
||||
try {
|
||||
DB::transaction(function () {
|
||||
foreach ($this->getKey() as $id) {
|
||||
$dealerManagerSubsidy = DealerManagerSubsidy::lockForUpdate()->settled()->find($id);
|
||||
|
||||
if ($dealerManagerSubsidy?->isPending()) {
|
||||
(new ManagerSubsidyService())->pay($dealerManagerSubsidy);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Throwable $e) {
|
||||
return $this->response()->error('操作失败:'.$e->getMessage())->refresh();
|
||||
}
|
||||
|
||||
return $this->response()->success('操作成功')->refresh();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Actions\Grid;
|
||||
|
||||
use App\Models\DealerManagerSubsidy;
|
||||
use App\Services\Dealer\ManagerSubsidyService;
|
||||
use Dcat\Admin\Grid\RowAction;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DealerManagerSubsidyPay extends RowAction
|
||||
{
|
||||
protected $title = '<i class="feather grid-action-icon icon-stop-circle"></i> 付款';
|
||||
|
||||
/**
|
||||
* @param Model|Authenticatable|HasPermissions|null $user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function authorize($user): bool
|
||||
{
|
||||
return $user->can('dcat.admin.dealer_manager_subsidies.pay');
|
||||
}
|
||||
|
||||
// 确认弹窗信息
|
||||
public function confirm()
|
||||
{
|
||||
return '您确定要支付选中的管理者津贴吗?';
|
||||
}
|
||||
|
||||
// 处理请求
|
||||
public function handle(Request $request)
|
||||
{
|
||||
DB::transaction(function () {
|
||||
$id = $this->getKey();
|
||||
|
||||
(new ManagerSubsidyService())->pay(
|
||||
DealerManagerSubsidy::lockForUpdate()->settled()->findOrFail($id)
|
||||
);
|
||||
});
|
||||
|
||||
return $this->response()->success('操作成功')->refresh();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Actions\Grid\DealerManageSubsidyBatchPay;
|
||||
use App\Admin\Actions\Grid\DealerManageSubsidyPay;
|
||||
use App\Admin\Repositories\DealerManageSubsidy;
|
||||
use App\Admin\Widgets\InfoBox;
|
||||
use App\Enums\DealerManageSubsidyStatus;
|
||||
use App\Models\DealerManageSubsidy as DealerManageSubsidyModel;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Layout\Row;
|
||||
|
||||
class DealerManageSubsidyController extends AdminController
|
||||
{
|
||||
protected $title = '管理津贴';
|
||||
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
Admin::style(
|
||||
<<<CSS
|
||||
.card-header {
|
||||
margin-top: 1.5rem !important;
|
||||
margin-bottom: -1rem !important;
|
||||
}
|
||||
CSS
|
||||
);
|
||||
|
||||
$builder = DealerManageSubsidy::with(['dealer', 'user', 'userinfo', 'earning']);
|
||||
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->model()->settled()->orderBy('id', 'desc');
|
||||
|
||||
$grid->column('settle_period', '结算周期')->display(function () {
|
||||
return $this->start_at->rawFormat('Y/m/d') . '-' . $this->end_at->rawFormat('Y/m/d');
|
||||
})->link(function () {
|
||||
return admin_route('dealer_manage_subsidy_logs.index', [
|
||||
'user[phone]' => $this->user?->phone,
|
||||
'order_completed_at[start]' => $this->start_at->toDateTimeString(),
|
||||
'order_completed_at[end]' => $this->end_at->toDateTimeString(),
|
||||
]);
|
||||
});
|
||||
$grid->column('user.phone', '手机号');
|
||||
$grid->column('userinfo.nickname', '昵称');
|
||||
$grid->column('lvl', '经销商等级')->display(function () {
|
||||
return $this->lvl->text();
|
||||
});
|
||||
$grid->column('total_amount', '津贴总额')->prepend('¥');
|
||||
$grid->column('fee', '手续费')->prepend('¥')->help('手续费=津贴总额*手续费率');
|
||||
$grid->column('real_amount', '总收入')->prepend('¥')->help('总收入=津贴总额-手续费');
|
||||
$grid->column('fee_rate', '手续费率')->append('%');
|
||||
$grid->column('remark', '备注')->display('查看')->modal(function ($modal) {
|
||||
$modal->title('备注');
|
||||
|
||||
return "<div style='padding:10px'>".nl2br($this->remark).'</div>';
|
||||
});
|
||||
$grid->column('status', '状态')->display(function ($v) {
|
||||
return '<i class="fa fa-circle" style="font-size: 13px; color: '.$v->color().';"></i> '.$v->text();
|
||||
});
|
||||
$grid->column('earning.pay_at', '付款时间');
|
||||
|
||||
$grid->showRowSelector();
|
||||
|
||||
$grid->tools(function ($tools) {
|
||||
$tools->batch(function ($batch) {
|
||||
$batch->disableDelete();
|
||||
|
||||
if (Admin::user()->can('dcat.admin.dealer_manage_subsidies.batch_pay')) {
|
||||
$batch->add(new DealerManageSubsidyBatchPay());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
if ($actions->row->isPending() && Admin::user()->can('dcat.admin.dealer_manage_subsidies.pay')) {
|
||||
$actions->append(new DealerManageSubsidyPay());
|
||||
}
|
||||
});
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
|
||||
$filter->equal('user.phone', '手机号')->width(3);
|
||||
$filter->equal('status', '状态')->select(DealerManageSubsidyStatus::texts())->width(3);
|
||||
$filter->whereBetween('settle_period', function ($query) {
|
||||
$start = $this->input['start'] ?? null;
|
||||
$end = $this->input['end'] ?? null;
|
||||
|
||||
$query->when($start, function ($query, $start) {
|
||||
$query->where('start_at', '>=', "{$start} 00:00:00");
|
||||
});
|
||||
|
||||
$query->when($end, function ($query, $end) {
|
||||
$query->where('end_at', '<=', "{$end} 23:59:59");
|
||||
});
|
||||
}, '结算周期')->date()->width(6);
|
||||
});
|
||||
|
||||
$grid->header(function ($collection) use ($grid) {
|
||||
return tap(new Row(), function ($row) use ($grid) {
|
||||
$query = DealerManageSubsidyModel::query();
|
||||
|
||||
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
||||
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = call_user_func_array([$query, $value['method']], $value['arguments'] ?? []);
|
||||
});
|
||||
|
||||
$totalAmount = (clone $query)->sum('total_amount');
|
||||
$totalFee = (clone $query)->sum('fee');
|
||||
|
||||
$row->column(3, new InfoBox('津贴总额', $totalAmount, 'fa fa-cny'));
|
||||
$row->column(3, new InfoBox('手续费', $totalFee, 'fa fa-cny'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->model()->orderBy('id', 'desc');//默认ID倒叙
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('user.phone', '手机号')->copyable();
|
||||
$grid->column('lvl', '等级')->display(function () {
|
||||
return $this->lvl->text();
|
||||
});
|
||||
$grid->column('order.sn', '订单编号');
|
||||
$grid->column('product.name', '商品名称');
|
||||
$grid->column('sales_volume', '销量');
|
||||
$grid->column('total_amount', '金额');
|
||||
$grid->column('order_completed_at', '结算时间')->sortable();
|
||||
$grid->column('created_at')->sortable();
|
||||
|
||||
$grid->disableCreateButton();
|
||||
$grid->disableActions();
|
||||
$grid->header(function ($collection) use ($grid) {
|
||||
$query = DealerManageSubsidyLogModel::query();
|
||||
|
||||
// 拿到表格筛选 where 条件数组进行遍历
|
||||
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
||||
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = call_user_func_array([$query, $value['method']], $value['arguments'] ?? []);
|
||||
});
|
||||
|
||||
// 查出统计数据
|
||||
$totalAmount = (clone $query)->sum('total_amount');
|
||||
// 自定义组件
|
||||
return "<div style='padding: 10px;'>金额:".$totalAmount.' 元</div>';
|
||||
});
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel(false);
|
||||
$filter->equal('user.phone', '手机号')->width(3);
|
||||
$filter->between('order_completed_at', '结算时间')->dateTime()->width(7);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -3,10 +3,13 @@
|
|||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\DealerManageSubsidyLog;
|
||||
use App\Admin\Widgets\InfoBox;
|
||||
use App\Models\DealerManageSubsidyLog as DealerManageSubsidyLogModel;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Layout\Row;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class DealerManageSubsidyLogController extends AdminController
|
||||
|
|
@ -18,9 +21,20 @@ class DealerManageSubsidyLogController extends AdminController
|
|||
*/
|
||||
protected function grid()
|
||||
{
|
||||
Admin::style(
|
||||
<<<CSS
|
||||
.card-header {
|
||||
margin-top: 1.5rem !important;
|
||||
margin-bottom: -1rem !important;
|
||||
}
|
||||
CSS
|
||||
);
|
||||
|
||||
$builder = DealerManageSubsidyLog::with(['user', 'order', 'product']);
|
||||
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->model()->orderBy('id', 'desc');//默认ID倒叙
|
||||
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('user.phone', '手机号')->copyable();
|
||||
$grid->column('lvl', '等级')->display(function () {
|
||||
|
|
@ -36,6 +50,19 @@ class DealerManageSubsidyLogController extends AdminController
|
|||
$grid->disableCreateButton();
|
||||
$grid->disableActions();
|
||||
$grid->header(function ($collection) use ($grid) {
|
||||
return tap(new Row(), function ($row) use ($grid) {
|
||||
$query = DealerManageSubsidyLogModel::query();
|
||||
|
||||
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
||||
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = call_user_func_array([$query, $value['method']], $value['arguments'] ?? []);
|
||||
});
|
||||
|
||||
$row->column(3, new InfoBox('津贴总额', (clone $query)->sum('total_amount'), 'fa fa-cny'));
|
||||
});
|
||||
$query = DealerManageSubsidyLogModel::query();
|
||||
|
||||
// 拿到表格筛选 where 条件数组进行遍历
|
||||
|
|
|
|||
|
|
@ -0,0 +1,128 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Actions\Grid\DealerManagerSubsidyBatchPay;
|
||||
use App\Admin\Actions\Grid\DealerManagerSubsidyPay;
|
||||
use App\Admin\Repositories\DealerManagerSubsidy;
|
||||
use App\Admin\Widgets\InfoBox;
|
||||
use App\Enums\DealerManagerSubsidyStatus;
|
||||
use App\Models\DealerManagerSubsidy as DealerManagerSubsidyModel;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Layout\Row;
|
||||
|
||||
class DealerManagerSubsidyController extends AdminController
|
||||
{
|
||||
protected $title = '管理者津贴';
|
||||
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
Admin::style(
|
||||
<<<CSS
|
||||
.card-header {
|
||||
margin-top: 1.5rem !important;
|
||||
margin-bottom: -1rem !important;
|
||||
}
|
||||
CSS
|
||||
);
|
||||
|
||||
$builder = DealerManagerSubsidy::with(['dealer', 'user', 'userinfo', 'earning']);
|
||||
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->model()->settled()->orderBy('id', 'desc');
|
||||
|
||||
$grid->column('settle_period', '结算周期')->display(function () {
|
||||
return $this->start_at->rawFormat('Y/m/d') . '-' . $this->end_at->rawFormat('Y/m/d');
|
||||
})->link(function () {
|
||||
return admin_route('dealer_manager_sales_logs.index', [
|
||||
'user[phone]' => $this->user?->phone,
|
||||
'order_completed_at[start]' => $this->start_at->toDateTimeString(),
|
||||
'order_completed_at[end]' => $this->end_at->toDateTimeString(),
|
||||
]);
|
||||
});
|
||||
$grid->column('user.phone', '手机号');
|
||||
$grid->column('userinfo.nickname', '昵称');
|
||||
$grid->column('is_manager', '管理者')->bool();
|
||||
$grid->column('lvl', '经销商等级')->display(function () {
|
||||
return $this->lvl->text();
|
||||
});
|
||||
$grid->column('total_amount', '津贴总额')->prepend('¥');
|
||||
$grid->column('fee', '手续费')->prepend('¥')->help('手续费=津贴总额*手续费率');
|
||||
$grid->column('real_amount', '总收入')->prepend('¥')->help('总收入=津贴总额-手续费');
|
||||
$grid->column('fee_rate', '手续费率')->append('%');
|
||||
$grid->column('remark', '备注')->display('查看')->modal(function ($modal) {
|
||||
$modal->title('备注');
|
||||
|
||||
return "<div style='padding:10px'>".nl2br($this->remark).'</div>';
|
||||
});
|
||||
$grid->column('status', '状态')->display(function ($v) {
|
||||
return '<i class="fa fa-circle" style="font-size: 13px; color: '.$v->color().';"></i> '.$v->text();
|
||||
});
|
||||
$grid->column('earning.pay_at', '付款时间');
|
||||
|
||||
$grid->showRowSelector();
|
||||
|
||||
$grid->tools(function ($tools) {
|
||||
$tools->batch(function ($batch) {
|
||||
$batch->disableDelete();
|
||||
|
||||
if (Admin::user()->can('dcat.admin.dealer_manager_subsidies.batch_pay')) {
|
||||
$batch->add(new DealerManagerSubsidyBatchPay());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$grid->actions(function (Grid\Displayers\Actions $actions) {
|
||||
if ($actions->row->isPending() && Admin::user()->can('dcat.admin.dealer_manager_subsidies.pay')) {
|
||||
$actions->append(new DealerManagerSubsidyPay());
|
||||
}
|
||||
});
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
|
||||
$filter->equal('user.phone', '手机号')->width(3);
|
||||
$filter->equal('status', '状态')->select(DealerManagerSubsidyStatus::texts())->width(3);
|
||||
$filter->whereBetween('settle_period', function ($query) {
|
||||
$start = $this->input['start'] ?? null;
|
||||
$end = $this->input['end'] ?? null;
|
||||
|
||||
$query->when($start, function ($query, $start) {
|
||||
$query->where('start_at', '>=', "{$start} 00:00:00");
|
||||
});
|
||||
|
||||
$query->when($end, function ($query, $end) {
|
||||
$query->where('end_at', '<=', "{$end} 23:59:59");
|
||||
});
|
||||
}, '结算周期')->date()->width(6);
|
||||
});
|
||||
|
||||
$grid->header(function ($collection) use ($grid) {
|
||||
return tap(new Row(), function ($row) use ($grid) {
|
||||
$query = DealerManagerSubsidyModel::query();
|
||||
|
||||
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
||||
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = call_user_func_array([$query, $value['method']], $value['arguments'] ?? []);
|
||||
});
|
||||
|
||||
$totalAmount = (clone $query)->sum('total_amount');
|
||||
$totalFee = (clone $query)->sum('fee');
|
||||
|
||||
$row->column(3, new InfoBox('津贴总额', $totalAmount, 'fa fa-cny'));
|
||||
$row->column(3, new InfoBox('手续费', $totalFee, 'fa fa-cny'));
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -3,11 +3,14 @@
|
|||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\DealerPurchaseLog;
|
||||
use App\Admin\Widgets\InfoBox;
|
||||
use App\Models\DealerPurchaseLog as DealerPurchaseLogModel;
|
||||
use App\Models\User;
|
||||
use Dcat\Admin\Admin;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Layout\Row;
|
||||
use Dcat\Admin\Show;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
|
||||
|
|
@ -20,6 +23,15 @@ class DealerPurchaseLogController extends AdminController
|
|||
*/
|
||||
protected function grid()
|
||||
{
|
||||
Admin::style(
|
||||
<<<CSS
|
||||
.card-header {
|
||||
margin-top: 1.5rem !important;
|
||||
margin-bottom: -1rem !important;
|
||||
}
|
||||
CSS
|
||||
);
|
||||
|
||||
$builder = DealerPurchaseLog::with(['user', 'order']);
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$phone = Request::input('user_phone', '');
|
||||
|
|
@ -43,21 +55,19 @@ class DealerPurchaseLogController extends AdminController
|
|||
$grid->column('created_at')->sortable();
|
||||
|
||||
$grid->header(function ($collection) use ($grid) {
|
||||
$query = DealerPurchaseLogModel::query();
|
||||
return tap(new Row(), function ($row) use ($grid) {
|
||||
$query = DealerPurchaseLogModel::query();
|
||||
|
||||
// 拿到表格筛选 where 条件数组进行遍历
|
||||
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
||||
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
||||
return;
|
||||
}
|
||||
$grid->model()->getQueries()->unique()->each(function ($value) use (&$query) {
|
||||
if (in_array($value['method'], ['paginate', 'get', 'orderBy', 'orderByDesc'], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = call_user_func_array([$query, $value['method']], $value['arguments'] ?? []);
|
||||
$query = call_user_func_array([$query, $value['method']], $value['arguments'] ?? []);
|
||||
});
|
||||
|
||||
$row->column(3, new InfoBox('进货业绩', (clone $query)->sum('total_amount'), 'fa fa-cny'));
|
||||
});
|
||||
|
||||
// 查出统计数据
|
||||
$totalAmount = (clone $query)->sum('total_amount');
|
||||
// 自定义组件
|
||||
return "<div style='padding: 10px;'>金额:".$totalAmount.' 元</div>';
|
||||
});
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Controllers;
|
||||
|
||||
use App\Admin\Repositories\QuotaV1Log;
|
||||
use Dcat\Admin\Form;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Http\Controllers\AdminController;
|
||||
use Dcat\Admin\Show;
|
||||
|
||||
class QuotaV1LogController extends AdminController
|
||||
{
|
||||
/**
|
||||
* Make a grid builder.
|
||||
*
|
||||
* @return Grid
|
||||
*/
|
||||
protected function grid()
|
||||
{
|
||||
$builder = QuotaV1Log::with(['user', 'user.userInfo']);
|
||||
return Grid::make($builder, function (Grid $grid) {
|
||||
$grid->column('id')->sortable();
|
||||
$grid->column('user.phone', '手机号')->copyable();
|
||||
$grid->column('user.userInfo.nickname', '昵称');
|
||||
// $grid->column('loggable_type');
|
||||
// $grid->column('loggable_id');
|
||||
// $grid->column('action');
|
||||
$grid->column('before_balance');
|
||||
$grid->column('change_balance');
|
||||
$grid->column('remarks');
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
$grid->column('created_at')->sortable();
|
||||
// $grid->column('updated_at')->sortable();
|
||||
$grid->disableActions();
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->like('user.phone', '手机号')->width(3);
|
||||
// $filter->equal('id');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a show builder.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return Show
|
||||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, new QuotaV1Log(), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('user_id');
|
||||
$show->field('loggable_type');
|
||||
$show->field('loggable_id');
|
||||
$show->field('action');
|
||||
$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 QuotaV1Log(), function (Form $form) {
|
||||
$form->display('id');
|
||||
$form->text('user_id');
|
||||
$form->text('loggable_type');
|
||||
$form->text('loggable_id');
|
||||
$form->text('action');
|
||||
$form->text('before_balance');
|
||||
$form->text('change_balance');
|
||||
$form->text('remarks');
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -34,6 +34,9 @@ class QuotaV1SendJobController extends AdminController
|
|||
if (Admin::user()->can('dcat.admin.quota_v1_send_jobs.deduction')) {
|
||||
$tools->append(new Deduction());
|
||||
}
|
||||
if (Admin::user()->can('dcat.admin.quota_v1_send_jobs.logs_index')) {
|
||||
$tools->append('<a href="'.admin_route('quota_v1_send_jobs.logs_index').'" target="_blank"> <i class="feather grid-action-icon icon-list"></i>变动记录</a>');
|
||||
}
|
||||
});
|
||||
$grid->column('amount')->display(function ($value) {
|
||||
return bcdiv($value, 100, 2);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class QuotaV1Deduction extends Form implements LazyRenderable
|
|||
public function form()
|
||||
{
|
||||
$this->select('user_id', '用户手机号')->ajax(admin_route('api.users'))->required();
|
||||
$this->currency('change_balance', '扣减配额')->symbol('¥')->required();
|
||||
$this->currency('change_balance', '扣减配额')->digits(3)->symbol('¥')->required();
|
||||
$this->confirm('是否确认扣减?', '提交后该动作无法逆转');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class QuotaV1Recharge extends Form implements LazyRenderable
|
|||
public function form()
|
||||
{
|
||||
$this->select('user_id', '用户手机号')->ajax(admin_route('api.users'))->required();
|
||||
$this->currency('change_balance', '增加配额')->symbol('¥')->required();
|
||||
$this->currency('change_balance', '增加配额')->digits(3)->required();
|
||||
$this->confirm('是否确认增加老配额?', '提交后该动作无法逆转');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Admin\Renderable;
|
|||
use App\Models\SalesValueLog;
|
||||
use Dcat\Admin\Grid;
|
||||
use Dcat\Admin\Grid\LazyRenderable;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
|
||||
class UserSalesValueLogSimpleTable extends LazyRenderable
|
||||
{
|
||||
|
|
@ -14,6 +15,12 @@ class UserSalesValueLogSimpleTable extends LazyRenderable
|
|||
$builder = SalesValueLog::query();
|
||||
return Grid::make($builder, function (Grid $grid) use ($userId) {
|
||||
$grid->model()->where('user_id', $userId);
|
||||
// $start = now()->subDays(30)->toDateString();
|
||||
// $end = now()->toDateString();
|
||||
// $timeZone = Request::get('app-admin-renderable-usersalesvaluelogsimpletable_created_at', []);
|
||||
// if (empty($timeZone)) {
|
||||
// $grid->model()->whereBetween('created_at', [$start, $end]);
|
||||
// }
|
||||
$grid->column('type')->using([
|
||||
1=>'个人',
|
||||
2=>'团队',
|
||||
|
|
@ -46,10 +53,8 @@ class UserSalesValueLogSimpleTable extends LazyRenderable
|
|||
return "<div style='padding: 10px;'>个人消费值:".$salesValue1.' <br> 团队消费值:'.$salesValue2.'</div>';
|
||||
});
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->between('created_at', '时间')->date()->default([
|
||||
'start'=>now()->subDays(30)->toDateString(),
|
||||
'end'=>now()->toDateString(),
|
||||
]);
|
||||
$filter->expand(false);
|
||||
$filter->between('created_at', '时间')->date();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\DealerManageSubsidy as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class DealerManageSubsidy extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\DealerManagerSubsidy as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class DealerManagerSubsidy extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Repositories;
|
||||
|
||||
use App\Models\QuotaV1Log as Model;
|
||||
use Dcat\Admin\Repositories\EloquentRepository;
|
||||
|
||||
class QuotaV1Log extends EloquentRepository
|
||||
{
|
||||
/**
|
||||
* Model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $eloquentClass = Model::class;
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
|
||||
namespace App\Admin\Widgets;
|
||||
|
||||
use Dcat\Admin\Widgets\Widget;
|
||||
|
||||
class InfoBox extends Widget
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $view = 'admin::widgets.info-box';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $content;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $style = 'primary';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $icon;
|
||||
|
||||
public function __construct(string $title, string $content, ?string $icon = null)
|
||||
{
|
||||
$this->title($title);
|
||||
$this->content($content);
|
||||
$this->icon($icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Info Box 图标
|
||||
*
|
||||
* @param string $icon
|
||||
* @return $this
|
||||
*/
|
||||
public function icon(string $icon = null)
|
||||
{
|
||||
$this->icon = $icon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info Box 内容
|
||||
*
|
||||
* @param string $content
|
||||
* @return $this
|
||||
*/
|
||||
public function content($content)
|
||||
{
|
||||
$this->content = $content;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Info Box 标题
|
||||
*
|
||||
* @param string $title
|
||||
* @return $this
|
||||
*/
|
||||
public function title($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add style.
|
||||
*
|
||||
* @param string $style
|
||||
* @return $this
|
||||
*/
|
||||
public function style($style = 'info')
|
||||
{
|
||||
$this->style = $style;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Variables in view.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function defaultVariables()
|
||||
{
|
||||
$this->class('info-box');
|
||||
|
||||
return [
|
||||
'title' => $this->title,
|
||||
'content' => $this->content,
|
||||
'icon' => $this->icon,
|
||||
'style' => $this->style,
|
||||
'attributes' => $this->formatHtmlAttributes(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -154,6 +154,7 @@ Route::group([
|
|||
'index', 'create', 'store', 'edit', 'update', 'destroy',
|
||||
])->names('quota_v1_send_jobs');
|
||||
$router->get('quota-v1-send-jobs/{job}/log-list', 'QuotaV1SendJobController@logList')->name('quota_v1_send_jobs.log_list');
|
||||
$router->get('quota-v1-send-jobs/logs-index', 'QuotaV1LogController@index')->name('quota_v1_send_jobs.logs_index');
|
||||
|
||||
$router->resource('order-refunds', 'OrderRefundLogController')->only([
|
||||
'index',
|
||||
|
|
@ -185,9 +186,14 @@ 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-subsidies', 'DealerManagerSubsidyController@index')->name('dealer_manager_subsidies.index');
|
||||
$router->get('dealer-manager-sales-logs', 'DealerManagerSalesLogController@index')->name('dealer_manager_sales_logs.index');
|
||||
|
||||
// 管理津贴
|
||||
$router->get('dealer-manage-subsidies', 'DealerManageSubsidyController@index')->name('dealer_manage_subsidies.index');
|
||||
$router->get('dealer-manage-subsidy-logs', 'DealerManageSubsidyLogController@index')->name('dealer_manage_subsidy_logs.index');
|
||||
|
||||
$router->get('dealer-purchase-logs', 'DealerPurchaseLogController@index')->name('dealer_purchase_logs.index');
|
||||
|
||||
//批零余额提现
|
||||
|
|
|
|||
|
|
@ -5,4 +5,25 @@ namespace App\Enums;
|
|||
enum DealerManageSubsidyStatus: int {
|
||||
case Pending = 0;
|
||||
case Completed = 5;
|
||||
|
||||
public function color(): string
|
||||
{
|
||||
return match ($this) {
|
||||
static::Pending => '#5b69bc',
|
||||
static::Completed => '#21b978',
|
||||
};
|
||||
}
|
||||
|
||||
public function text(): string
|
||||
{
|
||||
return static::texts()[$this->value] ?? 'Unknown';
|
||||
}
|
||||
|
||||
public static function texts(): array
|
||||
{
|
||||
return [
|
||||
static::Pending->value => '待付款',
|
||||
static::Completed->value => '已付款',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,4 +5,25 @@ namespace App\Enums;
|
|||
enum DealerManagerSubsidyStatus: int {
|
||||
case Pending = 0;
|
||||
case Completed = 5;
|
||||
|
||||
public function color(): string
|
||||
{
|
||||
return match ($this) {
|
||||
static::Pending => '#5b69bc',
|
||||
static::Completed => '#21b978',
|
||||
};
|
||||
}
|
||||
|
||||
public function text(): string
|
||||
{
|
||||
return static::texts()[$this->value] ?? 'Unknown';
|
||||
}
|
||||
|
||||
public static function texts(): array
|
||||
{
|
||||
return [
|
||||
static::Pending->value => '待付款',
|
||||
static::Completed->value => '已付款',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,17 @@ class DealerManageSubsidy extends Model
|
|||
'is_settle',
|
||||
];
|
||||
|
||||
/**
|
||||
* 仅查询已结算的管理津贴
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeSettled($query)
|
||||
{
|
||||
return $query->where('is_settle', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 此管理津贴所属的经销商
|
||||
*/
|
||||
|
|
@ -46,11 +57,31 @@ class DealerManageSubsidy extends Model
|
|||
return $this->belongsTo(Dealer::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function userinfo()
|
||||
{
|
||||
return $this->belongsTo(UserInfo::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
public function earning()
|
||||
{
|
||||
return $this->morphOne(DealerEarning::class, 'earningable');
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅查询待付款的管理津贴
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPending(): bool
|
||||
{
|
||||
return $this->is_settle && $this->status === DealerManageSubsidyStatus::Pending;
|
||||
}
|
||||
|
||||
public function isCompleted()
|
||||
{
|
||||
return $this->status === DealerManageSubsidyStatus::Completed;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,27 @@ class DealerManagerSubsidy extends Model
|
|||
'is_settle',
|
||||
];
|
||||
|
||||
/**
|
||||
* 仅查询已结算的订单
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeSettled($query)
|
||||
{
|
||||
return $query->where('is_settle', true);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function userinfo()
|
||||
{
|
||||
return $this->belongsTo(UserInfo::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 此管理津贴所属的经销商
|
||||
*/
|
||||
|
|
@ -51,6 +72,16 @@ class DealerManagerSubsidy extends Model
|
|||
return $this->morphOne(DealerEarning::class, 'earningable');
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅查询待付款的管理津贴
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPending(): bool
|
||||
{
|
||||
return $this->is_settle && $this->status === DealerManagerSubsidyStatus::Pending;
|
||||
}
|
||||
|
||||
public function isCompleted()
|
||||
{
|
||||
return $this->status === DealerManagerSubsidyStatus::Completed;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,33 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class QuotaV1Log extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
public const ACTION_ADMIN_RECHARGE = 7;
|
||||
public const ACTION_ADMIN_DEDUCTION = 8;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'loggable_id',
|
||||
'loggable_type',
|
||||
'action',
|
||||
'before_balance',
|
||||
'change_balance',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -368,6 +368,14 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac
|
|||
return $this->hasMany(QuotaLog::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户的配额日志
|
||||
*/
|
||||
public function quotaV1Logs()
|
||||
{
|
||||
return $this->hasMany(QuotaV1Log::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 属于此用户的团队销售值(含自己的销售值)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ class AfterSaleService
|
|||
throw new BizException('赠品不能发起退款/退款退货操作');
|
||||
}
|
||||
|
||||
if ($orderProduct->order->is_change && in_array($params['type'], [AfterSale::TYPE_REFUND, Aftersale::TYPE_REFUND_AND_RETURN])) {
|
||||
throw new BizException('换货后的商品不能发起退款/退款退货操作');
|
||||
}
|
||||
|
||||
$amount = ($num == $orderProduct->quantity) ? $orderProduct->total_amount : bcmul(bcdiv($orderProduct->total_amount, $orderProduct->quantity), $num);
|
||||
|
||||
if ($amount == 0 && in_array($params['type'], [AfterSale::TYPE_REFUND])) {
|
||||
|
|
@ -275,7 +279,7 @@ class AfterSaleService
|
|||
* @param string $remarks
|
||||
* @return void
|
||||
*/
|
||||
public function shippingFail(AfterSale $afterSale, $remarks ='仓库验收未通过')
|
||||
public function shippingFail(AfterSale $afterSale, $remarks = '仓库验收未通过')
|
||||
{
|
||||
if ($this->isWaitShipping($afterSale)) {
|
||||
$afterSale->update([
|
||||
|
|
@ -324,7 +328,7 @@ class AfterSaleService
|
|||
* @param string $remarks
|
||||
* @return void
|
||||
*/
|
||||
public function shipping(AfterSale $afterSale, $remarks ='仓库验收通过')
|
||||
public function shipping(AfterSale $afterSale, $remarks = '仓库验收通过')
|
||||
{
|
||||
if ($this->isWaitShipping($afterSale)) {
|
||||
$afterSale->update([
|
||||
|
|
@ -346,7 +350,7 @@ class AfterSaleService
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function finance(AfterSale $afterSale, $remarks ='退款成功')
|
||||
public function finance(AfterSale $afterSale, $remarks = '退款成功')
|
||||
{
|
||||
if ($this->isWaitFinance($afterSale)) {
|
||||
$order = $afterSale->order;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\Dealer;
|
||||
|
||||
use App\Enums\DealerEarningStatus;
|
||||
use App\Enums\DealerManageSubsidyStatus;
|
||||
use App\Enums\DealerWalletAction;
|
||||
use App\Exceptions\BizException;
|
||||
use App\Models\DealerEarning;
|
||||
use App\Models\DealerManageSubsidy;
|
||||
|
||||
class ManageSubsidyService
|
||||
{
|
||||
/**
|
||||
* @param \App\Models\DealerManageSubsidy $dealerManageSubsidy
|
||||
* @return void
|
||||
*/
|
||||
public function pay(DealerManageSubsidy $dealerManageSubsidy)
|
||||
{
|
||||
if (! $dealerManageSubsidy->isPending()) {
|
||||
throw new BizException('管理津贴 不是待付款状态');
|
||||
}
|
||||
|
||||
$dealerManageSubsidy->update([
|
||||
'status' => DealerManageSubsidyStatus::Completed,
|
||||
]);
|
||||
|
||||
$dealerManageSubsidy->earning->update([
|
||||
'pay_way' => DealerEarning::PAY_WAY_WALLET,
|
||||
'pay_at' => now(),
|
||||
'pay_info' => null,
|
||||
'status' => DealerEarningStatus::Completed,
|
||||
]);
|
||||
|
||||
(new WalletService())->changeBalance(
|
||||
$dealerManageSubsidy->user,
|
||||
$dealerManageSubsidy->real_amount,
|
||||
DealerWalletAction::ManageSubsidyIn,
|
||||
'收入-管理津贴',
|
||||
$dealerManageSubsidy
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\Dealer;
|
||||
|
||||
use App\Enums\DealerEarningStatus;
|
||||
use App\Enums\DealerManagerSubsidyStatus;
|
||||
use App\Enums\DealerWalletAction;
|
||||
use App\Exceptions\BizException;
|
||||
use App\Models\DealerEarning;
|
||||
use App\Models\DealerManagerSubsidy;
|
||||
|
||||
class ManagerSubsidyService
|
||||
{
|
||||
/**
|
||||
* @param \App\Models\DealerManagerSubsidy $dealerManagerSubsidy
|
||||
* @return void
|
||||
*/
|
||||
public function pay(DealerManagerSubsidy $dealerManagerSubsidy)
|
||||
{
|
||||
if (! $dealerManagerSubsidy->isPending()) {
|
||||
throw new BizException('管理者津贴 不是待付款状态');
|
||||
}
|
||||
|
||||
$dealerManagerSubsidy->update([
|
||||
'status' => DealerManagerSubsidyStatus::Completed,
|
||||
]);
|
||||
|
||||
$dealerManagerSubsidy->earning->update([
|
||||
'pay_way' => DealerEarning::PAY_WAY_WALLET,
|
||||
'pay_at' => now(),
|
||||
'pay_info' => null,
|
||||
'status' => DealerEarningStatus::Completed,
|
||||
]);
|
||||
|
||||
(new WalletService())->changeBalance(
|
||||
$dealerManagerSubsidy->user,
|
||||
$dealerManagerSubsidy->real_amount,
|
||||
DealerWalletAction::ManagerSubsidyIn,
|
||||
'收入-管理者津贴',
|
||||
$dealerManagerSubsidy
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -11,13 +11,13 @@ class QuotaV1Service
|
|||
* 变老配额余额
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @param int $changeBalance
|
||||
* @param float $changeBalance
|
||||
* @param int $action
|
||||
* @param string|null $remarks
|
||||
* @param mixed $loggable
|
||||
* @return void
|
||||
*/
|
||||
public function changeBalance(User $user, int $changeBalance, int $action, ?string $remarks = null, $loggable = null)
|
||||
public function changeBalance(User $user, float $changeBalance, int $action, ?string $remarks = null, $loggable = null)
|
||||
{
|
||||
if ($changeBalance === 0) {
|
||||
return;
|
||||
|
|
@ -45,7 +45,7 @@ class QuotaV1Service
|
|||
$user->userInfo()->decrement('quota_v1', $_changeBalance);
|
||||
}
|
||||
|
||||
$user->walletLogs()->create([
|
||||
$user->quotaV1Logs()->create([
|
||||
'loggable_id' => $loggable?->id,
|
||||
'loggable_type' => $loggable?->getMorphClass(),
|
||||
'before_balance' => $beforeBalance,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ChangeBeforeBalanceToQuotaV1LogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('quota_v1_logs', function (Blueprint $table) {
|
||||
$table->decimal('before_balance', 12, 3)->change();
|
||||
$table->decimal('change_balance', 12, 3)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('quota_v1_logs', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -342,7 +342,7 @@ class AdminMenuSeeder extends Seeder
|
|||
[
|
||||
'title'=>'管理者津贴',
|
||||
'icon' => '',
|
||||
'uri' => 'dealer-earnings-manager?filter-earningable_type[]=dealer_manager_subsidy',
|
||||
'uri' => 'dealer-earnings-manage?filter-earningable_type[]=dealer_manager_subsidy',
|
||||
],
|
||||
[
|
||||
'title'=>'管理者津贴明细',
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ class AdminPermissionSeeder extends Seeder
|
|||
'log_list'=>['name' =>'分红记录'],
|
||||
'recharge'=>['name' =>'增加配额'],
|
||||
'deduction'=>['name' =>'扣减配额'],
|
||||
'logs_index'=>['name' =>'变动日志'],
|
||||
],
|
||||
],
|
||||
'dealers' =>[
|
||||
|
|
@ -351,10 +352,26 @@ class AdminPermissionSeeder extends Seeder
|
|||
'pay'=>['name' =>'确认打款'],
|
||||
],
|
||||
],
|
||||
'dealer_manager_subsidies' => [
|
||||
'name' =>'管理者津贴',
|
||||
'curd' => ['index'],
|
||||
'children' => [
|
||||
'pay' => ['name' => '付款'],
|
||||
'batch_pay' => ['name' => '批量付款'],
|
||||
],
|
||||
],
|
||||
'dealer_manager_sales_logs'=>[
|
||||
'name' =>'管理者津贴明细',
|
||||
'curd' => ['index'],
|
||||
],
|
||||
'dealer_manage_subsidies' => [
|
||||
'name' =>'管理津贴',
|
||||
'curd' => ['index'],
|
||||
'children' => [
|
||||
'pay' => ['name' => '付款'],
|
||||
'batch_pay' => ['name' => '批量付款'],
|
||||
],
|
||||
],
|
||||
'dealer_manage_subsidy_logs'=>[
|
||||
'name' =>'管理津贴明细',
|
||||
'curd' => ['index'],
|
||||
|
|
|
|||
|
|
@ -12,13 +12,25 @@ namespace Dcat\Admin {
|
|||
|
||||
/**
|
||||
* @property Grid\Column|Collection width
|
||||
* @property Grid\Column|Collection content
|
||||
* @property Grid\Column|Collection coupons_rule
|
||||
* @property Grid\Column|Collection cover
|
||||
* @property Grid\Column|Collection created_at
|
||||
* @property Grid\Column|Collection dimensions
|
||||
* @property Grid\Column|Collection ended_at
|
||||
* @property Grid\Column|Collection gifts_rule
|
||||
* @property Grid\Column|Collection id
|
||||
* @property Grid\Column|Collection is_use
|
||||
* @property Grid\Column|Collection started_at
|
||||
* @property Grid\Column|Collection updated_at
|
||||
* @property Grid\Column|Collection activity_id
|
||||
* @property Grid\Column|Collection coupon_id
|
||||
* @property Grid\Column|Collection qty
|
||||
* @property Grid\Column|Collection sku_id
|
||||
* @property Grid\Column|Collection part_id
|
||||
* @property Grid\Column|Collection dimensions
|
||||
* @property Grid\Column|Collection is_show
|
||||
* @property Grid\Column|Collection key
|
||||
* @property Grid\Column|Collection name
|
||||
* @property Grid\Column|Collection updated_at
|
||||
* @property Grid\Column|Collection detail
|
||||
* @property Grid\Column|Collection type
|
||||
* @property Grid\Column|Collection version
|
||||
|
|
@ -72,8 +84,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection article_id
|
||||
* @property Grid\Column|Collection author_name
|
||||
* @property Grid\Column|Collection category_id
|
||||
* @property Grid\Column|Collection content
|
||||
* @property Grid\Column|Collection cover
|
||||
* @property Grid\Column|Collection likes
|
||||
* @property Grid\Column|Collection media_content
|
||||
* @property Grid\Column|Collection media_type
|
||||
|
|
@ -91,7 +101,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection transferable
|
||||
* @property Grid\Column|Collection continue_click_times
|
||||
* @property Grid\Column|Collection last_click_at
|
||||
* @property Grid\Column|Collection coupon_id
|
||||
* @property Grid\Column|Collection is_enable
|
||||
* @property Grid\Column|Collection ranges
|
||||
* @property Grid\Column|Collection administrator_id
|
||||
|
|
@ -128,7 +137,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection last_consignor_id
|
||||
* @property Grid\Column|Collection new_consignor_id
|
||||
* @property Grid\Column|Collection price
|
||||
* @property Grid\Column|Collection qty
|
||||
* @property Grid\Column|Collection sale_price
|
||||
* @property Grid\Column|Collection reason
|
||||
* @property Grid\Column|Collection allocated_at
|
||||
|
|
@ -212,7 +220,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection gift_for_sku_id
|
||||
* @property Grid\Column|Collection reduced_amount
|
||||
* @property Grid\Column|Collection remain_quantity
|
||||
* @property Grid\Column|Collection sku_id
|
||||
* @property Grid\Column|Collection specs
|
||||
* @property Grid\Column|Collection spu_id
|
||||
* @property Grid\Column|Collection vip_discount_amount
|
||||
|
|
@ -238,7 +245,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection gift_sku_id
|
||||
* @property Grid\Column|Collection remaining
|
||||
* @property Grid\Column|Collection attrs
|
||||
* @property Grid\Column|Collection part_id
|
||||
* @property Grid\Column|Collection applicant_id
|
||||
* @property Grid\Column|Collection reviewer_id
|
||||
* @property Grid\Column|Collection buynote_id
|
||||
|
|
@ -256,7 +262,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection message_type
|
||||
* @property Grid\Column|Collection change_quota
|
||||
* @property Grid\Column|Collection order_user_id
|
||||
* @property Grid\Column|Collection is_use
|
||||
* @property Grid\Column|Collection size
|
||||
* @property Grid\Column|Collection x
|
||||
* @property Grid\Column|Collection y
|
||||
|
|
@ -311,13 +316,25 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection status_remark
|
||||
*
|
||||
* @method Grid\Column|Collection width(string $label = null)
|
||||
* @method Grid\Column|Collection content(string $label = null)
|
||||
* @method Grid\Column|Collection coupons_rule(string $label = null)
|
||||
* @method Grid\Column|Collection cover(string $label = null)
|
||||
* @method Grid\Column|Collection created_at(string $label = null)
|
||||
* @method Grid\Column|Collection dimensions(string $label = null)
|
||||
* @method Grid\Column|Collection ended_at(string $label = null)
|
||||
* @method Grid\Column|Collection gifts_rule(string $label = null)
|
||||
* @method Grid\Column|Collection id(string $label = null)
|
||||
* @method Grid\Column|Collection is_use(string $label = null)
|
||||
* @method Grid\Column|Collection started_at(string $label = null)
|
||||
* @method Grid\Column|Collection updated_at(string $label = null)
|
||||
* @method Grid\Column|Collection activity_id(string $label = null)
|
||||
* @method Grid\Column|Collection coupon_id(string $label = null)
|
||||
* @method Grid\Column|Collection qty(string $label = null)
|
||||
* @method Grid\Column|Collection sku_id(string $label = null)
|
||||
* @method Grid\Column|Collection part_id(string $label = null)
|
||||
* @method Grid\Column|Collection dimensions(string $label = null)
|
||||
* @method Grid\Column|Collection is_show(string $label = null)
|
||||
* @method Grid\Column|Collection key(string $label = null)
|
||||
* @method Grid\Column|Collection name(string $label = null)
|
||||
* @method Grid\Column|Collection updated_at(string $label = null)
|
||||
* @method Grid\Column|Collection detail(string $label = null)
|
||||
* @method Grid\Column|Collection type(string $label = null)
|
||||
* @method Grid\Column|Collection version(string $label = null)
|
||||
|
|
@ -371,8 +388,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection article_id(string $label = null)
|
||||
* @method Grid\Column|Collection author_name(string $label = null)
|
||||
* @method Grid\Column|Collection category_id(string $label = null)
|
||||
* @method Grid\Column|Collection content(string $label = null)
|
||||
* @method Grid\Column|Collection cover(string $label = null)
|
||||
* @method Grid\Column|Collection likes(string $label = null)
|
||||
* @method Grid\Column|Collection media_content(string $label = null)
|
||||
* @method Grid\Column|Collection media_type(string $label = null)
|
||||
|
|
@ -390,7 +405,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection transferable(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)
|
||||
* @method Grid\Column|Collection is_enable(string $label = null)
|
||||
* @method Grid\Column|Collection ranges(string $label = null)
|
||||
* @method Grid\Column|Collection administrator_id(string $label = null)
|
||||
|
|
@ -427,7 +441,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection last_consignor_id(string $label = null)
|
||||
* @method Grid\Column|Collection new_consignor_id(string $label = null)
|
||||
* @method Grid\Column|Collection price(string $label = null)
|
||||
* @method Grid\Column|Collection qty(string $label = null)
|
||||
* @method Grid\Column|Collection sale_price(string $label = null)
|
||||
* @method Grid\Column|Collection reason(string $label = null)
|
||||
* @method Grid\Column|Collection allocated_at(string $label = null)
|
||||
|
|
@ -511,7 +524,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection gift_for_sku_id(string $label = null)
|
||||
* @method Grid\Column|Collection reduced_amount(string $label = null)
|
||||
* @method Grid\Column|Collection remain_quantity(string $label = null)
|
||||
* @method Grid\Column|Collection sku_id(string $label = null)
|
||||
* @method Grid\Column|Collection specs(string $label = null)
|
||||
* @method Grid\Column|Collection spu_id(string $label = null)
|
||||
* @method Grid\Column|Collection vip_discount_amount(string $label = null)
|
||||
|
|
@ -537,7 +549,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection gift_sku_id(string $label = null)
|
||||
* @method Grid\Column|Collection remaining(string $label = null)
|
||||
* @method Grid\Column|Collection attrs(string $label = null)
|
||||
* @method Grid\Column|Collection part_id(string $label = null)
|
||||
* @method Grid\Column|Collection applicant_id(string $label = null)
|
||||
* @method Grid\Column|Collection reviewer_id(string $label = null)
|
||||
* @method Grid\Column|Collection buynote_id(string $label = null)
|
||||
|
|
@ -555,7 +566,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection message_type(string $label = null)
|
||||
* @method Grid\Column|Collection change_quota(string $label = null)
|
||||
* @method Grid\Column|Collection order_user_id(string $label = null)
|
||||
* @method Grid\Column|Collection is_use(string $label = null)
|
||||
* @method Grid\Column|Collection size(string $label = null)
|
||||
* @method Grid\Column|Collection x(string $label = null)
|
||||
* @method Grid\Column|Collection y(string $label = null)
|
||||
|
|
@ -615,13 +625,25 @@ namespace Dcat\Admin {
|
|||
|
||||
/**
|
||||
* @property Show\Field|Collection width
|
||||
* @property Show\Field|Collection content
|
||||
* @property Show\Field|Collection coupons_rule
|
||||
* @property Show\Field|Collection cover
|
||||
* @property Show\Field|Collection created_at
|
||||
* @property Show\Field|Collection dimensions
|
||||
* @property Show\Field|Collection ended_at
|
||||
* @property Show\Field|Collection gifts_rule
|
||||
* @property Show\Field|Collection id
|
||||
* @property Show\Field|Collection is_use
|
||||
* @property Show\Field|Collection started_at
|
||||
* @property Show\Field|Collection updated_at
|
||||
* @property Show\Field|Collection activity_id
|
||||
* @property Show\Field|Collection coupon_id
|
||||
* @property Show\Field|Collection qty
|
||||
* @property Show\Field|Collection sku_id
|
||||
* @property Show\Field|Collection part_id
|
||||
* @property Show\Field|Collection dimensions
|
||||
* @property Show\Field|Collection is_show
|
||||
* @property Show\Field|Collection key
|
||||
* @property Show\Field|Collection name
|
||||
* @property Show\Field|Collection updated_at
|
||||
* @property Show\Field|Collection detail
|
||||
* @property Show\Field|Collection type
|
||||
* @property Show\Field|Collection version
|
||||
|
|
@ -675,8 +697,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection article_id
|
||||
* @property Show\Field|Collection author_name
|
||||
* @property Show\Field|Collection category_id
|
||||
* @property Show\Field|Collection content
|
||||
* @property Show\Field|Collection cover
|
||||
* @property Show\Field|Collection likes
|
||||
* @property Show\Field|Collection media_content
|
||||
* @property Show\Field|Collection media_type
|
||||
|
|
@ -694,7 +714,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection transferable
|
||||
* @property Show\Field|Collection continue_click_times
|
||||
* @property Show\Field|Collection last_click_at
|
||||
* @property Show\Field|Collection coupon_id
|
||||
* @property Show\Field|Collection is_enable
|
||||
* @property Show\Field|Collection ranges
|
||||
* @property Show\Field|Collection administrator_id
|
||||
|
|
@ -731,7 +750,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection last_consignor_id
|
||||
* @property Show\Field|Collection new_consignor_id
|
||||
* @property Show\Field|Collection price
|
||||
* @property Show\Field|Collection qty
|
||||
* @property Show\Field|Collection sale_price
|
||||
* @property Show\Field|Collection reason
|
||||
* @property Show\Field|Collection allocated_at
|
||||
|
|
@ -815,7 +833,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection gift_for_sku_id
|
||||
* @property Show\Field|Collection reduced_amount
|
||||
* @property Show\Field|Collection remain_quantity
|
||||
* @property Show\Field|Collection sku_id
|
||||
* @property Show\Field|Collection specs
|
||||
* @property Show\Field|Collection spu_id
|
||||
* @property Show\Field|Collection vip_discount_amount
|
||||
|
|
@ -841,7 +858,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection gift_sku_id
|
||||
* @property Show\Field|Collection remaining
|
||||
* @property Show\Field|Collection attrs
|
||||
* @property Show\Field|Collection part_id
|
||||
* @property Show\Field|Collection applicant_id
|
||||
* @property Show\Field|Collection reviewer_id
|
||||
* @property Show\Field|Collection buynote_id
|
||||
|
|
@ -859,7 +875,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection message_type
|
||||
* @property Show\Field|Collection change_quota
|
||||
* @property Show\Field|Collection order_user_id
|
||||
* @property Show\Field|Collection is_use
|
||||
* @property Show\Field|Collection size
|
||||
* @property Show\Field|Collection x
|
||||
* @property Show\Field|Collection y
|
||||
|
|
@ -914,13 +929,25 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection status_remark
|
||||
*
|
||||
* @method Show\Field|Collection width(string $label = null)
|
||||
* @method Show\Field|Collection content(string $label = null)
|
||||
* @method Show\Field|Collection coupons_rule(string $label = null)
|
||||
* @method Show\Field|Collection cover(string $label = null)
|
||||
* @method Show\Field|Collection created_at(string $label = null)
|
||||
* @method Show\Field|Collection dimensions(string $label = null)
|
||||
* @method Show\Field|Collection ended_at(string $label = null)
|
||||
* @method Show\Field|Collection gifts_rule(string $label = null)
|
||||
* @method Show\Field|Collection id(string $label = null)
|
||||
* @method Show\Field|Collection is_use(string $label = null)
|
||||
* @method Show\Field|Collection started_at(string $label = null)
|
||||
* @method Show\Field|Collection updated_at(string $label = null)
|
||||
* @method Show\Field|Collection activity_id(string $label = null)
|
||||
* @method Show\Field|Collection coupon_id(string $label = null)
|
||||
* @method Show\Field|Collection qty(string $label = null)
|
||||
* @method Show\Field|Collection sku_id(string $label = null)
|
||||
* @method Show\Field|Collection part_id(string $label = null)
|
||||
* @method Show\Field|Collection dimensions(string $label = null)
|
||||
* @method Show\Field|Collection is_show(string $label = null)
|
||||
* @method Show\Field|Collection key(string $label = null)
|
||||
* @method Show\Field|Collection name(string $label = null)
|
||||
* @method Show\Field|Collection updated_at(string $label = null)
|
||||
* @method Show\Field|Collection detail(string $label = null)
|
||||
* @method Show\Field|Collection type(string $label = null)
|
||||
* @method Show\Field|Collection version(string $label = null)
|
||||
|
|
@ -974,8 +1001,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection article_id(string $label = null)
|
||||
* @method Show\Field|Collection author_name(string $label = null)
|
||||
* @method Show\Field|Collection category_id(string $label = null)
|
||||
* @method Show\Field|Collection content(string $label = null)
|
||||
* @method Show\Field|Collection cover(string $label = null)
|
||||
* @method Show\Field|Collection likes(string $label = null)
|
||||
* @method Show\Field|Collection media_content(string $label = null)
|
||||
* @method Show\Field|Collection media_type(string $label = null)
|
||||
|
|
@ -993,7 +1018,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection transferable(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)
|
||||
* @method Show\Field|Collection is_enable(string $label = null)
|
||||
* @method Show\Field|Collection ranges(string $label = null)
|
||||
* @method Show\Field|Collection administrator_id(string $label = null)
|
||||
|
|
@ -1030,7 +1054,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection last_consignor_id(string $label = null)
|
||||
* @method Show\Field|Collection new_consignor_id(string $label = null)
|
||||
* @method Show\Field|Collection price(string $label = null)
|
||||
* @method Show\Field|Collection qty(string $label = null)
|
||||
* @method Show\Field|Collection sale_price(string $label = null)
|
||||
* @method Show\Field|Collection reason(string $label = null)
|
||||
* @method Show\Field|Collection allocated_at(string $label = null)
|
||||
|
|
@ -1114,7 +1137,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection gift_for_sku_id(string $label = null)
|
||||
* @method Show\Field|Collection reduced_amount(string $label = null)
|
||||
* @method Show\Field|Collection remain_quantity(string $label = null)
|
||||
* @method Show\Field|Collection sku_id(string $label = null)
|
||||
* @method Show\Field|Collection specs(string $label = null)
|
||||
* @method Show\Field|Collection spu_id(string $label = null)
|
||||
* @method Show\Field|Collection vip_discount_amount(string $label = null)
|
||||
|
|
@ -1140,7 +1162,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection gift_sku_id(string $label = null)
|
||||
* @method Show\Field|Collection remaining(string $label = null)
|
||||
* @method Show\Field|Collection attrs(string $label = null)
|
||||
* @method Show\Field|Collection part_id(string $label = null)
|
||||
* @method Show\Field|Collection applicant_id(string $label = null)
|
||||
* @method Show\Field|Collection reviewer_id(string $label = null)
|
||||
* @method Show\Field|Collection buynote_id(string $label = null)
|
||||
|
|
@ -1158,7 +1179,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection message_type(string $label = null)
|
||||
* @method Show\Field|Collection change_quota(string $label = null)
|
||||
* @method Show\Field|Collection order_user_id(string $label = null)
|
||||
* @method Show\Field|Collection is_use(string $label = null)
|
||||
* @method Show\Field|Collection size(string $label = null)
|
||||
* @method Show\Field|Collection x(string $label = null)
|
||||
* @method Show\Field|Collection y(string $label = null)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'labels' => [
|
||||
'QuotaV1Log' => '老配额变动日志',
|
||||
'quota-v1-send-jobs' => '老配额分红',
|
||||
'logs-index'=>'变动日志',
|
||||
],
|
||||
'fields' => [
|
||||
'user_id' => '用户',
|
||||
'loggable_type' => '类型',
|
||||
'loggable_id' => '关联ID',
|
||||
'action' => '操作类型',
|
||||
'before_balance' => '变更前的余额',
|
||||
'change_balance' => '变动余额',
|
||||
'remarks' => '备注',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<style>
|
||||
.info-box {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.info-box .info-box-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
line-height: 2;
|
||||
padding: 0 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.info-box .info-box-number {
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div {!! $attributes !!}>
|
||||
@if($icon)
|
||||
<span class="info-box-icon bg-{{ $style }}">
|
||||
<i class="{{ $icon }}"></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ $title }}</span>
|
||||
<span class="info-box-number">{!! $content !!}</span>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue