<?php

namespace App\Admin\Actions;

use App\Models\Organization;
use Encore\Admin\Actions\RowAction;

class UpdateCdms extends RowAction
{
   public $name = '修改账号';

    public function href()
    {
        $id = $this->row->id;
        $cmds_id = Organization::where(['id'=>$id])->value('cdms_id');
        if(empty($cmds_id)){
            return '/admin/organizations';
        }
        return "/admin/cdms_user/".$cmds_id."/edit";
    }

    public function form()
    {
        $this->display('')->image();
    }
}
