示例#1
0
 /**
  * 获取对应审核人待审核出入库单数据列表
  * @param string $where
  * @param string $sort
  * @param string $limit
  */
 public function getAuditIOStoreList($where, $sort = '', $limit = '')
 {
     self::initDB();
     $usermodel = UserModel::getInstance();
     $sql = "SELECT * FROM wh_iostore {$where} {$sort} {$limit}";
     $query = self::$dbConn->query($sql);
     if (!empty($query)) {
         $lists = self::$dbConn->fetch_array_all($query);
         if (empty($lists)) {
             return array();
         }
         foreach ($lists as &$list) {
             $sql = "SELECT * FROM wh_iostoredetail WHERE iostoreId={$list['id']}";
             $query = self::$dbConn->query($sql);
             $dlists = self::$dbConn->fetch_array_all($query);
             $list['auditlist'] = $this->getAuditRelationList($list['ordersn'], $list['invoiceTypeId'], $list['storeId']);
             $list['detail'] = is_array($dlists) ? $dlists : array();
             $list['invoiceName'] = self::getInvoiceTypeNameById($list['invoiceTypeId']);
             $list['paymentMethods'] = self::getPaymentMethodsById($list['paymentMethodsId']);
             $list['whName'] = self::getWhNameById($list['storeId']);
         }
         return $lists;
         //成功, 返回列表数据
     } else {
         self::$errCode = "001";
         self::$errMsg = "获取数据失败";
         return false;
         //失败则设置错误码和错误信息, 返回false
     }
 }
示例#2
0
 /**
  * 删除员工
  * @param $sid
  */
 public function deleteAction()
 {
     $UserModel = UserModel::getInstance();
     $UserModel->delete(array('_id' => $this->getRequest()->getParam('userId')));
     $this->responseAjax(Constant::CODE_SUCCESS, '');
     return false;
 }
 public function __construct($userModel = null)
 {
     if ($userModel === null) {
         $userModel = UserModel::getInstance();
     }
     $this->userModel = $userModel;
     parent::__construct();
 }
示例#4
0
文件: user.php 项目: yinliguo/phpBase
 /**
  * 添加员工
  * 
  * @return bool
  * @throws Exception
  */
 public function addStaffAction()
 {
     $UserModel = UserModel::getInstance();
     $staff = $this->getRequest()->getRequest();
     $UserModel->createUser($staff);
     $this->responseAjax(Constant::CODE_SUCCESS, '');
     return false;
 }
示例#5
0
 public function getPackingUserList()
 {
     /*
      * 处理包装员信息
      */
     $usermodel = UserModel::getInstance();
     $iqc_user = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job in (127,167)", '', '');
     return $iqc_user;
 }
示例#6
0
文件: Base.php 项目: yinliguo/phpBase
 /**
  * 回复ajax的响应
  *
  * @param $code
  * @param $msg
  * @param $data
  */
 public function responseAjax($code, $msg, $data = [])
 {
     $this->dataFlow->toFlow($data);
     if (isset($_SESSION['UID'])) {
         $this->dataFlow->toFlow(array('UID' => $_SESSION['UID']));
         UserModel::getInstance()->fetchToDataFlow(array('_id' => $_SESSION['UID']));
     }
     $data = $this->dataFlow->data;
     header('Content-Type: application/json');
     if (trim($msg) == '') {
         $msg = $code['desc'];
     }
     echo json_encode(array('err' => $code['code'], 'msg' => $msg, 'data' => $data));
 }
示例#7
0
文件: Home.php 项目: paveli/Tweeem
 /**
  * Вход в систему
  */
 public function login()
 {
     /**
      * Если пришли данный из формы
      */
     if (($data = $this->input->post('login')) !== FALSE) {
         /**
          * Если данные верны
          */
         if (($result = UserModel::getInstance()->validateLogin($data)) === TRUE) {
             $result = array();
             /**
              * Попытка аутентификации
              */
             $this->auth->inauthenticate();
             switch ($this->auth->authenticate($data['login'], $data['password'])) {
                 /**
                  * Если прошли, отправляемся на главную страницу
                  */
                 case Tweeem_Auth_Identifier_Twitter::SUCCESS:
                     if ($data['remember']) {
                         $identity = $this->auth->identity();
                         $this->auth->setCookie($identity['hash']);
                     }
                     $this->router->redirect('/');
                     break;
                     /**
                      * Если не прошли выдаём ошибку
                      */
                 /**
                  * Если не прошли выдаём ошибку
                  */
                 case Tweeem_Auth_Identifier_Twitter::FAILURE:
                     $result['invalid'] = $this->text->dget('validator', 'Login or password is invalid');
                     break;
             }
         }
         $this->view->smarty->assign('loginErrors', $result);
         $this->view->smarty->assign('login', $data);
     }
     $this->view->show('Home/index');
 }
示例#8
0
 /**
  * Конструктор
  */
 protected function __construct()
 {
     parent::__construct();
     /**
      * Получение объекта для работы со списками разделения доступа
      */
     $this->acl = Open_Acl::getInstance();
     $this->view->smarty->assign('acl', $this->acl);
     /**
      * Создание объекта аутентификации
      */
     $A =& $this->auth;
     $A = Open_Auth::getInstance();
     $A->identifier(Tweeem_Auth_Identifier_Twitter::getInstance());
     /**
      * Аутентификация и задание юзера
      */
     $A->authenticate();
     $this->user = ($temp = $A->identity()) !== FALSE ? $temp : UserModel::getInstance()->getGuest();
     $this->view->smarty->assign_by_ref('user', $this->user);
 }
示例#9
0
文件: user.php 项目: yinliguo/phpBase
 /**
  * 打开登录页面或进行登录
  * 
  * @return bool
  */
 public function loginAction()
 {
     $username = $this->getRequest()->getRequest('username');
     $password = md5($this->getRequest()->getRequest('password'));
     if (!is_null($username)) {
         $user = UserModel::getInstance()->fetchOne(array('username' => $username, 'password' => $password));
         if (!is_null($user)) {
             if (!isset($_SESSION)) {
                 session_start();
             }
             $_SESSION['UID'] = $user['_id'];
             $this->responseAjax(Constant::CODE_SUCCESS, '');
         } else {
             $this->responseAjax(Constant::CODE_FAIL, '用户名或密码错误');
         }
         return false;
     }
     if ($_SESSION && $_SESSION['UID']) {
         Utils::redirectTo('/');
     }
     $this->response();
 }
