首先,关于我的项目的一些基本信息:我有一个使用Symfony 3构建的网站.对于某些任务,我正在考虑实现运行异步PHP方法.有些事件需要花费很多时间,但结果不一定非常明显.
例如:在方法中newOrder
我有函数addUserLTV谁做了几步.客户不必等待所有步骤完成,只需在基本操作后立即获得确认 - "newOrder"将添加addUserLTV
到队列并立即显示确认(已完成运行).当服务器有时间执行时,将运行队列任务.
public function addUserLTV( $userID, $addLTV )
{ //same code
}
Run Code Online (Sandbox Code Playgroud)
怎么做?在交响曲3中有可能吗?
SELECT * FROM dg
WHERE
( a < 1 AND b > 1)
OR ( a > 1 AND (
(c = 3 AND B < 2)
or (c = 4 AND B < 5 ))
)
Run Code Online (Sandbox Code Playgroud)
我不确定如何正确分组更多andWhere
和orWhere
.我找到了一个更多AND组的例子,但没有OR的例子.
对于exp.WHERE a=1 AND (a>1 Or b=2) AND (a>1 OR c=2)
工作查询是:
public function myQuery()
{
return $this->createQueryBuilder( 'dg' )
->where("a = 1")
->andWhere("a > 1 OR b = 2")
->andWhere("a > 1 OR c = 3")
->getQuery() …
Run Code Online (Sandbox Code Playgroud)