Commit 228dd133 authored by 潘梓豪's avatar 潘梓豪

更新路由 api接口

parent afe50bf4
查找绑定的本机产品
/*if (count($rs)<=0){
$rs=$database->query("select node__field_production_name.field_production_name_value as production_name, ".
"node__field_scene_name.field_scene_name_value as scene_name, node.nid as production_id, node__field_download_url.field_download_url_value as production_download_url, ".
"node__field_belong_computer.computer_code as production_robot_code,node__field_app_name.field_app_name_value as app_name ".
"from {node} as node left join {node__field_production_name} as node__field_production_name on node__field_production_name.entity_id=node.nid ".
"left join {node__field_scene_name} as node__field_scene_name on node__field_scene_name.entity_id=node.nid ".
"left join {node__field_download_url} as node__field_download_url on node__field_download_url.entity_id=node.nid ".
"left join {node__field_app_name} as node__field_app_name on node__field_app_name.entity_id=node.nid ".
// "left join (select node__field_app_path.entity_id,node__field_app_path.field_app_path_value,node__field_production.field_production_target_id ".
// "from {node__field_app_path} as node__field_app_path left join {node__field_user} as node__field_user on node__field_app_path.entity_id=node__field_user.entity_id ".
// "left join {node__field_production} as node__field_production on node__field_app_path.entity_id=node__field_production.entity_id ".
// "where node__field_user.field_user_target_id= :userid and node__field_app_path.bundle='setting_msg') as node__field_app_path on node__field_app_path.field_production_target_id=node.nid ".
"left join ( select node__field_computer_code.field_computer_code_value as computer_code,node__field_user.field_user_target_id,node__field_production.field_production_target_id from {node__field_belong_computer} as node__field_belong_computer ".
"left join {node__field_computer_code} as node__field_computer_code on node__field_belong_computer.field_belong_computer_target_id=node__field_computer_code.entity_id ".
"left join {node__field_user} as node__field_user on node__field_computer_code.entity_id =node__field_user.entity_id ".
"left join {node__field_production} as node__field_production on node__field_production.entity_id=node__field_belong_computer.entity_id ".
"where (node__field_user.field_user_target_id= :userid and node__field_computer_code.field_computer_code_value= :code ) and node__field_belong_computer.bundle='register_robot_code' ) as node__field_belong_computer on node__field_belong_computer.field_production_target_id=node.nid ".
/* "left join (select node__field_robot_code.field_robot_code_value,node__field_production.field_production_target_id,node__field_user.field_user_target_id from {node__field_robot_code} as node__field_robot_code left join {node__field_user} as node__field_user on node__field_robot_code.entity_id=node__field_user.entity_id ".
"left join {node__field_production} as node__field_production on node__field_robot_code.entity_id=node__field_production.entity_id where node__field_user.field_user_target_id= :userid and node__field_robot_code.bundle='register_robot_code' ) as node__field_robot_code on node__field_robot_code.field_production_target_id=node.nid ".
"where node.type='unity_production' and (node__field_belong_computer.field_user_target_id= :userid )and node__field_production_name.field_production_name_value like concat('%', :name ,'%') ",
[
':userid'=>$uid,
':name'=>$_GET['search_txt'],
':code'=>$_GET['code']
])->fetchAll();
}*/
......@@ -7,7 +7,7 @@
class ValCode{
//返回电脑绑定
public static function getComputerCode($uid,$code){
//查询用户跟电脑是否绑定
//查询用户跟电脑是否绑定
$computer_code=\Drupal::entityTypeManager()
->getStorage('node')
->loadByProperties([
......@@ -17,4 +17,17 @@ public static function getComputerCode($uid,$code){
]);
return $computer_code;
}
//返回产品注册码
public static function getRobotCode($uid,$productionid){
//查询软件已经绑定电脑的注册码数量
$robot_code=\Drupal::entityTypeManager()
->getStorage('node')
->loadByProperties([
'field_user'=>$uid,
'field_production'=>$productionid,
'type'=>'register_robot_code'
]);
return $robot_code;
}
}
......@@ -25,6 +25,15 @@ zeus_hub.getProductionList:
requirements:
_access: 'TRUE'
#获取订单相关绑定电脑信息
zeus_hub.getComputerCodeListByOrder:
path: 'zeus/zeushub/getComputerCodeListByOrder'
defaults:
_controller: 'Drupal\zeus_hub\Controller\ApiController::getComputerCodeListByOrder'
_title: 'getComputerCodeListByOrder'
requirements:
_access: 'TRUE'
#获取产品
zeus_hub.getAllProductionList:
path: 'zeus/zeushub/getAllProductionList'
......@@ -79,15 +88,32 @@ zeus_hub.getSetting:
requirements:
_access: 'TRUE'
# 获取企业订单
zeus_hub.getOrderListByUser:
path: 'zeus/zeushub/getOrderListByUser'
defaults:
_controller: 'Drupal\zeus_hub\Controller\ApiController::getOrderListByUser'
_title: 'getOrderListByUser'
requirements:
_access: 'TRUE'
#更新密码
zeus_hub.upUsers:
path: 'zeus/zeushub/upUsers'
defaults:
_controller: 'Drupal\zeus_hub\Controller\ApiController::upUsers'
_title: 'getSetting'
_title: 'upUsers'
requirements:
_access: 'TRUE'
#管理后台页面
zeus_hub.admin_page:
path: '/hub/admin'
defaults:
_controller: 'Drupal\zeus_hub\Controller\PageController::hub_view'
_title: '管理后台'
requirements:
_permission: 'access content'
......
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