function perform() { //パラメータ取得 $company_id = $this->af->get('company_id'); $warehouse_id = $this->af->get('warehouse_id'); $date_from = $this->af->get('date_from'); $date_to = $this->af->get('date_to'); $dao = DaoFactory::StockCheckMD(); try { $params = array('company_id' => $company_id, 'warehouse_id' => $warehouse_id, 'date_from' => $date_from, 'date_to' => $date_to); $output = $dao->getAllWithZaikoDiff($params); } catch (Exception $e) { // 致命的なエラーが発生 $this->logger->log(LOG_DEBUG, $e->getTraceAsString()); return array('500', $e->getMessage()); } return array('json', $output); }
/** * 棚卸調整一覧のデータをJSON形式で返す * @access public * @return array 期間単価マスタ * @see Admin_ActionClass::perform() */ public function perform() { // 初期化 $product_id = $this->af->get('product_id'); $product_name = $this->af->get('product_name'); $warehouse_id = $this->af->get('warehouse_id'); $start_date = $this->af->get('start_date'); $end_date = $this->af->get('end_date'); $limit = $this->af->get('limit'); // default 50 $page = $this->af->get('page'); // default 1 $order = $this->af->get('order'); // default asc $column = $this->af->get('column'); // default shop_cd $keyword = $this->af->get('keyword'); $company_id = $this->session->get('company_id'); // setting pager $start_page = ($page - 1) * $limit + 1; $end_page = ($page - 1) * $limit + $limit; try { // DAO 取得 $stockCheckDao = DaoFactory::StockCheckMD(); $params = array('product_id' => $product_id, 'product_name' => $product_name, 'warehouse_id' => $warehouse_id, 'start_date' => $start_date, 'end_date' => $end_date, 'start_page' => $start_page, 'end_page' => $end_page, 'order' => $order, 'column' => $column, 'keyword' => $keyword, 'company_id' => $company_id); // 一覧を取得 $list = $stockCheckDao->getAdjustmentList($params)->fetchAll(PDO::FETCH_ASSOC); // ページ情報を設定 $pager = array('result_page' => $page, 'result_start_num' => $start_page, 'result_end_num' => $end_page, 'result_all_count' => count($list) ? $list[0]['FOUND_ROWS'] : 0, 'result_get_count' => count($list), 'result_limit' => $limit); // output にセット $output['totalData'] = array(); $output['listData'] = $list; $output['pagerData'] = $pager; } catch (Exception $e) { // 致命的なエラーが発生 return array('500', $e->getMessage()); } return array('json', $output); }