Commit 95470d6b authored by 潘梓豪's avatar 潘梓豪

更新

parent 4560a163
......@@ -14,6 +14,7 @@
use Drupal\zeus_hub\Util\ConfigSetting;
use OSS\OssClient;
use OSS\Core\OssException;
use function Sodium\add;
class ApiController extends ControllerBase{
......@@ -94,20 +95,31 @@ public function getProductionList(){
$post = json_decode(file_get_contents ( 'php://input' ),TRUE);
$database = \Drupal::database();
$tj="AND (node_field_data.title LIKE CONCAT('%','".$post['title_name']."','%') or node_field_data.title is null )".
"AND (node__field_scene_name.field_scene_name_value LIKE CONCAT('%','".$post['scene_name']."','%') or node__field_scene_name.field_scene_name_value is null )".
"AND (node__field_app_name.field_app_name_value LIKE CONCAT('%','".$post['app_name']."','%') or node__field_app_name.field_app_name_value is null )";
$arg= [
':userid'=>$uid,
':code'=>$post['computer_code']
];
$get_user=User::load($uid);
$is_enterprise=$get_user->hasRole("enterprise");
$tj="AND (node_field_data.title LIKE CONCAT('%',:title_name,'%') or node_field_data.title is null ) ".
"AND (node__field_scene_name.field_scene_name_value LIKE CONCAT('%',:scene_name,'%') or node__field_scene_name.field_scene_name_value is null ) ".
"AND (node__field_app_name.field_app_name_value LIKE CONCAT('%',:app_name,'%') or node__field_app_name.field_app_name_value is null )";
if (!$is_enterprise && $post['computer_code']!=null && $post['computer_code']!=""){
$tj="AND node__field_belong_computer.computer_code= :code";
}
$arg[':title_name']=$post['title_name'];
$arg[':scene_name']=$post['scene_name'];
$arg[':app_name']=$post['app_name'];
if ($post['kind']!=null && $post['kind']!=""){
$tj=$tj." AND node__field_kind.field_kind_target_id=".$post['kind'];
}
$get_user=User::load($uid);
$is_enterprise=$get_user->hasRole("enterprise");
if (!$is_enterprise && $post['computer_code']!=null && $post['computer_code']!=""){
$tj="AND node__field_belong_computer.computer_code= :code";
$arg[':code']=$post['computer_code'];
}
if ($post['kind']!=null && $post['kind']!=""){
$tj=$tj." AND node__field_kind.field_kind_target_id= :kind";
$arg[':kind']=$post['kind'];
}
//查找订单内容
$rs=$database->query("select node.nid as nid,node__field_production.field_production_target_id as production_id,node__field_production_name.field_production_name_value as production_name, ".
......@@ -115,16 +127,15 @@ public function getProductionList(){
"node__field_download_url.field_download_url_value as production_download_url, ".
"node__field_app_name.field_app_name_value as app_name,node__field_belong_computer.computer_code, ".
"node__field_logo.field_logo_value as logo, ".
"node__field_app_id.field_app_id_value as app_id, ".
"node__field_kind.field_kind_target_id ".
"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_app_id} as node__field_app_id on node__field_app_id.entity_id=node__field_production.field_production_target_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 ".
"left join {node_field_data} as node_field_data on node_field_data.nid=node__field_production.field_production_target_id ".
"left join {node__field_kind} as node__field_kind ON node__field_production.field_production_target_id=node__field_kind.entity_id ".
"left join {node__field_logo} as node__field_logo on node__field_logo.entity_id=node__field_production.field_production_target_id ".
"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 ".
......@@ -138,9 +149,9 @@ public function getProductionList(){
':code'=>$post['computer_code']
])->fetchAll();
$rs_count=$database->query("select count(*) as total ".
"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_app_id} as node__field_app_id on node__field_app_id.entity_id=node__field_production.field_production_target_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 ".
......@@ -581,6 +592,9 @@ public function saveOrder(){
/*
* 保存订单
* */
$save_order = \Drupal::entityTypeManager()
->getStorage('node')
->create([
......@@ -828,9 +842,7 @@ public function getProductionView(){
"node__field_download_url.field_download_url_value as production_download_url, ".
"node__field_app_name.field_app_name_value as app_name, ".
"node__field_logo.field_logo_value as logo, ".
"node__field_app_id.field_app_id_value as app_id ".
"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_app_id} as node__field_app_id on node__field_app_id.entity_id=node.nid ".
"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 ".
......@@ -847,7 +859,6 @@ public function getProductionView(){
$rs_count=$database->query("select count(*) as total ".
"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_app_id} as node__field_app_id on node__field_app_id.entity_id=node.nid ".
"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 ".
......
administer robotcode:
title: '获取机器码'
zeus_hub orderSetting:
title: '订单相关设置'
zeus_hub saveComputerCode:
title: '保存计算机码'
zeus_hub saveRobotCode:
title: '保存注册码'
......@@ -14,7 +14,7 @@ zeus_hub.getRobotCode:
_controller: 'Drupal\zeus_hub\Controller\ApiController::getRobotCode'
_title: 'getRobotCode'
requirements:
_access: 'TRUE'
_access: 'TRUE'
#获取用户产品
zeus_hub.getProductionList:
......@@ -23,7 +23,7 @@ zeus_hub.getProductionList:
_controller: 'Drupal\zeus_hub\Controller\ApiController::getProductionList'
_title: 'getProductionList'
requirements:
_access: 'TRUE'
_access: 'TRUE'
#获取产品
zeus_hub.getAllProductionList:
......@@ -41,7 +41,7 @@ zeus_hub.saveRobotCode:
_controller: 'Drupal\zeus_hub\Controller\ApiController::saveRobotCode'
_title: 'saveRobotCode'
requirements:
_access: 'TRUE'
_permission: 'zeus_hub saveRobotCode'
#添加计算机码
zeus_hub.saveComputerCode:
......@@ -50,7 +50,7 @@ zeus_hub.saveComputerCode:
_controller: 'Drupal\zeus_hub\Controller\ApiController::saveComputerCode'
_title: 'saveComputerCode'
requirements:
_access: 'TRUE'
_permission: 'zeus_hub saveComputerCode'
#获取计算机码
zeus_hub.getComputerCode:
......@@ -89,7 +89,7 @@ zeus_hub.getBelongOrder:
_access: 'TRUE'
#保存更新配置
#保存更新配置
zeus_hub.saveSetting:
path: 'zeus/zeushub/saveSetting'
defaults:
......@@ -98,7 +98,7 @@ zeus_hub.saveSetting:
requirements:
_access: 'TRUE'
#获取配置
#获取配置
zeus_hub.getSetting:
path: 'zeus/zeushub/getSetting'
defaults:
......@@ -180,13 +180,12 @@ zeus_hub.getOrderDetail:
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'
......@@ -199,15 +198,6 @@ zeus_hub.admin_page:
requirements:
_permission: 'access content'
#文件上传托管
zeus_hub.form:
path: 'zeus/zeus_hub/zeus_hub-form'
defaults:
_title: 'zeushub form'
_form: '\Drupal\zeus_hub\Util\YunkeForm'
requirements:
_permission: 'access content'
#添加点赞量
zeus_hub.addLike:
path: 'zeus/zeushub/addLike'
......@@ -226,4 +216,20 @@ zeus_hub.addRead:
requirements:
_access: 'TRUE'
#通过机器码获取用户及产品情况
zeus_hub.getProductionListByCode:
path: 'zeus/zeushub/getProductionListByCode'
defaults:
_controller: 'Drupal\zeus_hub\Controller\ApiController::getProductionListByCode'
_title: 'getProductionListByCode'
requirements:
_access: 'TRUE'
#添加计算机码
zeus_hub.BindComputerCodeByUser:
path: 'zeus/zeushub/bindComputerCode'
defaults:
_controller: 'Drupal\zeus_hub\Controller\ApiController::bindComputerCode'
_title: 'saveComputerCode'
requirements:
_access: 'TRUE'
This source diff could not be displayed because it is too large. You can view the blob instead.
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews
# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php7.c>
php_flag engine off
</IfModule>
\ No newline at end of file
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* core/themes/bartik/templates/status-messages.html.twig */
class __TwigTemplate_801a9c3fc6df49a20e96e4caa44ce939a3f22b47db4f944697992cbab59dab97 extends \Twig\Template
{
public function __construct(Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = [
'messages' => [$this, 'block_messages'],
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$tags = ["block" => 23, "if" => 24, "for" => 27, "set" => 29];
$filters = ["escape" => 25, "without" => 34, "length" => 41, "first" => 48];
$functions = ["attach_library" => 25];
try {
$this->sandbox->checkSecurity(
['block', 'if', 'for', 'set'],
['escape', 'without', 'length', 'first'],
['attach_library']
);
} catch (SecurityError $e) {
$e->setSourceContext($this->getSourceContext());
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
protected function doDisplay(array $context, array $blocks = [])
{
// line 22
echo "<div data-drupal-messages>
";
// line 23
$this->displayBlock('messages', $context, $blocks);
// line 60
echo "</div>
";
}
// line 23
public function block_messages($context, array $blocks = [])
{
// line 24
echo " ";
if ( !twig_test_empty(($context["message_list"] ?? null))) {
// line 25
echo " ";
echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->attachLibrary("bartik/messages"), "html", null, true);
echo "
<div class=\"messages__wrapper layout-container\">
";
// line 27
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(($context["message_list"] ?? null));
foreach ($context['_seq'] as $context["type"] => $context["messages"]) {
// line 28
echo " ";
// line 29
$context["classes"] = [0 => "messages", 1 => ("messages--" . $this->sandbox->ensureToStringAllowed( // line 31
$context["type"]))];
// line 34
echo " <div role=\"contentinfo\" aria-label=\"";
echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array")), "html", null, true);
echo "\"";
echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->env->getExtension('Drupal\Core\Template\TwigExtension')->withoutFilter($this->sandbox->ensureToStringAllowed($this->getAttribute(($context["attributes"] ?? null), "addClass", [0 => ($context["classes"] ?? null)], "method")), "role", "aria-label"), "html", null, true);
echo ">
";
// line 35
if (($context["type"] == "error")) {
// line 36
echo " <div role=\"alert\">
";
}
// line 38
echo " ";
if ($this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array")) {
// line 39
echo " <h2 class=\"visually-hidden\">";
echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($this->getAttribute(($context["status_headings"] ?? null), $context["type"], [], "array")), "html", null, true);
echo "</h2>
";
}
// line 41
echo " ";
if ((twig_length_filter($this->env, $context["messages"]) > 1)) {
// line 42
echo " <ul class=\"messages__list\">
";
// line 43
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($context["messages"]);
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 44
echo " <li class=\"messages__item\">";
echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed($context["message"]), "html", null, true);
echo "</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 46
echo " </ul>
";
} else {
// line 48
echo " ";
echo $this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, twig_first($this->env, $this->sandbox->ensureToStringAllowed($context["messages"])), "html", null, true);
echo "
";
}
// line 50
echo " ";
if (($context["type"] == "error")) {
// line 51
echo " </div>
";
}
// line 53
echo " </div>
";
// line 55
echo " ";
$context["attributes"] = $this->getAttribute(($context["attributes"] ?? null), "removeClass", [0 => ($context["classes"] ?? null)], "method");
// line 56
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['type'], $context['messages'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 57
echo " </div>
";
}
// line 59
echo " ";
}
public function getTemplateName()
{
return "core/themes/bartik/templates/status-messages.html.twig";
}
public function getDebugInfo()
{
return array ( 161 => 59, 157 => 57, 151 => 56, 148 => 55, 145 => 53, 141 => 51, 138 => 50, 132 => 48, 128 => 46, 119 => 44, 115 => 43, 112 => 42, 109 => 41, 103 => 39, 100 => 38, 96 => 36, 94 => 35, 87 => 34, 85 => 31, 84 => 29, 82 => 28, 78 => 27, 72 => 25, 69 => 24, 66 => 23, 61 => 60, 59 => 23, 56 => 22,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Source("", "core/themes/bartik/templates/status-messages.html.twig", "D:\\xampp\\htdocs\\zeushub\\core\\themes\\bartik\\templates\\status-messages.html.twig");
}
}
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