public function getNoTakeHistory() { $uid = $this->input->post('uid'); $date = $this->input->post('date'); parent::checkDatetime($date, 'Y-m-d'); $arr = $this->no_take_history_model->get_by_uid_month($uid, $date); $noTakeArrayGroupByDate = array(); foreach ($arr as &$oriNoTake) { $date = date('Y-m-d', strtotime($oriNoTake['no_take_date'])); unset($oriNoTake['uid']); $noTakeArrayGroupByDate[$date][] = $oriNoTake; } $resultArray = array(); foreach ($noTakeArrayGroupByDate as $key => $data) { $resultArray[] = array('date' => $key, 'no_take_list' => $data); } if (count($resultArray) == 0) { $resultArray[] = array('date' => $date, 'no_take_list' => array()); } parent::ajaxReturn('no_take_history_list', $resultArray); }
public function getCompanyList() { $result = $this->company_model->get_all_company(); parent::ajaxReturn('company_list', $result); }