25 lines
544 B
PHP
25 lines
544 B
PHP
<?php
|
|
|
|
namespace Modules\Mall\Http\Controllers\Admin\Action\Goods;
|
|
|
|
use Encore\Admin\Actions\RowAction;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Up extends RowAction
|
|
{
|
|
public $name = '上架';
|
|
|
|
public function handle(Model $model)
|
|
{
|
|
if ($model->up()) {
|
|
return $this->response()->success('上架成功')->refresh();
|
|
} else {
|
|
return $this->response()->error('上架失败')->refresh();
|
|
}
|
|
}
|
|
|
|
public function dialog()
|
|
{
|
|
$this->confirm('确定上架吗');
|
|
}
|
|
} |