123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Admin\Actions;
- use App\Models\FourActivity;
- use Encore\Admin\Actions\RowAction;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Http\Request;
- class ReportAudit extends RowAction
- {
- public $name = '审核';
- public function form ()
- {
- $this->radio('audit_status', '审核')
- ->options([FourActivity::AUDIT_STATUS_PASS=>'通过', FourActivity::AUDIT_STATUS_REJECT=>'驳回'])
- ->default(FourActivity::AUDIT_STATUS_PASS)
- ->rules('required');
- $this->textarea('audit_not_reason', '驳回原因');
- }
- public function handle(Model $model, Request $request)
- {
- // var_dump($model);exit;
- // $model ...
- $model->audit_status = $request->input('audit_status');
- $model->audit_not_reason = $request->input('audit_not_reason');
- $model->save();
- return $this->response()->success('审核成功')->refresh();
- }
- public function html()
- {
- return "<a class='report-posts btn btn-sm btn-danger'><i class='fa fa-info-circle'></i>举报</a>";
- }
- }
|