Commit 903c10c8 authored by chenchuanwen's avatar chenchuanwen

bridgeedit

parent 96ccd2c6
...@@ -20,37 +20,33 @@ ...@@ -20,37 +20,33 @@
// echo ' ... After Swoole Shutdown ! ... ' . PHP_EOL . PHP_EOL; // echo ' ... After Swoole Shutdown ! ... ' . PHP_EOL . PHP_EOL;
// } // }
//} //}
if(!empty($request->post)){ try{
try{ $respData=$request->post;
$respData=$request->post; // echo json_encode($respData);
// echo json_encode($respData); if(isset($respData['type'])&&$respData['type']==1){
if(isset($respData['type'])&&$respData['type']==1){ $info=$respData['content'];
$info=$respData['content']; $memberDao=$info['className']::getInstance(\Our\DbNameConst::masterDBConnectName);
$memberDao=$info['className']::getInstance(\Our\DbNameConst::masterDBConnectName); echo json_encode($info);
echo json_encode($info); if(empty($info['params'])){
if(empty($info['params'])){ $res=call_user_func_array(array($memberDao,$info['method']),array());
$res=call_user_func_array(array($memberDao,$info['method']),array());
}else{
$res=call_user_func_array(array($memberDao,$info['method']),$info['params']);
}
$res=(isset($res)&&!empty($res))?$res:false;
unset($memberDao);
\Mysql\LinkMySQLModel::unsetDbConecet();
if($res!==false){
echo 'success';
$response->end(json_encode(array('status'=>1,'message'=>'执行成功','data'=>$res)));
}else{
echo 'fail1';
$response->end(json_encode(array('status'=>0,'message'=>'执行失败')));
}
}else{ }else{
echo 'fail2'; $res=call_user_func_array(array($memberDao,$info['method']),$info['params']);
}
$res=(isset($res)&&!empty($res))?$res:false;
unset($memberDao);
\Mysql\LinkMySQLModel::unsetDbConecet();
if($res!==false){
echo 'success';
$response->end(json_encode(array('status'=>1,'message'=>'执行成功','data'=>$res)));
}else{
echo 'fail1';
$response->end(json_encode(array('status'=>0,'message'=>'执行失败'))); $response->end(json_encode(array('status'=>0,'message'=>'执行失败')));
} }
}catch(Exception $ex){ }else{
throw new Exception($ex->getMessage(),$ex->getCode()); echo 'fail2';
$response->end(json_encode(array('status'=>0,'message'=>'执行失败'))); $response->end(json_encode(array('status'=>0,'message'=>'执行失败')));
} }
}else{ }catch(Exception $ex){
throw new Exception($ex->getMessage(),$ex->getCode());
$response->end(json_encode(array('status'=>0,'message'=>'执行失败'))); $response->end(json_encode(array('status'=>0,'message'=>'执行失败')));
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment