phalcon不支持 union 查询的 解决方法 phql

                $sql = "select order_id from orderlamps   a where a.ifdelete = 0 ' 
union  select order_id from orderlampszm  b where b.ifdelete = 0 ";
                $dbs = \Phalcon\DI::getDefault()->get('db');
                $stmt = $dbs->prepare($sql);
                $stmt->execute([]);
                $oneResult = $stmt->fetchAll(\PDO::FETCH_ASSOC);
            $dbs = \Phalcon\DI::getDefault()->get('db');   //前面定义的数据库di
            
            $di->set('db', function () use ($config) {});

猜你喜欢

转载自blog.csdn.net/qq_25261441/article/details/109648085