我在我的Web应用程序上使用Bllim/Datatables包作为数据表; 但我无法检索所有相关的行.
我使用下面的代码:
$books= $client->books()->where('books.type', 0);
Run Code Online (Sandbox Code Playgroud)
我将它发送到Datatables :: of method如下:
return Datatables::of($books)
->edit_column('type', '{{$type}}')
->edit_column('created_at', function($obj) {
return $obj->created_at->format('d/m/Y (h:i)');
})
->set_index_column('id')
->make();
Run Code Online (Sandbox Code Playgroud)
但所有这些都返回内部服务器错误(500),并带有以下消息:
{"error":
{
"type":"ErrorException",
"message":"Undefined property: Illuminate\\Database\\Eloquent\\Builder::$columns",
"file":"\/var\/www\/clients\/myapp\/vendor\/bllim\/datatables\/src\/Bllim\/Datatables\/Datatables.php",
"line":256
}
}
Run Code Online (Sandbox Code Playgroud)
我的数据库结构:
create table clients(
id int not null auto_increment,
name varchar(10) not null,
password varchar(60) not null,
unique(name),
primary key(id),
created_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
updated_at timestamp NOT NULL DEFAULT now() ON UPDATE now()
)CHARSET utf8 COLLATE utf8_spanish_ci;
/* PIVOT TABLE */
create table …Run Code Online (Sandbox Code Playgroud) 我想在C#项目中包含所有需要的dll,所以你不需要将它们复制到system32并注册它们.
我尝试过costura.fody和其他方式,但我不能让它工作......
我在项目中创建了一个"libs"文件夹,然后我复制了所有的dll.然后我添加一个这个DLL(另一个是依赖,我知道)作为参考.
但我得到这个错误:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in myapp.exe
Additional information: Could not retrieve COM class generator for component {00853A19-BD51-419B-9269-2DABE57EB61F} Due to the following error: 80040154 Unregistered class (Exception of HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Run Code Online (Sandbox Code Playgroud)
当我将所有dll复制到我的system32文件夹并注册其中一个时:
regsvr32 %windir%\system32\zkemkeeper.dll
Run Code Online (Sandbox Code Playgroud)
一切顺利......
编辑:
正如我所说,zkteco(生物识别扫描仪)的sdk有多个dll.但我只能添加一个作为参考.其他人抛出我的下一个错误:
A reference to XXX.dll could not be added. Please make sure that the file is accesible, and that it is a valid assembly or COM component.
所以我不知道这里有什么问题......
dll的:
我的参考:
每个libs的属性:
我的文件夹包含所有dll:
每个libs的属性:
我试图从库中选择一个图像并将位图设置为我的imageview,但我有一个问题:在我的设备中,运行良好,但它在其他方面不起作用.
我在片段中启动图像选择器如下:
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, SELECT_PHOTO);
这是我的onActivityResult:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
Log.d("ResultCode",resultCode+"");
switch (requestCode) {
case SELECT_PHOTO:
if (resultCode == Activity.RESULT_OK) {
Uri selectedImage = imageReturnedIntent.getData();
try {
Bitmap imagen = decodeUri(selectedImage);
// Works on my device (because resultCode = RESULT_OK) but doesn't work in others (because resultCode = 0)
((ImageView) findViewById(R.id.myimage)).setImageBitmap(imagen);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我很感激任何帮助,我有点绝望.X_X
android android-intent android-gallery android-fragments onactivityresult