ReportAudit.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Admin\Actions;
  3. use App\Models\FourActivity;
  4. use Encore\Admin\Actions\RowAction;
  5. use Illuminate\Database\Eloquent\Model;
  6. use Illuminate\Http\Request;
  7. class ReportAudit extends RowAction
  8. {
  9. public $name = '审核';
  10. public function form ()
  11. {
  12. $this->radio('audit_status', '审核')
  13. ->options([FourActivity::AUDIT_STATUS_PASS=>'通过', FourActivity::AUDIT_STATUS_REJECT=>'驳回'])
  14. ->default(FourActivity::AUDIT_STATUS_PASS)
  15. ->rules('required');
  16. $this->textarea('audit_not_reason', '驳回原因');
  17. }
  18. public function handle(Model $model, Request $request)
  19. {
  20. // var_dump($model);exit;
  21. // $model ...
  22. $model->audit_status = $request->input('audit_status');
  23. $model->audit_not_reason = $request->input('audit_not_reason');
  24. $model->save();
  25. return $this->response()->success('审核成功')->refresh();
  26. }
  27. public function html()
  28. {
  29. return "<a class='report-posts btn btn-sm btn-danger'><i class='fa fa-info-circle'></i>举报</a>";
  30. }
  31. }