<?php

namespace App\Admin\Actions\Community\Docter;

use App\Models\CdmsUsers;
use Encore\Admin\Actions\Action;
use Encore\Admin\Actions\RowAction;
use Illuminate\Http\Request;

class EditAccount extends RowAction
{
    public $name = '编辑账号';

    public function href()
    {
        $docter_id = $this->row->docter_id;
        $org_id = $this->row->organization_id;
        $account = CdmsUsers::where(['org_id'=>$org_id,'docter_id'=>$docter_id])->first();
        if($account){
            return  '/cdms/docter_account/'.$account->id.'/edit';
        }
        return '';
    }
}
