0
我的工作在現有project.Getting記錄是這樣的:如何在symfony中使用教義對記錄進行排序?
$this->courses = Doctrine_Core::getTable('Course')->findByUserId($this->userId);
現在我想上面的排序按用戶ID記錄,但我不知道怎麼樣?
這段代碼是否有解決方案?
感謝
我的工作在現有project.Getting記錄是這樣的:如何在symfony中使用教義對記錄進行排序?
$this->courses = Doctrine_Core::getTable('Course')->findByUserId($this->userId);
現在我想上面的排序按用戶ID記錄,但我不知道怎麼樣?
這段代碼是否有解決方案?
感謝
您可以:
$this->courses = Doctrine_Query::create()->from('Course c')->where('c.user_id = ?', $this->userId)->orderBy('c.user_id DESC')->execute();
完美。謝謝。 – Awan