/** * 実行 */ protected function perform() { // 案件ID $ankenId = $this->_request['aid']; // モデル $m =& $this->_model; // キャンペーンコード $d =& $m->Anken_TeikeiIndex_getAnkenData($ankenId); $code = $d['campaign_code']; $ankenName = $d['anken_name']; $this->_dataFrom['anken_name'] = $ankenName; $this->_dataFrom['media_special_memo'] = $d['media_special_memo']; $this->_dataFrom['media_special_memo_updated'] = $this->_request['media_special_memo_updated']; $this->_dataFrom['campaign_from'] = $d['campaign_from']; $this->_dataFrom['campaign_to'] = $d['campaign_to']; if (isset($this->_request['search']) == true) { // 提携メディアを表示 $data =& $m->Anken_TeikeiIndex_getAnkenTeikeiList($code, $this->_like); //////////////////////////////// // 拡張仕様 // ASPID //////////////////////////////// $man = new ApsIdManager_52(); foreach ($data as $k => $v) { $mediaId = intval($v['media_id']); $aspId = $man->getAspId($mediaId); $data[$k]['asp_id'] = $aspId; } // テンプレート変数追加 $this->_dataFrom['show'] = true; $this->_dataFrom['list'] =& $data; $this->_dataFrom['query_string'] = $_SERVER['QUERY_STRING']; } else { if (isset($this->_request['delete']) == true) { $mediaId = $this->_request['mid']; $teikeiMediaId = $this->_request['tmid']; // 削除実行 $m->deleteTeikeiMedia($code, $mediaId, $teikeiMediaId); // メール送信 NotifyManager::deleteTeikeiMedia($this->_core, $ankenId, $mediaId); // 再度表示URL $queryString = $this->_request['query_string']; $url = "teikei_index.php?{$queryString}"; $this->_core->movePage($url); } else { if (isset($this->_request['update_media_special_memo']) == true) { $memo = trim($this->_request['media_special_memo']); $m->updateMediaSpecialMemo($ankenId, $memo); $queryString = $this->_request['query_string']; $url = "teikei_index.php?{$queryString}&media_special_memo_updated=true&aid={$ankenId}"; $this->_core->movePage($url); } } } }
/** * 実行 */ protected function perform() { // 案件ID $ankenId = $this->_request['aid']; // モデル $m =& $this->_model; // フォーム初期化 $m->Result_ClientReportMedia_initFormData(); // 基本情報 $anken =& $m->getAnkenData($ankenId); $this->appendDataFrom($anken); if (isset($this->_request['search']) == true || $this->_isDownload == true) { // キャンペーンコード $code = $anken['campaign_code']; // メディア提携 $mediaList =& $m->Result_ClientReportMedia_getMediaTeikeiList($code); // メディアごとPV集計 $dataPv =& $m->Result_ClientReportMedia_getMediaPvCount($code, $this->_like); // メディアごと成果集計 $dataSeika =& $m->Result_ClientReportMedia_getMediaActionAcceptCount($code, $this->_like); // マージ $data =& $m->Result_ClientReportMedia_merge($mediaList, $dataPv, $dataSeika); //////////////////////////////// // 拡張仕様 // ASPID //////////////////////////////// $man = new ApsIdManager_52(); foreach ($data as $k => $v) { $mediaId = intval($v['media_id']); $aspId = $man->getAspId($mediaId); $data[$k]['asp_id'] = $aspId; } // 計算 $formData =& $m->Result_ClientReportMedia_counting($data); //---------------------------- // 並び替え //---------------------------- $isAsc = true; if ($this->_like['order_type'] == "2") { $isAsc = false; } $as = new ArraySort(); $as->keySort($formData, $this->_like['order_kind'], $isAsc, 'media_id'); // 小計行追加 $formData =& $m->Result_ClientReportMedia_getTotal($formData); // テンプレート変数追加 $this->_dataFrom['show'] = true; $this->_dataFrom['list'] =& $formData; } // モデル内の値をテンプレートに設定 $d =& $m->getFormData(); $this->appendDataFrom($d); }