示例#10
0
 public function view_getWhIoRecordsList()
 {
     $type = isset($_GET['type']) ? $_GET['type'] : '';
     $status = isset($_GET['status']) ? $_GET['status'] : '';
     $ioType = isset($_GET['ioType']) ? $_GET['ioType'] : '';
     if (intval($ioType) != 1 && intval($ioType) != 2) {
         //1为出库,2为入库
         $this->smarty->assign('$toptitle', '出入库记录列表');
         $this->smarty->assign('status', '参数错误');
         $this->smarty->assign('whIoRecordsList', null);
         //循环列表
         $this->smarty->display("whIoRecords.htm");
     } else {
         $ioType = intval($ioType);
         $whIoRecordsAct = new WhIoRecordsAct();
         $where = "WHERE ioType='{$ioType}' ";
         if ($type == 'search') {
             $id = isset($_GET['id']) ? post_check($_GET['id']) : '';
             $ordersn = isset($_GET['ordersn']) ? post_check($_GET['ordersn']) : '';
             $ioTypeId = isset($_GET['ioTypeId']) ? post_check($_GET['ioTypeId']) : '';
             $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : '';
             $purchaseId = isset($_GET['purchaseId']) ? post_check($_GET['purchaseId']) : '';
             $userId = isset($_GET['userId']) ? post_check($_GET['userId']) : '';
             $positionId = isset($_GET['position']) ? post_check($_GET['position']) : '';
             $cStartTime = isset($_GET['cStartTime']) ? post_check($_GET['cStartTime']) : '';
             $cEndTime = isset($_GET['cEndTime']) ? post_check($_GET['cEndTime']) : '';
             if (!empty($id)) {
                 $where .= "AND id='{$id}' ";
             }
             if (!empty($ordersn)) {
                 $where .= "AND ordersn='{$ordersn}' ";
             }
             if (!empty($ioTypeId)) {
                 $where .= "AND ioTypeId='{$ioTypeId}' ";
             }
             if (!empty($sku)) {
                 $where .= "AND sku='{$sku}' ";
             }
             if (!empty($purchaseId)) {
                 $purchaseId = getUserIdByName($purchaseId);
                 $where .= "AND purchaseId='{$purchaseId}' ";
             }
             if (!empty($userId)) {
                 $userId = getUserIdByName($userId);
                 $where .= "AND userId='{$userId}' ";
             }
             if ($positionId) {
                 $positionId = WhPositionDistributionModel::get_position_info('id', '', $positionId);
                 $positionId = empty($positionId) ? '-1' : $positionId[0]['id'];
                 $where .= "AND positionId = '{$positionId}' ";
             }
             if (!empty($cStartTime)) {
                 $startTime = strtotime($cStartTime . '00:00:00');
                 $where .= "AND createdTime >='{$startTime}' ";
             }
             if (!empty($cEndTime)) {
                 $endTime = strtotime($cEndTime . '23:59:59');
                 $where .= "AND createdTime <='{$endTime}' ";
             }
         }
         $total = $whIoRecordsAct->act_getTNameCount('wh_iorecords', $where);
         $num = 100;
         //每页显示的个数
         $page = new Page($total, $num, '', 'CN');
         $where .= "ORDER BY createdTime DESC " . $page->limit;
         $whIoRecordsList = $whIoRecordsAct->act_getTNameList('wh_iorecords', '*', $where);
         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));
         }
         $toptitle = '出库记录列表';
         $ioSearchName = '出库类型';
         $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '出库记录列表'));
         $this->smarty->assign('toplevel', 0);
         $this->smarty->assign('secondlevel', '34');
         $ioTypeList = WhIoStoreModel::getIoTypeListByioType(0);
         if ($ioType == 2) {
             $toptitle = '入库记录列表';
             $ioSearchName = '入库类型';
             $this->smarty->assign('secondlevel', 35);
             $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '入库记录列表'));
             $ioTypeList = WhIoStoreModel::getIoTypeListByioType(1);
         }
         $this->smarty->assign('toptitle', $toptitle);
         $this->smarty->assign('ioSearchName', $ioSearchName);
         $this->smarty->assign('ioTypeList', $ioTypeList);
         $this->smarty->assign('navlist', $navlist);
         $this->smarty->assign('show_page', $show_page);
         $this->smarty->assign('status', $status);
         $usermodel = UserModel::getInstance();
         foreach ($whIoRecordsList as $key => $val) {
             $whIoRecordsList[$key]['ioTypeName'] = WhIoStoreModel::getIoTypeNameById($val['ioTypeId']);
             $whIoRecordsList[$key]['whName'] = WhIoStoreModel::getWhNameById($val['storeId']);
             $purchase_user_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$val['purchaseId']}'", '', 'limit 1');
             $whIoRecordsList[$key]['purchaseName'] = $purchase_user_info[0]['global_user_name'];
             //$user_info 		   					   = $usermodel->getGlobalUserLists('global_user_name',"where a.global_user_id='{$val['userId']}'",'','limit 1');
             //$whIoRecordsList[$key]['userName']	   = $user_info[0]['global_user_name'];
             $whIoRecordsList[$key]['userName'] = getUserNameById($val['userId']);
             $position_info = whShelfModel::selectPosition("where id={$val['positionId']}");
             $whIoRecordsList[$key]['pName'] = $position_info[0]['pName'];
         }
         $this->smarty->assign('whIoRecordsList', $whIoRecordsList ? $whIoRecordsList : null);
         //循环列表
         $this->smarty->display("whIoRecords.htm");
     }
 }
示例#11
0
 /**
  * UserAct::act_update()
  * 修改用户act
  * @return bool
  */
 public function act_update()
 {
     if (!isset($_POST['username']) || trim($_POST['username']) == '') {
         exit("用户名为空!");
     }
     $dataArr = $_POST;
     $power = array();
     $username = post_check(trim($_POST['username']));
     $password = post_check(trim($_POST['password']));
     $jobno = isset($_POST['jobno']) ? post_check(trim($_POST['jobno'])) : '';
     $phone = isset($_POST['phone']) ? post_check(trim($_POST['phone'])) : '';
     $email = isset($_POST['email']) ? post_check(trim($_POST['email'])) : '';
     $independence = intval($_POST['user_independence']);
     $stat = intval($_POST['user_status']);
     $userjob = explode("|", $_POST['userjob']);
     $userdept = intval($_POST['userdept']);
     $grantDate = post_check(trim($_POST['grantDate']));
     $effectiveDate = intval($_POST['effectiveDate']);
     $userToken = post_check(trim($_POST['usertoken']));
     $usersingle = UserModel::getInstance();
     //获取当前用户信息
     $filed = ' a.*,b.job_name,c.dept_name,d.company_name';
     $where = " WHERE a.user_id='{$_SESSION[C('USER_AUTH_ID')]}' ";
     $userinfo = $usersingle->getUserInfo($filed, $where);
     $groupname = ActionModel::actionGroupList("12");
     //读取系统的actiongroup列表
     foreach ($groupname as $v) {
         if (is_array($_POST["{$v}"]) && isset($_POST["{$v}"])) {
             array_push($power, "\"{$v}\":" . json_encode($_POST["{$v}"]));
         } else {
             array_push($power, "\"{$v}\":[]");
         }
     }
     $power = implode(",", $power);
     $power = "{" . $power . "}";
     $newInfo = array('userName' => $username, 'pwd' => $password, 'jobNo' => $jobno, 'email' => $email, 'phone' => $phone, 'menuPower' => '["31"]', 'status' => $stat, 'independence' => $independence, 'power' => $power, 'jobPower' => intval($userjob[0]), 'tokenGrantDate' => $grantDate, 'TokenEffectiveDate' => $effectiveDate, 'company' => '1', 'dept' => $userdept, 'job' => intval($userjob[1]));
     //如果当前用户是自己就不修改权限
     if ($userToken == $userinfo['user_token']) {
         unset($newInfo['power']);
     }
     $result = M('User')->userUpdate($newInfo, $userToken);
     return $result;
 }
