26 lines
473 B
PHP
26 lines
473 B
PHP
<?php
|
|
|
|
namespace Peidikeji\Goods\Action;
|
|
|
|
use Dcat\Admin\Grid\BatchAction;
|
|
use Peidikeji\Goods\Models\Goods;
|
|
|
|
class BatchGoodsDown extends BatchAction
|
|
{
|
|
protected $title = '下架';
|
|
|
|
public function handle()
|
|
{
|
|
$ids = $this->getKey();
|
|
Goods::whereIn('id', $ids)->update(['on_sale' => 0]);
|
|
|
|
return $this->response()->success('操作成功')->refresh();
|
|
}
|
|
|
|
public function confirm()
|
|
{
|
|
return ['是否确定?'];
|
|
}
|
|
}
|
|
|