<?php
namespace App\Services\Admin\YeWu;
use Illuminate\Support\Facades\DB;
class HealthOrganizationService
{
    //'type'=>'enable','group'=>$group,'userid'=>$userid
    //获取体检机构列表
    //如果需要获取可用的列表 需要传参[‘type’=>'enable']
    //获取全部 [‘type’=>'all']
    //如果gropid==7 则查询单条
    //userid 确认身份
    public function GetList($arr){
        $result=array();
        if($arr['type']=='enable' ){
            $s=[1];
        }
        if($arr['type']=='all'){
            $s=[0,1];
        }
        if($arr['group']==7){

            $query=DB::table('medical_institution')->where(['status'=>1,'link_user_id'=>$arr['userid']])->get();
        }else{
            $query=DB::table('medical_institution')->whereIn('status',$s)->get();
        }

        return \Yz::Return(true,'ok',$query);

    }
}
