阶段更新

This commit is contained in:
2023-01-12 14:47:38 +08:00
parent 088dd64b2f
commit 5b8901281c
626 changed files with 39326 additions and 12 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Modules\Mall\Http\Controllers\Admin\Action\Shop;
use Encore\Admin\Actions\Response;
use Encore\Admin\Actions\RowAction;
use Modules\Mall\Models\Shop;
class Close extends RowAction
{
public $name = '关闭店铺';
public function handle(Shop $shop): Response
{
try {
if ($shop->close()) {
return $this->response()->success('店铺关闭成功')->refresh();
} else {
return $this->response()->error('店铺关闭失败')->refresh();
}
} catch (\Exception $exception) {
return $this->response()->error($exception->getMessage())->refresh();
}
}
public function dialog()
{
$this->confirm('确定关闭店铺吗?');
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace Modules\Mall\Http\Controllers\Admin\Action\Shop;
use Encore\Admin\Actions\Response;
use Encore\Admin\Actions\RowAction;
use Modules\Mall\Models\Shop;
class Open extends RowAction
{
public $name = '开启店铺';
public function handle(Shop $shop): Response
{
try {
if ($shop->open()) {
return $this->response()->success('店铺开启成功')->refresh();
} else {
return $this->response()->error('店铺开启失败')->refresh();
}
} catch (\Exception $exception) {
return $this->response()->error($exception->getMessage())->refresh();
}
}
public function dialog()
{
$this->confirm('确定开启店铺吗?');
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace Modules\Mall\Http\Controllers\Admin\Action\Shop;
use Encore\Admin\Actions\Response;
use Encore\Admin\Actions\RowAction;
use Modules\Mall\Models\Shop;
class Pass extends RowAction
{
public $name = '审核通过';
public function handle(Shop $shop): Response
{
try {
if ($shop->pass()) {
return $this->response()->success('审核通过成功')->refresh();
} else {
return $this->response()->error('审核通过失败')->refresh();
}
} catch (\Exception $exception) {
return $this->response()->error($exception->getMessage())->refresh();
}
}
public function dialog()
{
$this->confirm('确定审核通过?');
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Modules\Mall\Http\Controllers\Admin\Action\Shop;
use Encore\Admin\Actions\Response;
use Encore\Admin\Actions\RowAction;
use Illuminate\Http\Request;
use Modules\Mall\Models\Shop;
class Reject extends RowAction
{
public $name = '驳回申请';
public function handle(Shop $shop, Request $request): Response
{
try {
if ($shop->reject($request->reject_reason)) {
return $this->response()->success('驳回申请成功')->refresh();
} else {
return $this->response()->error('驳回申请失败')->refresh();
}
} catch (\Exception $exception) {
return $this->response()->error($exception->getMessage())->refresh();
}
}
public function form()
{
$this->textarea('reject_reason', '驳回原因')->rules('required');
}
}