我尝试添加JOIN子查询:
$this->db->join('stocks AS stn', 'stn.stocksIdMF =
(SELECT medicalfacilities.MedicalFacilitiesIdUser
FROM medicalfacilities
WHERE medicalfacilities.MedicalFacilitiesIdUser = stn.stocksIdMF AND stn.stocksEndDate >= UNIX_TIMESTAMP()
ORDER BY stn.stocksId DESC LIMIT 1)',
'LEFT', false);'
但Codeigniter破坏了这个查询。查询有什么问题? 可能以某种方式替换此查询?