예제 #1
0
 public function view_iqcScanList()
 {
     //global $memc_obj;
     $condition = array();
     $where = "";
     $d_status = 0;
     $isCombine = 1;
     $sku = "";
     $j_status = 0;
     $t_status = 0;
     $startTime = date("Y-m-d H:i:s", time());
     $endTime = date("Y-m-d H:i:s", time());
     if (isset($_POST) && !empty($_POST)) {
         $sku = trim($_POST['sku']);
         $d_status = $_POST['d_status'];
         //导出类型:0->显示所以信息 1:->不良品统计表导出
         $isCombine = $_POST['isCombine'];
         //是否合并:0->需要合并   1:->默认不合并
         $sellerId = $_POST['sellerId'];
         //大卖家ID
         $j_status = $_POST['j_status'];
         //检测类型
         $t_status = $_POST['t_status'];
         //SKU分类检测
         if (!empty($_POST['startTime']) && !empty($_POST['endTime'])) {
             $startTime = strtotime(trim($_POST['startTime']));
             //开始时间
             $endTime = strtotime(trim($_POST['endTime']));
             //结束时间
             $condition[] = "checkTime BETWEEN {$startTime} AND {$endTime}";
             $startTime = trim($_POST['startTime']);
             //开始时间
             $endTime = trim($_POST['endTime']);
             //结束时间
         }
         $condition[] = "sellerId = '{$sellerId}'";
         if (!empty($j_status)) {
             $condition[] = "checkTypeID = '{$j_status}'";
         }
         if (!empty($t_status)) {
             $condition[] = "skuTypeCheckID = '{$t_status}'";
         }
         if (!empty($sku)) {
             $condition[] = "sku = '{$sku}'";
         }
         $combine = false;
         if ($d_status == 1) {
             if ($isCombine == 0) {
                 $combine = true;
                 $condition[] = "rejectsNum > 0 GROUP BY sku";
             } else {
                 $condition[] = "rejectsNum > 0";
             }
         }
         $where = "where " . implode(" and ", $condition);
         //echo $where;exit;
         //echo "<pre>"; print_r($condition); exit;
     }
     $IqcCompleteInfoAct = new IqcCompleteInfoAct();
     $total = $IqcCompleteInfoAct->act_getPageNum($where);
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= " order by id desc " . $page->limit;
     //echo $where;exit;
     $iqcCompleteInfoList = $IqcCompleteInfoAct->act_iqcCompleteInfo($where, $combine);
     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('iqcCompleteInfoList', $iqcCompleteInfoList);
     $qcStandard = new qcStandardAct();
     $detectionTypeArrList = $qcStandard->act_detectionTypeList($this->where);
     $qcStandard = new qcStandardAct();
     $skuTypeQcArrList = $qcStandard->act_skuTypeQcList($this->where);
     $skuTypeQcArr = array();
     foreach ($skuTypeQcArrList as $skuTypeList) {
         $skuTypeQcArr[$skuTypeList['id']] = $skuTypeList['typeName'];
     }
     $detectionTypeArr = array();
     foreach ($detectionTypeArrList as $listValue) {
         $detectionTypeArr[$listValue['id']] = $listValue['typeName'];
     }
     /*
     $skuInfos = array();
     foreach($iqcCompleteInfoList as $infoListValue){
     	$where = "sku='{$infoListValue['sku']}'";
     	$where = base64_encode($where);
     	//存储用户权限信息到memcache
     	$memkey = md5("pc_goods".trim($where));
     	$memresult = $memc_obj->get($memkey);
     	if(!$memresult){
     		$memresult = UserCacheModel::goodsInfosCache("*", $where);
     	}
     	$skuInfos[$infoListValue['sku']] = @$memresult['data'][0]['goodsName'];
     }
     $this->smarty->assign('skuInfos',$skuInfos);
     */
     $this->smarty->assign('sku', $sku);
     $this->smarty->assign('d_status', $d_status);
     $this->smarty->assign('isCombine', $isCombine);
     $this->smarty->assign('j_status', $j_status);
     $this->smarty->assign('t_status', $t_status);
     $this->smarty->assign('detectionTypeArr', $detectionTypeArr);
     $this->smarty->assign('skuTypeQcArr', $skuTypeQcArr);
     $this->smarty->assign('detectionTypeArrList', $detectionTypeArrList);
     $this->smarty->assign('skuTypeQcArrList', $skuTypeQcArrList);
     $this->smarty->assign('startTime', $startTime);
     $this->smarty->assign('endTime', $endTime);
     $this->smarty->assign('secnev', '3');
     //二级导航
     $this->smarty->assign('module', 'QC已完成检测信息');
     $this->smarty->assign('username', $_SESSION['userName']);
     $navarr = array("<a href='index.php?mod=iqcInfo&act=iqcScanList'>QC检测信息</a>", ">>", "QC已完成检测信息");
     $this->smarty->assign('navarr', $navarr);
     $this->smarty->display('iqcScanList.htm');
 }