0
我嘗試了不同的可能性,但沒有任何工作,在教程中我找不到示例。語法用於選擇我的模型中的最後一個記錄集
我在modelclass的方法:
public function getlastImport($filename)
{
//$id = (int) $id;
$rowset = $this->tableGateway->select(['Path' => $filename]);
$row = $rowset->current();
if (! $row) {
throw new RuntimeException(sprintf(
'Could not find row with identifier %d',
$id
));
}
return $row;
}
我想要檢索一個給定的文件名的最後一個進口,所以IST必須像在SQL:
select max(ID) from table where filename = $filename;
但如何將在這種情況下正確的語法?
問題是,如何在我的模型中編寫它。 –
只需編輯代碼!讓我們知道它是否適合你! – unclexo
它的工作,謝謝fpr的語法,我正在尋找執行rowfunction max,這是很容易的 –