示例#12
0
 function act_auditorNameVerify()
 {
     $auditorName = trim($_POST['whData']);
     $usermodel = UserModel::getInstance();
     $whereStr = "where a.global_user_name = '" . $auditorName . "'";
     $auditorUserId = $usermodel->getGlobalUserLists('global_user_id', $whereStr, '', '');
     //$auditorUserId[0]['global_user_id'];
     if (empty($auditorUserId)) {
         self::$errCode = '4444';
         return false;
     } else {
         self::$errCode = '200';
         return $auditorUserId;
     }
 }
 public static function skuVerify($where)
 {
     self::initDB();
     $sql = "select goodsCost,purchaseId from " . self::$table6 . " {$where}";
     $query = self::$dbConn->query($sql);
     if ($query) {
         $ret = self::$dbConn->fetch_array_all($query);
         if (!empty($ret)) {
             //获取采购人名称
             $usermodel = UserModel::getInstance();
             $whereStr = "where a.global_user_id=" . $ret[0]['purchaseId'];
             $cgUser = $usermodel->getGlobalUserLists('global_user_name', $whereStr, '', '');
             //$cgUser[0]['global_user_name'];
             $ret[0]['purchaseName'] = $cgUser[0]['global_user_name'];
             return $ret;
         } else {
             self::$errCode = "4444";
             self::$errMsg = "mysql:" . $sql . " null";
             return false;
         }
     } else {
         self::$errCode = "4444";
         self::$errMsg = "mysql:" . $sql . " error";
         return false;
     }
 }
