目前我有一个如下所示的标准,它在与table1和table2连接时查找我的基表中column1的平均值.
$criteria= new CDbCriteria;
$criteria->select = 'AVG(t.column1) as cc';
$criteria->group = 'table1.id';
$criteria->with = array('table1', 'table2');
Run Code Online (Sandbox Code Playgroud)
如何按上述标准按tabel1.id和table2.id进行分组?
我在前端使用 React-native,在服务器上使用 PHP 后端。我需要能够向我想要从中下载文件的服务器发送密码。我正在连接到一个 PHP 脚本,该脚本使用 X-SendFile 库在密码正确的情况下将文件发回。
目前我正在使用 RNFS.downloadFile() 下载和保存文件,但这似乎只适用于 GET 而不适用于 POST。我希望能够将文件保存到 DocumentDirectoryPath。
我当前的代码如下所示:
await RNFS.downloadFile({
fromUrl: 'http://example.com/myfile.zip',
toFile: RNFS.DocumentDirectoryPath + "/userdata/myfile.zip",
}).promise
Run Code Online (Sandbox Code Playgroud)
我希望能够做这样的事情:
await RNFS.downloadFile({
method: post,
body: {passcode: "abc123", filename: "myfile.zip"},
fromUrl: 'http://example.com/getfile.php',
toFile: RNFS.DocumentDirectoryPath + "/userdata/myfile.zip",
}).promise
Run Code Online (Sandbox Code Playgroud)
如何更改我的代码,以便将密码作为 POST 参数传递?