你好编码员我正在尝试在 CODE IGNITER 模型中编写这个 mysql 脚本但没有得到正确的脚本如何将它编码到活动记录中你能帮我吗
SELECT bus_reg_number
FROM t_bus_detail
WHERE bus_reg_number NOT
IN (
SELECT bus_reg_number
FROM t_bus_alot
)
我的模特
public function get_bus_reg_number()
{
$this->db->select('bus_reg_number')->from('t_bus_detail');
$result=$this->db->where_not_in('bus_reg_number' NOT IN (SELECT 'bus_reg_number' FROM 't_bus_alot')');
$dropdown_bus_number = array();
foreach($result as $r)
{
$dropdown_bus_number[$r['bus_reg_number']] = $r['bus_reg_number'];
}
return $dropdown_bus_number;
}