示例#14
0
 public function view_inquiry()
 {
     $starttime = date('Y-m-d ') . ' 09:00:00';
     $now_time = date("Y-m-d H:i:s", time());
     $startdate = isset($_POST['startdate']) ? post_check($_POST['startdate']) : $starttime;
     $enddate = isset($_POST['enddate']) ? post_check($_POST['enddate']) : $now_time;
     $pda_user = isset($_POST['pda_user']) ? post_check($_POST['pda_user']) : 0;
     $weigh_scan_user = isset($_POST['weigh_scan_user']) ? post_check($_POST['weigh_scan_user']) : 0;
     $orderid = isset($_POST['orderid']) ? post_check($_POST['orderid']) : '';
     $action = isset($_POST['action']) ? post_check($_POST['action']) : '';
     $PdaManagementAct = new PdaManagementAct();
     if (!empty($action)) {
         switch ($action) {
             case 'search':
                 $search_info = $PdaManagementAct->act_getPickingInfo($startdate, $enddate, $pda_user);
                 $this->smarty->assign('pda_user', $pda_user);
                 $this->smarty->assign('serch_info', $search_info);
                 break;
             case 'search_scan_recheck':
                 $search_info = $PdaManagementAct->act_getReviewInfo($startdate, $enddate, $pda_user);
                 $this->smarty->assign('pda_user', $pda_user);
                 $this->smarty->assign('serch_info', $search_info);
                 break;
             case 'packge_search':
                 $search_info = $PdaManagementAct->act_getPackageInfo($startdate, $enddate, $pda_user);
                 $this->smarty->assign('pda_user', $pda_user);
                 $this->smarty->assign('serch_info', $search_info);
                 break;
             case 'search_scan_weigh':
                 $search_info = $PdaManagementAct->act_getWeighInfo($startdate, $enddate, $weigh_scan_user);
                 $this->smarty->assign('weigh_scan_user', $weigh_scan_user);
                 $this->smarty->assign('serch_info', $search_info);
                 break;
             case 'search_info1':
                 $search_info = $PdaManagementAct->act_getGroupInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info2':
                 $search_info = $PdaManagementAct->act_searchPickingInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info3':
                 $search_info = $PdaManagementAct->act_searchReviewInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info4':
                 $search_info = $PdaManagementAct->act_searchPackageInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info5':
                 $search_info = $PdaManagementAct->act_searchWeighInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info6':
                 //查询订单分区扫描记录
                 $search_info = $PdaManagementAct->act_searchPartionInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info7':
                 //分拣记录
                 $search_info = $PdaManagementAct->act_searchSortingInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info8':
                 //装车扫描纪录
                 $search_info = $PdaManagementAct->act_searchLoading_express($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info9':
                 //分区复核记录
                 $search_info = $PdaManagementAct->act_searchReview($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info10':
                 //发货组复核记录
                 $search_info = $PdaManagementAct->act_searchGroupReview($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info11':
                 //查询包裹下订单信息
                 $search_info = $PdaManagementAct->act_searchOrderToPackage($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info12':
                 //查询配货单配货记录
                 $search_info = $PdaManagementAct->act_search_scan_record($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info13':
                 //查询发货单分拣信息
                 $search_info = $PdaManagementAct->act_search_order_pick($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
         }
     }
     //包装员
     $usermodel = UserModel::getInstance();
     $picking_info = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=103", '', '');
     $this->smarty->assign('picking_info', $picking_info);
     //称重员
     $Weigh_info = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=126", '', '');
     $this->smarty->assign('Weigh_info', $Weigh_info);
     $this->smarty->assign('startdate', $startdate);
     $this->smarty->assign('enddate', $enddate);
     $navlist = array(array('url' => '', 'title' => '出库'), array('url' => 'index.php?mod=pdaManagement&act=inquiry', 'title' => 'pda操作查询'));
     $this->smarty->assign('navlist', $navlist);
     $toplevel = 2;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = 210;
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', 'pda操作查询');
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('pdaManagement.htm');
 }
示例#15
0
 public function act_edit()
 {
     $id = $_POST['id'];
     $labelUser = $_POST['e_username'];
     $usermodel = UserModel::getInstance();
     $userInfo = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_name='{$labelUser}'", '', '');
     if (!$userInfo) {
         self::$errCode = 201;
         self::$errMsg = "该用户不存在,请先添加";
         return false;
     }
     $info = PasteLabelModel::editRecord($id, $userInfo[0]['global_user_id']);
     if ($info) {
         self::$errMsg = "修改成功";
         return true;
     } else {
         self::$errCode = 201;
         self::$errMsg = "修改失败";
         return false;
     }
 }
示例#16
0
 /**
  * 订单
  */
 public function orderAction()
 {
     $foodList = FoodModel::getInstance()->fetchToDataFlow(array());
     $groupOrderNo = $this->getRequest()->getRequest('group_order_no');
     $GroupOrderModel = GroupOrderModel::getInstance();
     if ($groupOrderNo) {
         $groupOrderNo = intval($groupOrderNo);
         $GroupOrderModel->fetchToDataFlow(array('order_no' => $groupOrderNo));
         $foodOrderList = FoodOrderModel::getInstance()->fetchToDataFlow(array('group_order' => $groupOrderNo));
         $this->dataFlow->toFlow(array('isPaid' => true, 'groupOrderNo' => $groupOrderNo, 'prevGroupOrderNo' => $GroupOrderModel->getPrevGroupOrderNo($groupOrderNo), 'nextGroupOrderNo' => $GroupOrderModel->getNextGroupOrderNo($groupOrderNo)));
     } else {
         $foodOrderList = FoodOrderModel::getInstance()->fetchAllNotPayOrdersToFlow();
         $this->dataFlow->toFlow(array('isPaid' => false, 'prevGroupOrderNo' => $GroupOrderModel->getPrevGroupOrderNo()));
     }
     // 关联的用户
     $relatedUserList = [];
     // 关联的餐厅
     $relatedRestaurantList = [];
     // 最终订单的数据结构
     $orderList = [];
     /**
     * {
            {restaurantId}: {
     *          {foodId}: {
                    'count': 12,
     *              'user': [{userId}]
     *          }
     *      }
     * }
     *
     */
     foreach ($foodOrderList as $foodOrderId => $foodOrder) {
         $relatedUserList[] = $foodOrder['user'];
         foreach ($foodOrder['foods'] as $food) {
             $tmpFoodId = $food['food_id'];
             $tmpCount = $food['count'];
             $tmpRestaurant = $foodList[$food['food_id']]['restaurant'];
             $relatedRestaurantList[] = $tmpRestaurant;
             if (isset($orderList[$tmpRestaurant])) {
                 if (isset($orderList[$tmpRestaurant][$tmpFoodId])) {
                     $orderList[$tmpRestaurant][$tmpFoodId]['count'] += $tmpCount;
                     $orderList[$tmpRestaurant][$tmpFoodId]['user'][] = $food['user'];
                 } else {
                     $orderList[$tmpRestaurant][$tmpFoodId] = array('count' => $tmpCount, 'user' => [$foodOrder['user']]);
                 }
             } else {
                 $orderList[$tmpRestaurant] = array($tmpFoodId => array('count' => $tmpCount, 'user' => [$foodOrder['user']]));
             }
         }
     }
     UserModel::getInstance()->fetchToDataFlow(array('_id' => array('$in' => $relatedUserList)));
     RestaurantModel::getInstance()->fetchToDataFlow(array('_id' => array('$in' => $relatedRestaurantList)));
     $this->dataFlow->toFlow(array('orderList' => $orderList));
     $this->response();
 }
示例#17
0
 public function view_labelingList()
 {
     $navlist = array(array('url' => '', 'title' => '入库'), array('url' => 'index.php?mod=pasteLabel&act=pasteLabel', 'title' => '贴标录入'), array('url' => '', 'title' => '贴标列表'));
     $toplevel = 1;
     $secondlevel = 17;
     $checkUser = isset($_GET['checkUser']) ? $_GET['checkUser'] : "";
     $sku = isset($_GET['sku']) ? $_GET['sku'] : "";
     $status = isset($_GET['status']) ? $_GET['status'] : 0;
     $start = isset($_GET['startdate']) ? $_GET['startdate'] : "";
     $end = isset($_GET['enddate']) ? $_GET['enddate'] : "";
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toplevel', $toplevel);
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign("status", $status);
     if (empty($checkUser) && empty($sku) && empty($start) && empty($end) && empty($status)) {
         $where = "where a.is_delete=0 and a.status=1 order by a.id desc";
     } else {
         if (!empty($checkUser)) {
             $where[] = "a.labelUserId='{$checkUser}'";
             $this->smarty->assign("labelingUserId", $checkUser);
         }
         if (!empty($status)) {
             if ($status == 1) {
                 $where[] = "a.labelUserId is NULL";
             }
             if ($status == 2) {
                 $where[] = "a.labelUserId is not NULL";
             }
         }
         if (!empty($sku)) {
             $where[] = "b.sku = '{$sku}'";
             $this->smarty->assign("sku", $sku);
         }
         if (!empty($start) && !empty($end)) {
             $starttime = strtotime($start);
             $endtime = strtotime($end);
             $where[] = "(a.labelTime between {$starttime} and {$endtime})";
             $this->smarty->assign("start", $start);
             $this->smarty->assign("end", $end);
         } elseif (!empty($start) && empty($end)) {
             $starttime = strtotime($start);
             $where[] = "a.labelTime >{$starttime}";
             $this->smarty->assign("start", $start);
         } elseif (empty($start) && !empty($end)) {
             $endtime = strtotime($end);
             $where[] = "a.labelTime < {$endtime}";
             $this->smarty->assign("end", $end);
         }
         $where = implode(" AND ", $where);
         $where = " where a.is_delete=0 and a.status=1 and " . $where . " order by a.id desc";
     }
     $lists = PasteLabelModel::selectList($where);
     $pagesize = 20;
     $nums = count($lists);
     $pager = new Page($nums, $pagesize);
     $lists = PasteLabelModel::selectList($where . " " . $pager->limit);
     if ($nums > $pagesize) {
         //分页
         $pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $pager->fpage(array(0, 2, 3));
     }
     $usermodel = UserModel::getInstance();
     //贴标员
     $tallyUser = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=130", '', '');
     $this->smarty->assign('tallyUser', $tallyUser);
     $toptitle = '贴标列表';
     //顶部链接
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('pagestr', $pagestr);
     $this->smarty->assign("lists", $lists);
     $this->smarty->display('labelingList.htm');
 }
示例#18
0
文件: Twitter.php 项目: paveli/Tweeem
 /**
  * Идентифицировать по значению уникальности и значению удостоверения личности
  *
  * @param string $identity
  * @param string $credential
  * @return mixed
  */
 public function identify($identity, $credential)
 {
     $M = UserModel::getInstance();
     /**
      * Если в самом Twitter существует запись
      */
     if ($M->isAuthorized($identity, $credential)) {
         /**
          * Ищем запись в нашей БД
          * Если запись не найдена, то добавляем
          * Иначе обновляем дату существующей и
          */
         if (($row = $M->getByLogin($identity)) === FALSE) {
             $id = $M->insert($identity, $credential);
         } else {
             $id = $M->refresh($row, $credential);
         }
         /**
          * Получение
          */
         $user = $M->getById($id);
         /**
          * Получение URL картинок профиля пользователя
          */
         $user['profile_image'] = $M->getProfileImage($identity);
         $this->identity($user);
         return self::SUCCESS;
     }
     return self::FAILURE;
 }
示例#19
0
 public function view_invList()
 {
     $now_time = date("Y-m-d H:i:s", time());
     $state = isset($_GET['state']) ? post_check($_GET['state']) : '';
     $this->smarty->assign('state', $state);
     $reason = array();
     $invPeople = isset($_GET['invPeople']) ? $_GET['invPeople'] : '';
     $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : '';
     $invType = isset($_GET['invType']) ? $_GET['invType'] : '';
     $auditStatus = isset($_GET['auditStatus']) ? $_GET['auditStatus'] : 3;
     $startdate = isset($_GET['startdate']) ? post_check($_GET['startdate']) : '';
     $enddate = isset($_GET['enddate']) ? post_check($_GET['enddate']) : '';
     $InventoryAct = new InventoryAct();
     $where = 'where storeId=1 ';
     if ($invPeople) {
         $where .= "and invPeople ='{$invPeople}' ";
         $this->smarty->assign('invPeople', $invPeople);
     }
     if ($sku) {
         $where .= "and sku ='{$sku}' ";
         $this->smarty->assign('sku', $sku);
     }
     if ($invType) {
         $where .= "and invType ='{$invType}' ";
         $this->smarty->assign('invType', $invType);
     }
     if ($auditStatus != 3) {
         $where .= "and auditStatus ='{$auditStatus}' ";
     }
     $this->smarty->assign('auditStatus', $auditStatus);
     if ($startdate) {
         $starttime = strtotime($startdate);
         $where .= "and invTime >='{$starttime}' ";
     } else {
         $startdate = $now_time;
     }
     $this->smarty->assign('startdate', $startdate);
     if ($enddate) {
         $endtime = strtotime($enddate);
         $where .= "and invTime <='{$endtime}' ";
     } else {
         $enddate = $now_time;
     }
     $this->smarty->assign('enddate', $enddate);
     $total = $InventoryAct->act_getInvNum($where);
     $num = 80;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "order by sku, id " . $page->limit;
     $inventory_info = $InventoryAct->act_getInvRecordList('*', $where);
     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);
     //盘点原因
     if (!empty($inventory_info)) {
         foreach ($inventory_info as $key => $info) {
             $reason_info = InvReasonModel::getInvReasonList("reasonName", "where id='{$info['reasonId']}'");
             $reason[$info['id']] = $reason_info[0]['reasonName'];
             $sku_info = getSkuInfoBySku($info['sku']);
             $inventory_info[$key]['goodsCost'] = $sku_info['goodsCost'];
             $inventory_info[$key]['purchaseName'] = $sku_info['purchaseId'] ? getUserNameById($sku_info['purchaseId']) : '无';
             $inventory_info[$key]['remark'] = $info['remark'] ? $info['remark'] : '';
             //新增等待上架数量 add by Gary
             $tallyList = OmAvailableModel::getTNameList('wh_tallying_list', 'sum(ichibanNums) ichibanNums, sum(shelvesNums) shelvesNums', "where sku='{$info['sku']}' and tallyStatus=0 and is_delete = 0");
             $ichibanNums = intval($tallyList[0]['ichibanNums']);
             $shelvesNums = intval($tallyList[0]['shelvesNums']);
             $inventory_info[$key]['wait_whself'] = $ichibanNums - $shelvesNums;
         }
     }
     $usermodel = UserModel::getInstance();
     //盘点员
     $iqc_user = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job in(162,165)", '', '');
     $this->smarty->assign('iqc_user', $iqc_user);
     $this->smarty->assign('inventory_info', $inventory_info ? $inventory_info : array());
     $this->smarty->assign('reason', $reason);
     $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '仓库'), array('url' => 'index.php?mod=inventory&act=inventory', 'title' => '盘点管理'), array('url' => 'index.php?mod=inventory&act=invList', 'title' => '盘点列表'));
     $toplevel = 0;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = 04;
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', '盘点列表');
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('inventoryInfo.htm');
 }
示例#20
0
 /**
  * JobAct::act_update()
  * 修改岗位act
  * @return bool
  */
 public function act_update()
 {
     if (!isset($_POST['jobName']) || trim($_POST['jobName']) == '') {
         exit("岗位名填写非法!");
     }
     if (!isset($_POST['jobPower']) || trim($_POST['jobPower']) == '' || !intval($_POST['jobPower'])) {
         exit("所属上级非法!");
     }
     if (!isset($_POST['jobDept']) || trim($_POST['jobDept']) == '' || !intval($_POST['jobDept'])) {
         exit("所属部门非法!");
     }
     if (!isset($_POST['jobId']) || trim($_POST['jobId']) == '' || !intval($_POST['jobId'])) {
         exit("岗位ID非法!");
     }
     if (!isset($_POST['jobpowerId']) || trim($_POST['jobpowerId']) == '' || !intval($_POST['jobpowerId'])) {
         exit("岗位权限ID非法!");
     }
     $jobName = post_check(trim($_POST['jobName']));
     $jobPower = intval(trim($_POST['jobPower']));
     $jobDept = intval($_POST['jobDept']);
     $jobId = intval($_POST['jobId']);
     $jobpowerId = intval($_POST['jobpowerId']);
     $newJob = array('jobId' => $jobId, 'jobName' => $jobName, 'jobDeptId' => $jobDept, 'jobPid' => $jobPower, 'jobCompanyId' => '1');
     $result = JobModel::jobUpdate($newJob);
     if ($result === false) {
         exit;
     }
     $power = array();
     $usersingle = UserModel::getInstance();
     //获取当前用户信息
     $filed = ' a.*,b.job_name,c.dept_name,d.company_name';
     $where = " WHERE a.user_id='{$_SESSION[C('USER_AUTH_ID')]}' ";
     $userinfo = $usersingle->getUserInfo($filed, $where);
     $groupname = ActionModel::actionGroupList(C('AUTH_SYSTEM_ID'));
     //读取系统的actiongroup列表
     foreach ($groupname as $v) {
         if (is_array($_POST["{$v}"]) && isset($_POST["{$v}"])) {
             array_push($power, "\"{$v}\":" . json_encode($_POST["{$v}"]));
         } else {
             //array_push($power,"\"{$v}\":[]");
         }
     }
     $power = implode(",", $power);
     $power = "{" . $power . "}";
     $newJobpower = array('jobpowerId' => $jobpowerId, 'jobpowerPower' => json_decode($power, true), 'jobpowerMenu' => json_decode('["31"]', true));
     $result = JobModel::jobPowerUpdate($newJobpower);
     return $result;
 }
示例#21
0
 public function view_getWhRecManageList()
 {
     $paramArr = array();
     $type = isset($_GET['type']) ? $_GET['type'] : '';
     $status = isset($_GET['status']) ? $_GET['status'] : '';
     $reStatus = isset($_GET['reStatus']) ? $_GET['reStatus'] : 0;
     $page = isset($_GET['page']) ? $_GET['page'] : 1;
     $paramArr['method'] = 'purchase.getPurchaseOrderList';
     //API名称
     $paramArr['page'] = $page;
     $paramArr['status'] = $reStatus;
     if ($type == 'search') {
         $keyWord = isset($_GET['keyWord']) ? post_check($_GET['keyWord']) : '';
         $select = isset($_GET['select']) ? post_check($_GET['select']) : 0;
         $cStartTime = isset($_GET['cStartTime']) ? post_check($_GET['cStartTime']) : '';
         $cEndTime = isset($_GET['cEndTime']) ? post_check($_GET['cEndTime']) : '';
         $eStartTime = isset($_GET['eStartTime']) ? post_check($_GET['eStartTime']) : '';
         $eEndTime = isset($_GET['eEndTime']) ? post_check($_GET['eEndTime']) : '';
         if (!empty($select)) {
             $paramArr['key'] = $keyWord;
             $paramArr['type'] = $select;
         }
         if (!empty($cStartTime)) {
             $startTime = strtotime($cStartTime . '00:00:00');
             $paramArr['addTime_start'] = $startTime;
         }
         if (!empty($cEndTime)) {
             $endTime = strtotime($cEndTime . '23:59:59');
             $paramArr['addTime_end'] = $endTime;
         }
         if (!empty($eStartTime)) {
             $startTime = strtotime($eStartTime . '00:00:00');
             $paramArr['auditTime_start'] = $startTime;
         }
         if (!empty($eEndTime)) {
             $endTime = strtotime($eEndTime . '23:59:59');
             $paramArr['auditTime_end'] = $endTime;
         }
     }
     $purchase_order = UserCacheModel::callOpenSystem($paramArr);
     $total = $purchase_order[0];
     $whRecManageList = $purchase_order[1];
     if (!empty($whRecManageList)) {
         $usermodel = UserModel::getInstance();
         $count = count($whRecManageList);
         for ($i = 0; $i < $count; $i++) {
             //仓库
             $storeId = empty($whRecManageList[$i]['warehouse_id']) ? 1 : $whRecManageList[$i]['warehouse_id'];
             $whName_info = WarehouseManagementModel::warehouseManagementModelList("where companyId=1 and id={$storeId}");
             $whRecManageList[$i]['whName'] = $whName_info[0]['whName'];
             $purchaseuser_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$whRecManageList[$i]['purchaseuser_id']}'", '', 'limit 1');
             $inventory_info[$i]['purchaseuser'] = $purchaseuser_info[0]['global_user_name'];
         }
     }
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     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));
     }
     $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '收货管理表'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', '收货管理表');
     $this->smarty->assign('toplevel', 0);
     $this->smarty->assign('secondlevel', '09');
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('status', $status);
     $this->smarty->assign('whRecManageList', $whRecManageList);
     //循环列表
     $this->smarty->display("whRecManageList.htm");
 }
