This commit is contained in:
2024-07-23 12:20:39 +08:00
parent 0b24297e6e
commit 484285c491

View File

@@ -53,14 +53,15 @@ class TyuserLogic extends BaseLogic
/**
* desc听译-绑定医患关系,医患客户端初始化后绑定关系
* 请求类型wss
*请求参数:
* json消息格式[
'action'=>'Tyuser/bindRelation',
'items'=>[
'username'=>'13333322323',
'type'=>'doc',//用户类型:user=用户,doc=医生
]
]
* authorwh
@@ -76,15 +77,20 @@ class TyuserLogic extends BaseLogic
$json = Tools::wss_json($action,'username参数错误');
return Gateway::sendToClient($clientid, $json);
}
Db::table('fa_ty_users')
->data([
'clientid'=>$clientid,
])
->where('username',$items['username'])
->update();
//$json = Tools::wss_json('ok','username参数错误');
//return Gateway::sendToClient($clientid, $json);
if(empty($items['type'])){
$json = Tools::wss_json($action,'type参数错误');
return Gateway::sendToClient($clientid, $json);
}
//绑定设备
$devidata = [
'username'=>$items['username'],
'clientid'=>$clientid,
'type'=>$items['type'],
];
Mmodel::existsUpdateInsert('fa_device',[
'username'=>$items['username'],
'clientid'=>$clientid,
],$devidata);
return null;
}
}