/* $rs=$database->query("select node__field_robot_code.field_robot_code_value as robot_code, node__field_production_name.field_production_name_value as production_name, ".
"node__field_scene_name.field_scene_name_value as scene_name, node__field_production.field_production_target_id as production_id, node__field_app_path.field_app_path_value ".
"from {node__field_robot_code} as node__field_robot_code left join {node__field_production} as node__field_production on ".
"node__field_robot_code.entity_id=node__field_production.entity_id left join {node__field_production_name} as node__field_production_name on ".
"node__field_production_name.entity_id=node__field_production.field_production_target_id left join {node__field_scene_name} as node__field_scene_name on ".
"node__field_scene_name.entity_id=node__field_production.field_production_target_id 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_app_path} as node__field_app_path on node__field_app_path.entity_id=node__field_production.entity_id ".
// $us=$database->query("select user__field_parent_user.field_parent_user_target_id as parent_user_id".
// " from user__field_parent_user where user__field_parent_user.entity_id= :userid",
// [
// ':userid'=>$uid,
// ])->fetchAll();
//
// if (count($us)>0){
// $uid=$us[0]->parent_user_id;
// }
//先查找订单内容
$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_app_path.field_app_path_value as production_app_path , 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 ".
"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_belong_computer.bundle='register_robot_code' and node__field_computer_code.field_computer_code_value= :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 ,'%') ",
"node__field_scene_name.field_scene_name_value as scene_name, node__field_production.field_production_target_id as production_id, node__field_download_url.field_download_url_value as production_download_url, ".
"node__field_app_name.field_app_name_value as app_name ".
"from {node} as node left join {node__field_production} as node__field_production on node.nid=node__field_production.entity_id ".
"left join {node__field_production_name} as node__field_production_name on node__field_production_name.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_scene_name} as node__field_scene_name on node__field_scene_name.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_download_url} as node__field_download_url on node__field_download_url.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_app_name} as node__field_app_name on node__field_app_name.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_user} as node__field_user on node__field_user.entity_id=node.nid ".
"where node.type='production_order' and node__field_user.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();
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 ".
// "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();
}
returnnewJsonResponse(['result'=>$rs]);
}
...
...
@@ -174,7 +172,7 @@ public function saveRobotCode(){
@@ -216,6 +215,44 @@ public function saveComputerCode(){
'type'=>'compute_bind'
]);
$robotcode->save();
$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__field_production.field_production_target_id as production_id, node__field_download_url.field_download_url_value as production_download_url, ".
"node__field_app_name.field_app_name_value as app_name ".
"from {node} as node left join {node__field_production} as node__field_production on node.nid=node__field_production.entity_id ".
"left join {node__field_production_name} as node__field_production_name on node__field_production_name.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_scene_name} as node__field_scene_name on node__field_scene_name.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_download_url} as node__field_download_url on node__field_download_url.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_app_name} as node__field_app_name on node__field_app_name.entity_id=node__field_production.field_production_target_id ".
"left join {node__field_user} as node__field_user on node__field_user.entity_id=node.nid ".
"where node.type='production_order' and node__field_user.field_user_target_id= :userid ",