RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-265419

Стас Борзых's questions

Martin Hope
Стас Борзых
Asked: 2020-06-15 12:39:36 +0000 UTC

帮助编写基于 SQL 查询的 DQL 查询

  • 2

如果有 SQL 查询,告诉我如何进行 DQL 查询

SELECT * 
from content_block_content cbc 
LEFT JOIN content_block cb 
       ON cb.id = cbc.block_id 
where cbc.lang = 'en';

像这样试过

$result = $this->createQueryBuilder('cb');
$result->from('App\Entity\ContentBlock', 'cb');
$result->from('App\Entity\ContentBlockContent', 'cbc');
$result->leftJoin('cb.id = cbc.block_id','');

但是,虽然这里有一些结果,告诉我该怎么做?

symfony
  • 1 个回答
  • 10 Views
Martin Hope
Стас Борзых
Asked: 2020-05-22 11:52:08 +0000 UTC

如何使用 createQueryBuilder 在 symfony 4 中进行这样的查询?

  • 0

告诉我如何在 symfony 4 中使用 createQueryBuilder 执行这样的查询?

更新树 SET left_key = left_key + 2, right_key = right_key + 2 WHERE left_key > 4;

symfony
  • 2 个回答
  • 10 Views
Martin Hope
Стас Борзых
Asked: 2020-05-17 14:01:49 +0000 UTC

为什么在 Symfony 4 中使用 Doctrine 时看不到命名空间

  • 1

Symfony 4美好的一天,告诉我为了使用存储库需要修复什么doctrine?现在,当我尝试访问该页面时,出现以下错误:

在链配置的命名空间 App\Entity 中找不到类“App\Repository\PageModulesRepository”

存储库本身:

namespace App\Repository;

use App\Entity\PageModules;
use Doctrine\ORM\EntityRepository;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;

class PageModulesRepository extends EntityRepository
{

    public function __construct()
    {

    }
}

控制器本身

namespace App\Controller;
use App\Repository\PageModulesRepository;
use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
class ApiController extends Controller
{
    /**
     * @Route("/api", name="api")
     */
    public function index()
    {

        $do = $this->getDoctrine();
        $treeR = $do->getRepository(PageModulesRepository::class);

        return $this->json([
            'message' => 'Welcome to your new controller!',
            'path' => 'src/Controller/ApiController.php',
        ]);
    }
}

我怀疑问题可能出在此处:

教义配置:

parameters:
    # Adds a fallback DATABASE_URL if the env var is not set.
    # This allows you to run cache:warmup even if your
    # environment variables are not available yet.
    # You should not need to change this value.
    env(DATABASE_URL): ''

doctrine:
    dbal:
        # configure these for your database server
        driver: 'pdo_mysql'
        server_version: '5.7'
        charset: utf8mb4
        default_table_options:
            charset: utf8mb4
            collate: utf8mb4_unicode_ci

        url: '%env(resolve:DATABASE_URL)%'
    orm:
        auto_generate_proxy_classes: '%kernel.debug%'
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
        mappings:
            App:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'App\Entity'
                alias: App

我试图删除映射部分:在配置中然后它只是说

在链配置的命名空间中找不到类“App\Repository\PageModulesRepository”

告诉我如何解决?

php
  • 1 个回答
  • 10 Views
Martin Hope
Стас Борзых
Asked: 2020-04-20 14:38:23 +0000 UTC

如何在bootsrap 3中居中列

  • 0

