复杂的Yii SQL语句(Complex Yii SQL statement)
我是Yii的新手,我很难将SQL查询转换为Yii Active Record语言或使用查询构建器。
我有3个表: - 帖子:id,text - 标签:id,name - Post_Tag:id_post,id_tag
我想要做的是能够选择具有用户选择的所有标签的帖子:这是有效的SQL语句,我想翻译成Yii语言:
SELECT * FROM Post p INNER JOIN tags pt ON p.id=pt.post_id WHERE pt.tag_id in(10, 13) group by pt.post_id having count(distinct pt.tag_id) > 1;
有人有事要帮助我吗? 提前致谢 !
I'm new to Yii and I have difficulties to translate an SQL query to Yii Active Record language or with the query builder.
I have 3 tables : - Post : id, text - Tag : id, name - Post_Tag : id_post, id_tag
What i want to do is to be able to select the posts that have all tags selected by the user : Here is the SQL statement that works and that i want to translate to Yii language :
SELECT * FROM Post p INNER JOIN tags pt ON p.id=pt.post_id WHERE pt.tag_id in(10, 13) group by pt.post_id having count(distinct pt.tag_id) > 1;
Is someone got something to help me ? thanks in advance !
原文:https://stackoverflow.com/questions/16921487
最满意答案
考虑到像Amazon.com这样的网站没有使用比Verisign所谓的“Secure Site Pro”更好的东西(亚马逊没有绿色栏 )。 也许如果你的公司规模很小,你就从事电子商务,你需要获得所有额外的可信度 - 然后去寻找更好的东西。 但说实话,我怀疑大多数冲浪者都不太关注绿色酒吧。 如果你没有将它用于电子商务,那么你真的可以选择较低的证书。
Consider that a site like Amazon.com is not using anything better than what Verisign is calling "Secure Site Pro" (Amazon does not have the green bar). Perhaps if your company is quite small, you are engaged in e-commerce, and you need all the extra credibility you can get - then go for something better. But honestly, I suspect most surfers have little regard for the green bar. And if you are not using this for e-commerce, then you really could go with the lesser certs.
相关问答
更多-
这完全是关于信任。 Verisign是一个比GoDaddy更受尊敬的权威,所以他们要求更高的价格。 此外,Verisign验证您的组织的合法性,而GoDaddy只验证您对该域的所有权。 It's all about trust. Verisign is a more highly-regarded authority than GoDaddy, so they command a higher price. Furthermore, Verisign verify the legitimacy of you ...
-
证书的价值主要来自互联网用户在证书颁发者的信任。 为此,Verisign很难击败。 证书向客户说,您是您所说的,发行人已经验证了这一点。 您可以获得免费的SSL证书,例如由StartSSL签名。 这是对自签名证书的改进,因为您的最终用户将停止收到警告弹出窗口,通知他们您的可疑证书。 但是,通过https与您的站点通信时,浏览器栏不会变绿,因此此解决方案不理想。 最便宜的SSL证书,将绿色条款花费您几百美元,您需要通过提交相关文件,通过向公司的身份证明您的公司身份的过程。 The value of the c ...
-
混合SSL证书(Mix SSL certificates)[2022-08-22]
是的,它会工作并在浏览器中显示没有错误。 例如,如果您使用其SSL证书包含Google字体(通过例如https://fonts.googleapis.com )或Bing地图,则也是如此。 应该没有问题。 Yes, it will work and show no error in the browser. It's the same if you for example include Google Fonts (via e.g. https://fonts.googleapis.com) or Bing ... -
考虑到像Amazon.com这样的网站没有使用比Verisign所谓的“Secure Site Pro”更好的东西(亚马逊没有绿色栏 )。 也许如果你的公司规模很小,你就从事电子商务,你需要获得所有额外的可信度 - 然后去寻找更好的东西。 但说实话,我怀疑大多数冲浪者都不太关注绿色酒吧。 如果你没有将它用于电子商务,那么你真的可以选择较低的证书。 Consider that a site like Amazon.com is not using anything better than what Veris ...
-
SSL证书 - 根证书中私钥的用途是什么?(SSL Certificate - What is the use of the private key in a root certificate?)[2022-11-22]
如果我没有错,最终实体证书的私钥(由Verisign等可信CA颁发的证书)用于解密客户端发送的信息 你错了。 事实并非如此。 对等方自己的私钥用于签署证书,以便客户端可以验证对等方拥有他提供的证书,签名证书的私钥用于,错误,签署证书。 If I am not wrong, the private key of an End Entity certificate (certificate issued by trusted CA like Verisign) is used to decrypt the in ... -
服务器将相同的链证书发送到firefox和s_client: CN = .s3.amazonaws.com SAN = DNS: .s3.amazonaws.com,DNS:s3.amazonaws.com CN = VeriSign Class 3安全服务器CA - G3 CN = VeriSign Class 3公共主要证书颁发机构 - G5 但验证证书的方式因SSL堆栈和客户端的受信任根证书而异。 如果是curl,你会遇到一个旧的OpenSSL验证问题。 细节: Firefox拥有一个受信任的根证书, ...
-
是。 作为文档建议,您需要将其添加到信任库。 Yes. As the documentation advices, you need to add it to the trust store.
-
证书#3不是VeriSign颁发的证书的一部分。 它可以是从节点复制的不完整请求的伪证书(在证书MMC中)。 如果是#2和#3证书的情况(比较公钥或Subject Key Identifier扩展值)。 如果匹配,请将证书#3移至“ Certificate Enrollment Requests节点。 您的客户需要做的是转到生成原始请求的计算机(我怀疑在IIS服务器上)并尝试通过运行以下命令正确安装已颁发的证书: certreq -accept path\certNo2.cer 如果命令成功,证书将自动安 ...
-
对于任何有类似问题的人来说,问题不在于使用哪种SSL证书,而是要确保使用正确的协议。 顺便说一下,我最初使用cURL提供的curl-ca-bundle.crt。 此证书与对EppLib.net项目的目标.net框架的更改相结合解决了我的问题。 在从Github克隆时,目标是.net 4.0,Nominet至少需要TLS1.1,这在v4中是不可用的。 因此,我还将EppLib.net项目的目标更新为4.5.1并更改了SslProtocol SslProtocol.Tls to SslProtocol.Tls1 ...
-
没有进一步的代码,我无法分辨,但是,我可以看到你加载受信任的证书,但你在哪里加载你自己的密钥库? 如果是在其他代码中,我无法分辨。 当您尝试使用外部Truststore时会发生什么,例如$ JAVA_HOME / jre / lib / security / cacerts 假设您确实想要使用动态信任存储(通常它们非常静态),请查看 http://jcalcote.wordpress.com/2010/06/22/managing-a-dynamic-java-trust-store/ Without fu ...