Exemple #1
0
 public function view_boxManage()
 {
     $ordersn = isset($_GET['ordersn']) ? trim($_GET['ordersn']) : '';
     //状态
     $status = isset($_GET['status']) ? intval($_GET['status']) : FALSE;
     //状态
     $boxId = isset($_GET['boxid']) ? trim($_GET['boxid']) : FALSE;
     //箱号
     $sku = isset($_GET['sku']) ? trim($_GET['sku']) : FALSE;
     //箱号
     $startTime = isset($_GET['startTime']) ? trim($_GET['startTime']) : FALSE;
     //开始时间
     $endTime = isset($_GET['endTime']) ? trim($_GET['trim']) : FALSE;
     //结束时间
     $whereSql = '';
     if (!empty($ordersn)) {
         $whereSql .= " and a.replenshId='{$ordersn}' ";
     }
     if (!empty($status)) {
         $whereSql .= " and a.status='{$status}' ";
     }
     if (!empty($boxId)) {
         $bxid = intval($boxId);
         $whereSql .= " and a.boxid='{$bxid}' ";
     }
     if (!empty($sku)) {
         $whereSql .= " and b.sku = '{$sku}' ";
     }
     if (!empty($startTime)) {
         $startTimeStamp = strtotime($startTime);
         $whereSql .= " and a.addtime>{$startTimeStamp} ";
     }
     if (!empty($endTime)) {
         $endTimeStamp = strtotime($endTime);
         $whereSql .= " and a.addtime<{$endTimeStamp} ";
     }
     $pageSize = 200;
     $box_obj = new BoxManageModel();
     $count = $box_obj->culCount($whereSql);
     $pageObj = new Page($count, $pageSize);
     $orderby = " ORDER BY a.boxid DESC ";
     $boxinfoList = $box_obj->getListBoxInfo($whereSql . $orderby . $pageObj->limit);
     foreach ($boxinfoList as &$boxInfo) {
         $boxInfo['timestr'] = date('Y-m-d H:i:s', $boxInfo['addtime']);
         $boxInfo['replenshId'] = empty($boxInfo['replenshId']) ? '未关联补货单' : $boxInfo['replenshId'];
         $boxInfo['sendtime'] = empty($boxInfo['sendScanTime']) ? '未发柜' : date('Y-m-d H:i:s', $boxInfo['sendScanTime']);
         $boxInfo['statusStr'] = BoxManageModel::status2Name($boxInfo['status']);
         $detailInfo = $box_obj->getBoxSkuDetail($boxInfo['boxid']);
         $boxInfo['skudetail'] = $detailInfo;
         $boxInfo['addUserName'] = getUserNameById($boxInfo['adduser']);
     }
     $navlist = array(array('url' => '', 'title' => '海外仓补货'), array('url' => '', 'title' => '箱号管理'));
     if ($count > $pageSize) {
         $pagestr = $pageObj->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $pageObj->fpage(array(0, 2, 3));
     }
     $toplevel = 2;
     //顶层菜单
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = '214';
     //当前的二级菜单
     $this->smarty->assign('pagestr', $pagestr);
     $this->smarty->assign('boxList', $boxinfoList);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('third', 3);
     $this->smarty->assign('status', $status);
     $this->smarty->assign('orderSn', $ordersn);
     $this->smarty->assign('boxid', $boxId);
     $this->smarty->assign('sku', $sku);
     $this->smarty->assign('starttime', $startTime);
     $this->smarty->assign('endtime', $endTime);
     $this->smarty->display('owBoxManage.htm');
 }
 public function view_showPreOrderDetail()
 {
     $orderId = isset($_GET['orderid']) ? $_GET['orderid'] : '';
     $order_obj = new PreplenshOrderModel();
     $orderInf = $order_obj->getPrePlenshOrderInfo($orderId);
     if (FALSE === $orderInf) {
         goErrMsgPage(array('data' => array('不存在的补货单'), 'link' => 'index.php?mod=owGoodsReplenishManage&act=preOrderList'));
         exit;
     }
     $box_obj = new BoxManageModel();
     $pageSize = 100;
     $count = $box_obj->culBoxList($orderId);
     $pageObj = new Page($count, $pageSize);
     $navlist = array(array('url' => '', 'title' => '海外仓补货'), array('url' => '', 'title' => '补货单详情'));
     if ($count > $pageSize) {
         $pagestr = $pageObj->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $pageObj->fpage(array(0, 2, 3));
     }
     $detailList = $box_obj->getListBoxInfo(" and replenshId='{$orderId}' " . $pageObj->limit);
     foreach ($detailList as &$box) {
         $box['timestr'] = date('Y-m-d H:i:s', $box['addtime']);
         $box['statusstr'] = BoxManageModel::status2Name($box['status']);
         $box['userName'] = empty($box['sendScanUser']) ? '' : getUserNameById($box['sendScanUser']);
     }
     $toplevel = 2;
     //顶层菜单
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = '214';
     //当前的二级菜单
     $this->smarty->assign('pagestr', $pagestr);
     $this->smarty->assign('detailList', $detailList);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('third', 4);
     $this->smarty->display('PreOrderDetail.htm');
 }