小编Gre*_*ene的帖子

如何实现异步队列在Symfony 3中运行Method

首先,关于我的项目的一些基本信息:我有一个使用Symfony 3构建的网站.对于某些任务,我正在考虑实现运行异步PHP方法.有些事件需要花费很多时间,但结果不一定非常明显.

例如:在方法中newOrder我有函数addUserLTV谁做了几步.客户不必等待所有步骤完成,只需在基本操作后立即获得确认 - "newOrder"将添加addUserLTV到队列并立即显示确认(已完成运行).当服务器有时间执行时,将运行队列任务.

public function addUserLTV( $userID, $addLTV )
{ //same code
}
Run Code Online (Sandbox Code Playgroud)

怎么做?在交响曲3中有可能吗?

php asynchronous symfony

4
推荐指数
1
解决办法
4353
查看次数

如何分组更多和哪​​些,或者在Doctrine中

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)

我不确定如何正确分组更多andWhereorWhere.我找到了一个更多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)

php sql symfony doctrine-orm

3
推荐指数
1
解决办法
2422
查看次数

标签 统计

php ×2

symfony ×2

asynchronous ×1

doctrine-orm ×1

sql ×1