大家好,告诉我如何在boostrap 3中将这些块居中?

   <div class="row">
        <div class=" col-xs-2 col-md-3">
            <div class="card mb-4 box-shadow">
                <img src="#" class="img-fluid">
                <div class="card-body">
                    <p class="card-text text-center"><b>text</p>
                </div>
                <div class="text-center">
                <a class="btn btn-lg text-uppercase u-btn-green cs-font-weight-700 cs-font-size-11 cs-color-white cs-color-white--hover cs-bg-primary--hover cs-brd-none rounded-0 cs-px-20 speaker_button_container" href="#" style="margin-bottom: 5px;">подробнее</a>
                </div>
            </div>
        </div>

        <div class=" col-xs-2 col-md-3">
            <div class="card mb-4 box-shadow">
                <img src="#" class="img-fluid">
                <div class="card-body">
                    <p class="card-text text-center"><b>text</p>
                </div>
                <div class="text-center">
                <a class="btn btn-lg text-uppercase u-btn-green cs-font-weight-700 cs-font-size-11 cs-color-white cs-color-white--hover cs-bg-primary--hover cs-brd-none rounded-0 cs-px-20 speaker_button_container" href="#" style="margin-bottom: 5px;">подробнее</a>
                </div>
            </div>
        </div>

        <div class=" col-xs-2 col-md-3">
            <div class="card mb-4 box-shadow">
                <img src="#" class="img-fluid">
                <div class="card-body">
                    <p class="card-text text-center"><b>text</p>
                </div>
                <div class="text-center">
                <a class="btn btn-lg text-uppercase u-btn-green cs-font-weight-700 cs-font-size-11 cs-color-white cs-color-white--hover cs-bg-primary--hover cs-brd-none rounded-0 cs-px-20 speaker_button_container" href="#" style="margin-bottom: 5px;">подробнее</a>
                </div>
            </div>
        </div>

    </div>

如果我有 4 个块,那么它们都在中心很酷地对齐,如果有 3 个块,那么如何使用标准的 boostrap 工具使它们始终在中心对齐?

bootstrap
  • 1 个回答
  • 10 Views
Martin Hope
Стас Борзых
Asked: 2020-04-13 13:36:51 +0000 UTC

如何在 symfony 3.4 中从 config.yml 访问变量

  • 0

大家好,在 symfony 3.4 中,我在 config.yml 中定义了一些任意参数

parameters:
    locale: en

如何从 php 代码访问它们?没办法我可以谷歌。

symfony3
  • 1 个回答
  • 10 Views
Martin Hope
Стас Борзых
Asked: 2020-12-12 13:33:57 +0000 UTC

告诉我为什么 RewriteRule 规则不能正常工作

  • 0

祝大家有美好的一天。任务是在站点上从 /search/all/azazaza 重定向到/search/?query=azazaza 似乎没有什么特别的问题,作为一项规则,我写了这个

RewriteRule ^search/all/* /search/?query=$1 [R=301,L]

我用这个站点来检查规则,这个站点。 当检查站点时,一切都很好,重定向按原样进行......

但是我给服务器写了一条规则,并且重定向传递了但是azazaza参数没有被传输,也就是说,它只是重定向到URL /search/?query= 东西吃掉了azazaza,我不明白是什么,我决定在同一个站点上完全驱动整个 .htaccess 以进行验证(突然间我错过了一些东西......)不,我正在寻找,一切都在站点上正常工作,正确确定重定向并传递参数也正确...但它在服务器上不起作用...告诉我我错过了什么?

完整的.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteRule ^search/all/* /search/?query=$1 [R=301,L]

  RewriteRule ^extlink-(\d+)(.*)$ extlink.php?n=$1&url=$2 [QSA,L]
  RewriteRule ^extlink(/.*)$ extlink.php?url=$1 [QSA,L]
  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
.htaccess
  • 1 个回答
  • 10 Views
Martin Hope
Стас Борзых
Asked: 2020-10-04 16:07:22 +0000 UTC

帮助在 3 个表上编写 FULL JOIN

  • 0

有一个表id内容

id   |content |
-----|--------|
1    |content1|
2    |content2|
3    |content3|
4    |content4|
5    |content5|
6    |content6|
7    |content7|

有一个内容的作者id的比例id的表格

Author_Id |TxtContent_id |
----------|--------------|
100       |1             |
101       |2             |
102       |3             |
103       |4             |
106       |5             |
106       |6             |
106       |7             |

当然,与作者的标志

Id   |Name         
-----|-------------
100  |Автор 1
101  |Автор 2
102  |Автор 3
103  |Автор 4    
104  |Автор 5
105  |Автор 6
106  |Автор 7  

问题的关键是如何将这些表中的数据组合成一个响应?表之间的依赖是肉眼可见的,我想得到类似的东西

id|content|Author_Id|Name

我知道我需要在 MySQL 中选择 FULL JOIN,但我不能为 3 个表编写查询。(我只是在这件事上没有足够的经验)告诉我谁知道如何提出这样的要求?

mysql
  • 2 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5