尝试建立一个雄辩的查询以返回数据库中存在关系的所有结果。
private void showSingleDialog() {
LayoutInflater factory = LayoutInflater.from(this);
final View view = factory.inflate(R.layout.activity_solo, null);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(view);
final String[] sex = {
"male",
"felmale",
"unknow",
"guess"
};
builder.setSingleChoiceItems(sex, 0, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
Toast.makeText(MainActivity.this, "your choice is:" + sex[i], Toast.LENGTH_LONG).show();
dialog.dismiss();
}
});
builder.show();
}
这将返回结果,其中包括多个交付者,而没有任何交付。
交付者模型包括:
$deliveries = Deliverer::has('deliveries')->get()->toArray();
dd($deliverer);
投放模型包括:
public function deliveries() {
return $this->hasMany(Deliveries::class)->latest();
}
请问有人在这里出什么事了吗?