我正在尝试自定义选择使用此代码
$result = $qb->select('partial user.{id,name}')
->from('User', 'user')
->leftJoin('user.group', 'group')
->getQuery()
->getResult();
Run Code Online (Sandbox Code Playgroud)
下面这段代码的结果
{
"id": 10,
"name": "admin",
"description": null,
"create_date": null,
"modified_date": null,
}
Run Code Online (Sandbox Code Playgroud)
为什么返回的字段没有选择空值?!
我正在尝试执行此操作,但它不起作用,这是我的错误:
必须使用'。'或'-> '调用'((test *)this)-> test :: mapping.std :: map <_Key,_Tp,_Compare,_Alloc> :: operator []中的指针成员函数(test :: *)(int),std :: less>,std :: allocator,void(test :: *)(int)>>>((((const key_type)(&str))))(... )”,例如“(...-> *((test *)this)-> test :: mapping.std :: map <_Key,_Tp,_Compare,_Alloc> :: operator [],void(test :: *)(int),std :: less>,std :: allocator,void(test :: *)(int)>>>((((const key_type)(&str))))(...)'
test.h:
#include....
using namespace std;
class test
{
public:
std::map<std::string, void(test::*)(int)> mapping;
void Add(int);
};
test.cpp:
test::test()
{
mapping["Add"]=&test::Add;
string str = "Add";
this.*mapping[str](3);// dosnt work!!!!
}
void …
Run Code Online (Sandbox Code Playgroud)