有人可以帮我翻译成codeigniter db query
SELECT COUNT(SALES_NO),shop_fc_no
FROM (
SELECT MIN(SALES_NO) AS SALES_NO,MIN(SEQ) AS SEQ,shop_fc_no
FROM TBL_FOOD_ORDER
WHERE shop_fc_no = '99997' AND
check_flg =0
GROUP BY SALES_NO,SEQ) AS a
到目前为止,我已经提出了
$this->db->select('SHOP_FC_NO, count(SALES_NO) AS ORDER_COUNT');
$this->db->from('TBL_FOOD_ORDER');
$this->db->where('SHOP_FC_NO',$shop_fc_no);
$this->db->where('CHECK_FLG = 0');
$query = $this->db->get();
return $query->result_array();