<?php


namespace App\Admin\Actions\Community\Nurse;


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

class Reserved extends RowAction
{
    public $name = '已预约';

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

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


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

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