示例#22
0
$excel = new ExportDataExcel('file', 'priceInfo_' . date('Y-n-j') . '_' . date('Y-n-j') . '.xls');
//实例化excel类
$excel->initialize();
$tharr = array('主料号', '料号', '产品描述', '现行单价', '采购', '产品重量', '仓位号', '实际库存', '产品类别', '存货位', '成本核算价');
$excel->addRow($tharr);
foreach ($exportSql as $priceInfo) {
    $spu = $priceInfo['spu'];
    //主料号
    $sku = $priceInfo['sku'];
    //料号
    $goodsName = $priceInfo['goodsName'];
    //产品描述
    $goodsCost = $priceInfo['goodsCost'];
    //现行单价
    //获取采购人名称
    $usermodel = UserModel::getInstance();
    $whereStr = "where a.global_user_id=" . $priceInfo['purchaseId'];
    $cgUser = $usermodel->getGlobalUserLists('global_user_name', $whereStr, '', '');
    //$cgUser[0]['global_user_name'];
    $purchase = $cgUser['0']['global_user_name'];
    $weight = $priceInfo['goodsWeight'];
    //产品重量
    $pName = $priceInfo['pName'];
    //仓位号
    $nums = $priceInfo['nums'];
    //实际库存
    //产品分类
    $goodsCategory = $priceInfo['goodsCategory'] ? getGoodsCategory($priceInfo['goodsCategory']) : '无';
    $type = $priceInfo['type'] == 1 ? '可以配货' : '不能配货';
    $checkCost = $priceInfo['checkCost'];
    $tdarr = array($spu, $sku, $goodsName, $goodsCost, $purchase, $weight, $pName, $nums, $goodsCategory, $type, $checkCost);
示例#23
0
 public static function getLoginUserInfo($jobNo)
 {
     $usermodel = UserModel::getInstance();
     $userInfo = $usermodel->getGlobalUserLists('global_user_id,global_user_name,global_user_login_name', " where a.global_user_job_no='{$jobNo}'", '', '');
     return $userInfo;
 }
示例#24
0
 /**
  * 导出
  */
 public function view_export()
 {
     $where = '';
     $idStr = $_GET['idArr'];
     if (!empty($idStr)) {
         $where .= ' and pp.id in (' . $idStr . ')';
     }
     $field = " pp.id,pp.companyName,pp.companyType,pp.contactPerson,pp.expiration,pp.status,pp.is_delete,\n\t\t\t\tpp.addTime,pp.modifyTime,pp.addUserId,pp.modifyUserId ";
     $result = AgreementModel::getData($where, $field);
     if (empty($result)) {
         die("无数据");
     }
     $companyTypeList = array('1' => '企业法人', '2' => '个体经营');
     $statusList = array('1' => '正常', '2' => '限制');
     require_once WEB_PATH . "lib/PHPExcel.php";
     $objPHPExcel = new PHPExcel();
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', '公司名称');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B1', '公司类型');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C1', '联系人');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D1', '协议到期时间');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E1', '状态');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F1', '是否删除');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('G1', '添加时间');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('H1', '添加人');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I1', '修改时间');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J1', '修改人');
     $a = 2;
     $userModel = UserModel::getInstance();
     foreach ($result as $key => $val) {
         $companyType = $companyTypeList[$val['companyType']];
         $status = $statusList[$val['status']];
         $is_delete = $val['is_delete'] == 1 ? '是' : '否';
         $where = "where a.global_user_id='{$val['addUserId']}'";
         $userinfo = $userModel->getGlobalUserLists('a.global_user_name', $where, '', 'limit 1');
         $addUser = $userinfo[0]['global_user_name'];
         $modifyTime = '';
         $modifyUser = '';
         if ($val['modifyTime']) {
             $modifyTime = date('Y-m-d H:i', strtotime($val['modifyTime']));
             $where = "where a.global_user_id='{$val['modifyUserId']}'";
             $userinfo = $userModel->getGlobalUserLists('a.global_user_name', $where, '', 'limit 1');
             $modifyUser = $userinfo[0]['global_user_name'];
         }
         $objPHPExcel->setActiveSheetIndex(0)->getCell('A' . $a)->setValueExplicit($val['companyName'], PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('B' . $a)->setValueExplicit($companyType, PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('C' . $a)->setValueExplicit($val['contactPerson'], PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('D' . $a)->setValueExplicit(date('Y-m-d', strtotime($val['expiration'])), PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('E' . $a)->setValueExplicit($status, PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('F' . $a)->setValueExplicit($is_delete, PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('G' . $a)->setValueExplicit(date('Y-m-d H:i', strtotime($val['addTime'])), PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('H' . $a)->setValueExplicit($addUser, PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('I' . $a)->setValueExplicit($modifyTime, PHPExcel_Cell_DataType::TYPE_STRING);
         $objPHPExcel->setActiveSheetIndex(0)->getCell('J' . $a)->setValueExplicit($modifyUser, PHPExcel_Cell_DataType::TYPE_STRING);
         $a++;
     }
     $objPHPExcel->getActiveSheet(0)->getStyle('A1:R500')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('A')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('B')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('C')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('D')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('E')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('F')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('G')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('H')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('I')->setWidth(20);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('J')->setWidth(20);
     $title = "AgreementInfo" . date('Y-m-d');
     $titlename = "AgreementInfo" . date('Y-m-d') . ".xls";
     $objPHPExcel->getActiveSheet()->setTitle($title);
     $objPHPExcel->setActiveSheetIndex(0);
     // Redirect output to a client’s web browser (Excel5)
     header('Content-Type: application/vnd.ms-excel');
     header("Content-Disposition: attachment;filename={$titlename}");
     header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     $objWriter->save('php://output');
 }
示例#25
0
 public function view_printLabelList()
 {
     $storeId = intval(trim($_GET['storeId']));
     $storeId = $storeId ? $storeId : 1;
     $navlist = array(array('url' => '', 'title' => '入库'), array('url' => 'index.php?mod=printLabel&act=printLabel&storeId=' . $storeId, 'title' => '打标操作'), array('url' => '', 'title' => '打标清单'));
     $toplevel = 1;
     $secondlevel = $storeId == 1 ? 12 : 19;
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toplevel', $toplevel);
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('storeId', $storeId);
     $checkUser = isset($_GET['checkUser']) ? $_GET['checkUser'] : "";
     $sku = isset($_GET['sku']) ? $_GET['sku'] : "";
     $start = isset($_GET['start']) ? $_GET['start'] : "";
     $end = isset($_GET['end']) ? $_GET['end'] : "";
     if (empty($checkUser) && empty($sku) && empty($start) && empty($end)) {
         $where = "";
     } else {
         if (!empty($checkUser)) {
             $where[] = "printerId='{$checkUser}'";
             $this->smarty->assign("checkUser", $checkUser);
         }
         if (!empty($sku)) {
             $where[] = "sku = '{$sku}'";
             $this->smarty->assign("sku", $sku);
         }
         if (!empty($start) && !empty($end)) {
             $starttime = strtotime($start . " 00:00:00");
             $endtime = strtotime($start . " 23:59:59");
             $where[] = "(entryTime between {$starttime} and {$endtime})";
             $this->smarty->assign("start", $start);
             $this->smarty->assign("end", $end);
         } elseif (!empty($start) && empty($end)) {
             $starttime = strtotime($start . " 00:00:00");
             $where[] = "entryTime >{$starttime}";
             $this->smarty->assign("start", $start);
         } elseif (empty($start) && !empty($end)) {
             $endtime = strtotime($start . " 23:59:59");
             $where[] = "entryTime < {$endtime}";
             $this->smarty->assign("end", $end);
         }
         $where = " AND " . implode(" AND ", $where);
         //$where = "where ".$where;
     }
     $where = "where printerId IS NOT NULL and is_delete=0" . $where . " and storeId = '{$storeId}' order by id desc";
     $pagesize = 20;
     //$lists = packageCheckModel::selectList($where);
     //$nums = count($lists);
     $nums = packageCheckModel::getTotalNums($where);
     $pager = new Page($nums, $pagesize);
     $lists = packageCheckModel::selectList($where . " " . $pager->limit);
     if ($nums > $pagesize) {
         //分页
         $pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $pager->fpage(array(0, 2, 3));
     }
     $usermodel = UserModel::getInstance();
     //打标员
     $Marking_user = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=168", '', '');
     $this->smarty->assign('Marking_user', $Marking_user);
     foreach ($lists as $key => $list) {
         //到货库存
         $sku_arrival = OmAvailableModel::getTNameList("wh_sku_location", "arrivalInventory", "where sku='{$list['sku']}'");
         $lists[$key]['arrivalInventory'] = $sku_arrival[0]['arrivalInventory'];
     }
     $this->smarty->assign('pagestr', $pagestr);
     $this->smarty->assign("lists", $lists);
     $toptitle = '打标清单列表';
     //顶部链接
     $this->smarty->assign('toptitle', $toptitle);
     $userList = packageCheckModel::selectUser();
     $this->smarty->display('printLabelList.htm');
 }
示例#26
0
 public function view_abnormal()
 {
     $storeId = intval(trim($_GET['storeId']));
     $storeId = $storeId ? $storeId : 1;
     //仓库ID
     $navlist = array(array('url' => '', 'title' => '入库'), array('url' => 'index.php?mod=packageCheck&act=packageCheck&storeId=' . $storeId, 'title' => '点货操作'), array('url' => '', 'title' => '异常录入'));
     $toplevel = 1;
     $secondlevel = $storeId == 1 ? "11" : 18;
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toplevel', $toplevel);
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('storeId', $storeId);
     $checkUser = isset($_GET['checkUser']) ? $_GET['checkUser'] : "";
     $status = isset($_GET['status']) ? $_GET['status'] : 1;
     $sku = isset($_GET['sku']) ? $_GET['sku'] : "";
     $start = isset($_GET['start']) ? $_GET['start'] : "";
     $end = isset($_GET['end']) ? $_GET['end'] : "";
     $where[] = "entryStatus='{$status}'";
     $this->smarty->assign("status", $status);
     if (!empty($checkUser)) {
         $where[] = "tallyUserId='{$checkUser}'";
         $this->smarty->assign("checkUser", $checkUser);
     }
     if (!empty($sku)) {
         $where[] = "sku = '{$sku}'";
         $this->smarty->assign("sku", $sku);
     }
     if (!empty($start)) {
         $start_time = strtotime($start . " 00:00:00");
         $where[] = "entryTime >={$start_time}";
         $this->smarty->assign("start", $start);
     }
     if (!empty($end)) {
         $end_time = strtotime($end . " 23:59:59");
         $where[] = "entryTime <={$end_time}";
         $this->smarty->assign("end", $end);
     }
     $where = " AND " . implode(" AND ", $where);
     $where = "where is_delete=0 and entryStatus!=0" . $where;
     $where .= " and storeId ='{$storeId}'";
     $pagesize = 200;
     //print_r($where);exit;
     $lists = packageCheckModel::selectList($where);
     $nums = count($lists);
     $pager = new Page($nums, $pagesize);
     $lists = packageCheckModel::selectList($where . " " . $pager->limit);
     if ($nums > $pagesize) {
         //分页
         $pagestr = $pager->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $pager->fpage(array(0, 2, 3));
     }
     $usermodel = UserModel::getInstance();
     //点货员
     $Marking_user = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=209", '', '');
     $this->smarty->assign('Marking_user', $Marking_user);
     $toptitle = '异常录入';
     //顶部链接
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('pagestr', $pagestr);
     $this->smarty->assign("lists", $lists);
     $userList = packageCheckModel::selectUser();
     $this->smarty->display('abnormal.htm');
 }
示例#27
0
 public function view_internalUseIostoreList()
 {
     //基础代码准备
     $InternalIoSellManagement = new InternalIoSellManagementAct();
     //搜索操作
     $condition = array();
     $ordersn = "";
     $choose_status = 0;
     $ioStatus = 0;
     $startTime = date("Y-m-d 00:00:00", time());
     $endTime = date("Y-m-d 23:59:59", time());
     if (isset($_POST) && !empty($_POST)) {
         $ordersn = trim($_POST['ordersnInput']);
         //单据号
         $ioTypeinvoiceChoose = $_POST['ioTypeinvoiceChoose'];
         //出入库单类型
         $ioStatus = $_POST['ioStatus'];
         //审核状态
         if (!empty($_POST['startTime']) && !empty($_POST['endTime'])) {
             $startTime = strtotime(trim($_POST['startTime']));
             //开始时间
             $endTime = strtotime(trim($_POST['endTime']));
             //结束时间
             $condition[] = "createdTime BETWEEN {$startTime} AND {$endTime}";
             $startTime = trim($_POST['startTime']);
             //开始时间
             $endTime = trim($_POST['endTime']);
             //结束时间
         } else {
             $condition[] = "createdTime BETWEEN " . strtotime($startTime) . " and " . strtotime($endTime);
         }
         if (!empty($ordersn)) {
             $condition[] = "ordersn = '{$ordersn}'";
         }
         if (!empty($ioTypeinvoiceChoose)) {
             $condition[] = "invoiceTypeId = '{$ioTypeinvoiceChoose}'";
             $choose_status = $ioTypeinvoiceChoose;
         } else {
             $condition[] = "invoiceTypeId in (1,2,3,4,5)";
         }
         if (!empty($ioStatus)) {
             $condition[] = "ioStatus = '{$ioStatus}'";
         }
         $this->where = "WHERE " . implode(" and ", $condition) . " and is_delete = 0 ";
     } else {
         //默认显示列表条件 invoiceTypeId in (1,2,3,4,5) 内部使用5种类型
         $this->where = "WHERE invoiceTypeId in (1,2,3,4,5) and createdTime BETWEEN " . strtotime($startTime) . " and " . strtotime($endTime) . " and is_delete = 0 ";
     }
     /*/分页
     		$total = $InternalIoSellManagement->act_getPageNum($this->where);
     		$num      = 5;//每页显示的个数
     		$page     = new Page($total,$num,'','CN');
     		$this->where    .= " order by id desc ".$page->limit;
     		*/
     //单据表
     $iostoreArr = $InternalIoSellManagement->act_iostoreList($this->where);
     /*
     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->where = " where groupId = 1";
     //内部使用分组单据类型
     $invoiceTypeArr = $InternalIoSellManagement->act_invoiceTypeList($this->where);
     $invoiceNameArr = array();
     //出入库单据类型
     foreach ($invoiceTypeArr as $invoiceName) {
         $invoiceNameArr[$invoiceName['id']] = $invoiceName['invoiceName'];
     }
     //付款方式
     $payMethods = array();
     $paymentMethodsArr = $InternalIoSellManagement->act_changeCategoriesSkip();
     foreach ($paymentMethodsArr as $payValue) {
         $payMethods[$payValue['id']] = $payValue['method'];
     }
     //单据明细
     $iostoreDetails = array();
     $iostoreDetailNum = array();
     //合计件数
     $iostoreDetailDue = array();
     //应付款总金额
     if (!empty($iostoreArr)) {
         foreach ($iostoreArr as $ioId) {
             $this->where = " where iostoreId = " . $ioId['id'];
             $iostoredetailArr = $InternalIoSellManagement->act_iostoredetailList($this->where);
             if (empty($iostoredetailArr)) {
                 continue;
             }
             $sumNum = 0;
             $due = 0;
             foreach ($iostoredetailArr as $keyId => $ioNumInfo) {
                 $sumNum += $ioNumInfo['amount'];
                 $due += $ioNumInfo['cost'] * $ioNumInfo['amount'];
                 //仓位ID转换
                 $whereStr = " WHERE is_enable = 1 and type = 1 and id = {$ioNumInfo['positionId']}";
                 $iostoredetailArr[$keyId]['positionId'] = $InternalIoSellManagement->act_positionIdToName($whereStr);
                 //采购ID转换
                 $usermodel = UserModel::getInstance();
                 $whereStr = "where a.global_user_id=" . $ioNumInfo['purchaseId'];
                 $cgUser = $usermodel->getGlobalUserLists('global_user_name', $whereStr, '', '');
                 //$cgUser[0]['global_user_name'];
                 $iostoredetailArr[$keyId]['purchaseId'] = $cgUser[0]['global_user_name'];
             }
             $iostoreDetailNum[$ioId['id']] = $sumNum;
             $iostoreDetailDue[$ioId['id']] = $due;
             $iostoreDetails[$ioId['id']] = $iostoredetailArr;
         }
     }
     if (!empty($iostoreArr)) {
         $usermodel = UserModel::getInstance();
         //申请人
         $count = count($iostoreArr);
         for ($i = 0; $i < $count; $i++) {
             $user_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$iostoreArr[$i]['userId']}'", '', 'limit 1');
             $iostoreArr[$i]['userName'] = $user_info[0]['global_user_name'];
             $user_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$iostoreArr[$i]['operatorId']}'", '', 'limit 1');
             $iostoreArr[$i]['operatorName'] = $user_info[0]['global_user_name'];
         }
     }
     $this->smarty->assign('toplevel', 3);
     $this->smarty->assign('secondlevel', 31);
     $this->smarty->assign('ordersn', $ordersn);
     $this->smarty->assign('choose_status', $choose_status);
     $this->smarty->assign('ioStatus', $ioStatus);
     $this->smarty->assign('startTime', $startTime);
     $this->smarty->assign('endTime', $endTime);
     $this->smarty->assign('iostoreDetailNum', $iostoreDetailNum);
     $this->smarty->assign('iostoreDetailDue', $iostoreDetailDue);
     $this->smarty->assign('iostoreDetails', $iostoreDetails);
     $this->smarty->assign('payMethods', $payMethods);
     $this->smarty->assign('invoiceNameArr', $invoiceNameArr);
     if (empty($iostoreArr)) {
         $this->smarty->assign('iostoreArr', null);
     } else {
         $this->smarty->assign('iostoreArr', $iostoreArr);
     }
     $navlist = array(array('url' => 'index.php?mod=internalIoSell&act=internalUseIostoreList', 'title' => '单据业务'), array('url' => 'index.php?mod=internalIoSell&act=internalUseIostoreList', 'title' => '内部使用'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('internalUseIostoreList.htm');
 }
示例#28
0
 function act_search_order_pick($orderid)
 {
     if (empty($orderid)) {
         return '请输入发货单号';
     }
     $orderid = trim($orderid);
     $result = OmAvailableModel::getTNameList("wh_wave_pick_record ", "*", "where shipOrderId ='{$orderid}'  and is_delete =0");
     if (empty($result)) {
         $show = '没有找到该发货单的分拣信息';
         return $show;
     }
     //  $shipping_relation = OmAvailableModel::getTNameList("wh_wave_shipping_relation ","*","where shipOrderId ='$orderid'  and is_delete =0");
     $show = '发货单号为' . $orderid . '的分拣信息为<br />';
     $waveId_array = array();
     foreach ($result as $val) {
         if (in_array($val['waveId'], $waveId_array)) {
             continue;
         } else {
             $waveId_array[] = $val['waveId'];
         }
     }
     $waveId = implode(',', $waveId_array);
     $usermodel = UserModel::getInstance();
     $iqc_user = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id={$result[0]['pickUserId']}");
     $op_name = $iqc_user[0]['global_user_name'];
     foreach ($result as $value) {
         if ($value['pickStatus'] == 0) {
             $status_SKU = '未分拣完成';
         } else {
             if ($value['pickStatus'] == 1) {
                 $status_SKU = '分拣完成';
             } else {
                 $status_SKU = '手动完结分拣完成';
             }
         }
         $dataTime = empty($value['pickTime']) ? '' : date('Y-m-d H:i:s', $value['pickTime']);
         $show .= '配货单为' . $waveId . ',sku料号为' . $value['sku'] . ',需要分拣的料号数量是' . $value['skuAmount'] . '已经分拣的数量为' . $value['amount'] . ',分拣状态为' . $status_SKU . ',分拣人是' . $op_name . ',分拣时间为' . $dataTime . '<br />';
     }
     return $show;
 }
示例#29
0
 /**
  * UserAct::act_delete()
  * 删除用户act
  * @return bool
  */
 public function act_delete()
 {
     $userid = intval($_POST['userid']);
     if (!$userid) {
         return false;
         exit;
     }
     $usersingle = UserModel::getInstance();
     $filed = ' a.user_token';
     $where = " WHERE a.user_id='{$userid}' ";
     $userinfo = $usersingle->getUserInfo($filed, $where);
     $userToken = $userinfo["user_token"];
     $result = UserModel::userDelete($userToken);
     return $result;
 }
示例#30
0
文件: Auth.php 项目: paveli/Tweeem
 /**
  * Получить данные из cookie аутентификации
  *
  * @return mixed Если cookie нет, или там кривые данные возвращается FALSE
  */
 public function getCookieData()
 {
     if (($hash = Open_Input::getInstance()->cookie(self::COOKIE_NAME)) === FALSE || ($data = UserModel::getInstance()->hashDecode($hash)) === FALSE) {
         return FALSE;
     }
     return $data;
 }