first commit
This commit is contained in:
36
app/Admin/Extensions/Tools/CommentAudit.php
Normal file
36
app/Admin/Extensions/Tools/CommentAudit.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Extensions\Tools;
|
||||
|
||||
use Encore\Admin\Grid\Tools\BatchAction;
|
||||
|
||||
class CommentAudit extends BatchAction
|
||||
{
|
||||
protected $status;
|
||||
|
||||
public function __construct($status = 1)
|
||||
{
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
public function script()
|
||||
{
|
||||
return <<<EOT
|
||||
$('{$this->getElementClass()}').on('click', function() {
|
||||
$.ajax({
|
||||
method: 'post',
|
||||
url: '{$this->resource}/release',
|
||||
data: {
|
||||
_token:LA.token,
|
||||
ids: selectedRows(),
|
||||
status: {$this->status}
|
||||
},
|
||||
success: function () {
|
||||
$.pjax.reload('#pjax-container');
|
||||
}
|
||||
});
|
||||
});
|
||||
EOT;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user