diff --git a/app/Admin/Actions/Grid/DealerManageSubsidyBatchPay.php b/app/Admin/Actions/Grid/DealerManageSubsidyBatchPay.php new file mode 100644 index 00000000..caa4546d --- /dev/null +++ b/app/Admin/Actions/Grid/DealerManageSubsidyBatchPay.php @@ -0,0 +1,51 @@ + 付款'; + + /** + * @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(); + } +} diff --git a/app/Admin/Actions/Grid/DealerManageSubsidyPay.php b/app/Admin/Actions/Grid/DealerManageSubsidyPay.php new file mode 100644 index 00000000..6f21ea8d --- /dev/null +++ b/app/Admin/Actions/Grid/DealerManageSubsidyPay.php @@ -0,0 +1,44 @@ + 付款'; + + /** + * @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(); + } +} diff --git a/app/Admin/Actions/Grid/DealerManagerSubsidyBatchPay.php b/app/Admin/Actions/Grid/DealerManagerSubsidyBatchPay.php new file mode 100644 index 00000000..39365184 --- /dev/null +++ b/app/Admin/Actions/Grid/DealerManagerSubsidyBatchPay.php @@ -0,0 +1,51 @@ + 付款'; + + /** + * @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(); + } +} diff --git a/app/Admin/Actions/Grid/DealerManagerSubsidyPay.php b/app/Admin/Actions/Grid/DealerManagerSubsidyPay.php new file mode 100644 index 00000000..0c706e8c --- /dev/null +++ b/app/Admin/Actions/Grid/DealerManagerSubsidyPay.php @@ -0,0 +1,44 @@ + 付款'; + + /** + * @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(); + } +} diff --git a/app/Admin/Controllers/DealerManageSubsidyController.php b/app/Admin/Controllers/DealerManageSubsidyController.php new file mode 100644 index 00000000..e643f44e --- /dev/null +++ b/app/Admin/Controllers/DealerManageSubsidyController.php @@ -0,0 +1,167 @@ +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 "
".nl2br($this->remark).'
'; + }); + $grid->column('status', '状态')->display(function ($v) { + return '  '.$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 "
金额:".$totalAmount.' 元
'; + }); + $grid->filter(function (Grid\Filter $filter) { + $filter->panel(false); + $filter->equal('user.phone', '手机号')->width(3); + $filter->between('order_completed_at', '结算时间')->dateTime()->width(7); + }); + }); + } +} diff --git a/app/Admin/Controllers/DealerManageSubsidyLogController.php b/app/Admin/Controllers/DealerManageSubsidyLogController.php index c08155fc..6057badc 100644 --- a/app/Admin/Controllers/DealerManageSubsidyLogController.php +++ b/app/Admin/Controllers/DealerManageSubsidyLogController.php @@ -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( + <<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 条件数组进行遍历 diff --git a/app/Admin/Controllers/DealerManagerSubsidyController.php b/app/Admin/Controllers/DealerManagerSubsidyController.php new file mode 100644 index 00000000..ffa4f236 --- /dev/null +++ b/app/Admin/Controllers/DealerManagerSubsidyController.php @@ -0,0 +1,128 @@ +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 "
".nl2br($this->remark).'
'; + }); + $grid->column('status', '状态')->display(function ($v) { + return '  '.$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')); + }); + }); + }); + } +} diff --git a/app/Admin/Controllers/DealerPurchaseLogController.php b/app/Admin/Controllers/DealerPurchaseLogController.php index 8a3349ec..6a4e68ae 100644 --- a/app/Admin/Controllers/DealerPurchaseLogController.php +++ b/app/Admin/Controllers/DealerPurchaseLogController.php @@ -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( + <<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 "
金额:".$totalAmount.' 元
'; }); $grid->filter(function (Grid\Filter $filter) { diff --git a/app/Admin/Controllers/QuotaV1LogController.php b/app/Admin/Controllers/QuotaV1LogController.php new file mode 100644 index 00000000..12847eb3 --- /dev/null +++ b/app/Admin/Controllers/QuotaV1LogController.php @@ -0,0 +1,87 @@ +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'); + }); + } +} diff --git a/app/Admin/Controllers/QuotaV1SendJobController.php b/app/Admin/Controllers/QuotaV1SendJobController.php index 1f10a622..3a036a6d 100644 --- a/app/Admin/Controllers/QuotaV1SendJobController.php +++ b/app/Admin/Controllers/QuotaV1SendJobController.php @@ -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(' 变动记录'); + } }); $grid->column('amount')->display(function ($value) { return bcdiv($value, 100, 2); diff --git a/app/Admin/Forms/QuotaV1Deduction.php b/app/Admin/Forms/QuotaV1Deduction.php index d3cf0096..acfd94ff 100644 --- a/app/Admin/Forms/QuotaV1Deduction.php +++ b/app/Admin/Forms/QuotaV1Deduction.php @@ -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('是否确认扣减?', '提交后该动作无法逆转'); } } diff --git a/app/Admin/Forms/QuotaV1Recharge.php b/app/Admin/Forms/QuotaV1Recharge.php index ecd0f1c8..9e84af27 100644 --- a/app/Admin/Forms/QuotaV1Recharge.php +++ b/app/Admin/Forms/QuotaV1Recharge.php @@ -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('是否确认增加老配额?', '提交后该动作无法逆转'); } } diff --git a/app/Admin/Renderable/UserSalesValueLogSimpleTable.php b/app/Admin/Renderable/UserSalesValueLogSimpleTable.php index 5d44c41e..b4450197 100644 --- a/app/Admin/Renderable/UserSalesValueLogSimpleTable.php +++ b/app/Admin/Renderable/UserSalesValueLogSimpleTable.php @@ -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 "
个人消费值:".$salesValue1.'
团队消费值:'.$salesValue2.'
'; }); $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(); }); }); } diff --git a/app/Admin/Repositories/DealerManageSubsidy.php b/app/Admin/Repositories/DealerManageSubsidy.php new file mode 100644 index 00000000..32f3343a --- /dev/null +++ b/app/Admin/Repositories/DealerManageSubsidy.php @@ -0,0 +1,16 @@ +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(), + ]; + } +} diff --git a/app/Admin/routes.php b/app/Admin/routes.php index 5c550946..ae1aa6fa 100644 --- a/app/Admin/routes.php +++ b/app/Admin/routes.php @@ -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'); //批零余额提现 diff --git a/app/Enums/DealerManageSubsidyStatus.php b/app/Enums/DealerManageSubsidyStatus.php index 2a6ed321..3dac0ed1 100644 --- a/app/Enums/DealerManageSubsidyStatus.php +++ b/app/Enums/DealerManageSubsidyStatus.php @@ -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 => '已付款', + ]; + } } diff --git a/app/Enums/DealerManagerSubsidyStatus.php b/app/Enums/DealerManagerSubsidyStatus.php index 8400c0a1..e18c013c 100644 --- a/app/Enums/DealerManagerSubsidyStatus.php +++ b/app/Enums/DealerManagerSubsidyStatus.php @@ -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 => '已付款', + ]; + } } diff --git a/app/Models/DealerManageSubsidy.php b/app/Models/DealerManageSubsidy.php index 3c4f3a5c..fd7b74f0 100644 --- a/app/Models/DealerManageSubsidy.php +++ b/app/Models/DealerManageSubsidy.php @@ -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; diff --git a/app/Models/DealerManagerSubsidy.php b/app/Models/DealerManagerSubsidy.php index caea0024..42d1e89e 100644 --- a/app/Models/DealerManagerSubsidy.php +++ b/app/Models/DealerManagerSubsidy.php @@ -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; diff --git a/app/Models/QuotaV1Log.php b/app/Models/QuotaV1Log.php index 6271df3d..603887be 100644 --- a/app/Models/QuotaV1Log.php +++ b/app/Models/QuotaV1Log.php @@ -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); + } } diff --git a/app/Models/User.php b/app/Models/User.php index fe8e0d74..f793e61f 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -368,6 +368,14 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac return $this->hasMany(QuotaLog::class); } + /** + * 用户的配额日志 + */ + public function quotaV1Logs() + { + return $this->hasMany(QuotaV1Log::class); + } + /** * 属于此用户的团队销售值(含自己的销售值) */ diff --git a/app/Services/AfterSaleService.php b/app/Services/AfterSaleService.php index f3eca310..ca6319e9 100644 --- a/app/Services/AfterSaleService.php +++ b/app/Services/AfterSaleService.php @@ -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; diff --git a/app/Services/Dealer/ManageSubsidyService.php b/app/Services/Dealer/ManageSubsidyService.php new file mode 100644 index 00000000..24a50bdd --- /dev/null +++ b/app/Services/Dealer/ManageSubsidyService.php @@ -0,0 +1,43 @@ +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 + ); + } +} diff --git a/app/Services/Dealer/ManagerSubsidyService.php b/app/Services/Dealer/ManagerSubsidyService.php new file mode 100644 index 00000000..ab766710 --- /dev/null +++ b/app/Services/Dealer/ManagerSubsidyService.php @@ -0,0 +1,43 @@ +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 + ); + } +} diff --git a/app/Services/QuotaV1Service.php b/app/Services/QuotaV1Service.php index afab09a4..922ab5a8 100644 --- a/app/Services/QuotaV1Service.php +++ b/app/Services/QuotaV1Service.php @@ -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, diff --git a/database/migrations/2022_03_04_180530_change_before_balance_to_quota_v1_logs_table.php b/database/migrations/2022_03_04_180530_change_before_balance_to_quota_v1_logs_table.php new file mode 100644 index 00000000..09b42f6b --- /dev/null +++ b/database/migrations/2022_03_04_180530_change_before_balance_to_quota_v1_logs_table.php @@ -0,0 +1,33 @@ +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) { + // + }); + } +} diff --git a/database/seeders/AdminMenuSeeder.php b/database/seeders/AdminMenuSeeder.php index 6f0a37bd..3b2a3654 100644 --- a/database/seeders/AdminMenuSeeder.php +++ b/database/seeders/AdminMenuSeeder.php @@ -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'=>'管理者津贴明细', diff --git a/database/seeders/AdminPermissionSeeder.php b/database/seeders/AdminPermissionSeeder.php index 8e6103e6..6589ac4c 100644 --- a/database/seeders/AdminPermissionSeeder.php +++ b/database/seeders/AdminPermissionSeeder.php @@ -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'], diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php index a2d41b6c..d1d1dab1 100644 --- a/dcat_admin_ide_helper.php +++ b/dcat_admin_ide_helper.php @@ -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) diff --git a/resources/lang/zh_CN/quota-v1-log.php b/resources/lang/zh_CN/quota-v1-log.php new file mode 100644 index 00000000..db69b27f --- /dev/null +++ b/resources/lang/zh_CN/quota-v1-log.php @@ -0,0 +1,20 @@ + [ + 'QuotaV1Log' => '老配额变动日志', + 'quota-v1-send-jobs' => '老配额分红', + 'logs-index'=>'变动日志', + ], + 'fields' => [ + 'user_id' => '用户', + 'loggable_type' => '类型', + 'loggable_id' => '关联ID', + 'action' => '操作类型', + 'before_balance' => '变更前的余额', + 'change_balance' => '变动余额', + 'remarks' => '备注', + ], + 'options' => [ + ], +]; diff --git a/resources/views/vendor/admin/widgets/info-box.blade.php b/resources/views/vendor/admin/widgets/info-box.blade.php new file mode 100644 index 00000000..639dbe5b --- /dev/null +++ b/resources/views/vendor/admin/widgets/info-box.blade.php @@ -0,0 +1,31 @@ + + +
+ @if($icon) + + + + @endif + +
+ {{ $title }} + {!! $content !!} +
+