Exemple #1
0
 public function view_serviceExport()
 {
     $start = isset($_GET['start']) ? post_check($_GET['start']) : '';
     $end = isset($_GET['end']) ? post_check($_GET['end']) : '';
     $account = isset($_GET['account']) ? post_check($_GET['account']) : '';
     $start = strtotime($start);
     $end = strtotime($end);
     //$start	= 1356972800;
     //$end	= 1399972800;
     $where = " where is_delete = 0";
     if ($start != '') {
         $where .= " and feedbacktime >= '{$start}' ";
     }
     if ($end != '') {
         $where .= " and feedbacktime <= '{$end}' ";
     }
     if ($account != '') {
         $where .= " and account = '{$account}'";
     }
     $where .= " and (CommentType='Negative' or CommentType='Neutral' or status='21' or status='23' or status='31' or status='32')";
     $FBAct = new EbayFeedbackAct();
     $reasonList = $FBAct->act_getEbayReasonCategoryInfo('*', '');
     $reasonArr = array();
     foreach ($reasonList as $v) {
         $reasonArr[$v['id']] = $v['content'];
     }
     $where .= " order by account,id ";
     $field = " account,CommentingUser,sku,CommentType,feedbacktime,reasonId,`status`,orderPayTime ";
     $fbkList = $FBAct->act_getOrderList($field, $where);
     $exporter = new ExportDataExcel("browser", "service_" . date('Y-m-d') . ".xls");
     $exporter->initialize();
     $exporter->addRow(array('帐号', 'Buyer ID', 'SKU', '评价类型', '评价原因', '评价日期', '付款日期'));
     foreach ($fbkList as $k => $v) {
         $account = $v['account'];
         $CommentingUser = $v['CommentingUser'];
         $sku = $v['sku'];
         $comment_type = $v['CommentType'];
         $resonId = trim($v['reasonId']);
         $feedback_note = $reasonArr[$resonId];
         $time = date('Y-m-d', $v['feedbacktime']);
         $orderPayTime = trim($v['orderPayTime']);
         if (!empty($orderPayTime)) {
             $orderPayTime = date('Y-m-d', $orderPayTime);
         } else {
             $orderPayTime = "";
         }
         if ($comment_type == "Neutral") {
             $type = "中评";
         } else {
             $type = "差评";
         }
         if ($status == '21' || $status == '23') {
             $type = "中评";
         } else {
             if ($status == '31' || $status == '32') {
                 $type = "差评";
             }
         }
         if ($comment_type == 'Positive') {
             $type = '好评';
         }
         $data = array($account, $CommentingUser, $sku, $type, $feedback_note, $time, $orderPayTime);
         $exporter->addRow($data);
     }
     $exporter->finalize();
     exit;
 }
 public function view_ebayFeedbackManage()
 {
     $userId = isset($_GET['userId']) ? post_check($_GET['userId']) : '';
     $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : '';
     $latest_type = isset($_GET['latest_type']) ? post_check($_GET['latest_type']) : '';
     $original_type = isset($_GET['original_type']) ? post_check($_GET['original_type']) : '';
     $account = isset($_GET['account']) ? post_check($_GET['account']) : '';
     $sort_type = isset($_GET['sort_type']) ? post_check($_GET['sort_type']) : '1';
     $start_time = isset($_GET['start_time']) ? post_check($_GET['start_time']) : '';
     $end_time = isset($_GET['end_time']) ? post_check($_GET['end_time']) : '';
     $feedbackReasonId = isset($_GET['feedbackReasonId']) ? post_check($_GET['feedbackReasonId']) : '';
     $this->smarty->assign('userId', $userId);
     $this->smarty->assign('sku', $sku);
     $this->smarty->assign('latest_type', $latest_type);
     $this->smarty->assign('original_type', $original_type);
     $this->smarty->assign('account', $account);
     $this->smarty->assign('sort_type', $sort_type);
     $this->smarty->assign('start_time', $start_time);
     $this->smarty->assign('end_time', $end_time);
     $this->smarty->assign('feedbackReasonId', $feedbackReasonId);
     $where = 'where is_delete = 0';
     if ($start_time != '') {
         $where .= " and feedbacktime >= '" . strtotime($start_time . '00:00:00') . "'";
     }
     if ($end_time != '') {
         $where .= " and feedbacktime <= '" . strtotime($end_time . '23:59:59') . "'";
     }
     if ($account != '') {
         $where .= " and account = '{$account}'";
     }
     if ($sku != '') {
         $where .= " and sku = '{$sku}'";
     }
     if ($userId != '') {
         $where .= " and CommentingUser = '******'";
     }
     if ($feedbackReasonId != '') {
         $where .= " and reasonId = '{$feedbackReasonId}'";
     }
     if ($original_type != '') {
         if ($original_type == "Neutral") {
             if ($latest_type != '') {
                 if ($latest_type == "Positive") {
                     $where .= " and status='21'";
                 } else {
                     if ($latest_type == "Negative") {
                         $where .= " and status='23'";
                     } else {
                         if ($latest_type == "Neutral") {
                             $where .= " and CommentType='Neutral' and status!='32'";
                         }
                     }
                 }
             } else {
                 $where .= " and (CommentType='Neutral' and status !='32' or status='21')";
             }
         } else {
             if ($original_type == "Negative") {
                 if ($latest_type != '') {
                     if ($latest_type == "Positive") {
                         $where .= " and status='31'";
                     } else {
                         if ($latest_type == "Neutral") {
                             $where .= " and status='32'";
                         } else {
                             if ($latest_type == "Negative") {
                                 $where .= " and CommentType='Negative'";
                             }
                         }
                     }
                 } else {
                     $where .= " and (CommentType='Negative' or status='31' or status='32')";
                 }
             }
         }
     }
     $FBAct = new EbayFeedbackAct();
     $total = $FBAct->act_getOrderNum($where);
     $num = 50;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     if ($sort_type != '1') {
         $where .= " order by feedbacktime asc " . $page->limit;
     } else {
         $where .= " order by feedbacktime desc " . $page->limit;
     }
     //echo $where;
     $fbkList = $FBAct->act_getOrderList('*', $where);
     //var_dump($fbkList[0]);
     if (!empty($_GET['page'])) {
         if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
             $n = 1;
         } else {
             $n = (intval($_GET['page']) - 1) * $num + 1;
         }
     } else {
         $n = 1;
     }
     if ($total > $num) {
         //输出分页显示
         $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $show_page = $page->fpage(array(0, 2, 3));
     }
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('fbkList', $fbkList);
     $accAct = new AccountAct();
     $accountList = $accAct->act_getAccountList('id,account', 'where platformId = 1 and is_delete = 0');
     $this->smarty->assign('accountList', $accountList);
     $reasonList = $FBAct->act_getEbayReasonCategoryInfo('*', '');
     $this->smarty->assign('reasonList', $reasonList);
     $this->smarty->assign('state', $state);
     $this->smarty->assign('secnev', '1');
     //二级导航
     $this->smarty->assign('module', 'SKU等待领取');
     $this->smarty->assign('username', $_SESSION['userName']);
     $this->smarty->display('ebayFeedbackManage.htm');
 }