<?php

namespace App\Community\Actions\Vaccine;

use App\Models\Order;
use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;

class Reserved extends RowAction
{
    public $name = '立即接单';


    public function handle(Model $model)
    {
        $id = $this->row->id;

        $res = Order::where('id',$id)->update(['order_status'=>Order::ISING]);


        if($res){
            return $this->response()->success('操作成功!')->refresh();
        }

        return $this->response()->error('操作失败!');
    }

}
