コード例 #1
0
ファイル: statusMenu.view.php プロジェクト: ohjack/newErp
 public function view_sureAddMenu()
 {
     $StatusMenuAct = new StatusMenuAct();
     $is_ok = $StatusMenuAct->act_sureAddMenu();
     if ($is_ok) {
         if ($is_ok == 2) {
             $state = '流程已存在';
         } else {
             $state = '操作成功';
         }
     } else {
         $state = '操作失败';
     }
     header('location:index.php?mod=StatusMenu&act=statusMenu&state=' . $state);
     exit;
 }
コード例 #2
0
ファイル: abnormalStock.view.php プロジェクト: ohjack/newErp
 public function view_abnormalStockList()
 {
     global $memc_obj;
     $pagesize = 200;
     //页面大小
     //var_dump($AbOrderList); exit;
     $omAvailableAct = new OmAvailableAct();
     $TransAPIAct = new TransAPIAct();
     $OrderindexAct = new OrderindexAct();
     $GoodsAct = new GoodsAct();
     $OrderRefundAct = new OrderRefundAct();
     //平台信息
     $OmAccountAct = new OmAccountAct();
     $WarehouseAPIAct = new WarehouseAPIAct();
     $AbOrderList = $WarehouseAPIAct->act_getAbOrderList();
     //var_dump($AbOrderList); exit;
     $AbOrderListArr = array();
     $AbOrderids = array();
     $AbOrderShow = array();
     foreach ($AbOrderList as $orderId) {
         $AbOrderInfo = $WarehouseAPIAct->act_getAbOrderInfo($orderId['id']);
         $AbOrderListArr[$orderId['originOrderId']] = $AbOrderInfo;
         $AbOrderids[] = $orderId['originOrderId'];
         $AbOrderShow[$orderId['originOrderId']] = $orderId['id'];
     }
     //var_dump($AbOrderListArr); exit;
     $this->smarty->assign('AbOrderListArr', $AbOrderListArr);
     $this->smarty->assign('AbOrderShow', $AbOrderShow);
     //var_dump($AbOrderListArr); exit;
     $platform = $OmAccountAct->act_getPlatformListByPower();
     $this->smarty->assign('platform', $platform);
     $account = $OmAccountAct->act_accountAllListById();
     //账号信息
     /**导航 start**/
     $ostatus = isset($_GET['ostatus']) ? $_GET['ostatus'] : 0;
     $this->smarty->assign('ostatus', 770);
     $StatusMenuAct = new StatusMenuAct();
     $ostatusList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = 0 AND is_delete=0');
     //var_dump($ostatusList);
     $this->smarty->assign('ostatusList', $ostatusList);
     //二级目录
     /*$o_secondlevel =  $omAvailableAct->act_getTNameList('om_status_menu','*','WHERE is_delete=0 and groupId=0 order by sort asc');
     		$this->smarty->assign('o_secondlevel', $o_secondlevel);*/
     $second_count = array();
     $second_type = array();
     foreach ($ostatusList as $o_secondinfo) {
         $orderStatus = $o_secondinfo['statusCode'];
         //echo $orderStatus."============"; echo "<br>";
         $s_total = $OrderindexAct->act_showSearchOrderNum($orderStatus);
         //echo $orderStatus."==".$s_total; echo "<br>";
         $second_count[$o_secondinfo['statusCode']] = $s_total;
         $s_type = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $orderStatus . '" AND is_delete=0 order by sort asc');
         $second_type[$orderStatus] = $s_type[0]['statusCode'];
     }
     $this->smarty->assign('second_count', $second_count);
     $this->smarty->assign('second_type', $second_type);
     //退款数量
     $where = " WHERE is_delete=0 ";
     $accountList = $_SESSION['accountList'];
     $platformList = $_SESSION['platformList'];
     //echo "<pre>"; print_r($accountList); exit;
     $platformsee = array();
     for ($i = 0; $i < count($platformList); $i++) {
         $platformsee[] = $platformList[$i];
     }
     if ($platformsee) {
         $where .= ' AND platformId IN (' . join(",", $platformsee) . ') ';
     } else {
         //$where .= " AND 1=2 ";
     }
     $accountsee = array();
     for ($i = 0; $i < count($accountList); $i++) {
         $accountsee[] = $accountList[$i];
     }
     if ($accountsee) {
         $where .= ' AND accountId IN (' . join(",", $accountsee) . ') ';
     } else {
         //$where .= " AND 1=2 ";
     }
     //if($where){
     //$refund_total = $omAvailableAct->act_getTNameCount("om_order_refund"," where is_delete=0 ");
     $refund_total = $OrderRefundAct->act_getRecordNums();
     //}else{
     //$refund_total = 0;
     //}
     $this->smarty->assign('refund_total', $refund_total);
     //三级目录
     /*$refund_one = $omAvailableAct->act_getTNameCount("om_order_refund"," where is_delete=0 and status=0");
     		$this->smarty->assign('refund_one', $refund_one);
     		$refund_two = $omAvailableAct->act_getTNameCount("om_order_refund"," where is_delete=0 and status=1");
     		$this->smarty->assign('refund_two', $refund_two);
     		$refund_three = $omAvailableAct->act_getTNameCount("om_order_refund"," where is_delete=0 and status=2");
     		$this->smarty->assign('refund_three', $refund_three);*/
     /**导航 end**/
     $toptitle = '异常缺货统计页面';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 0);
     $threelevel = '1';
     //当前的三级菜单
     $this->smarty->assign('threelevel', $threelevel);
     $statusMenu = $omAvailableAct->act_getTNameList('om_status_menu', ' * ', 'WHERE is_delete=0');
     $this->smarty->assign('statusMenu', $statusMenu);
     /* $where =	' WHERE is_delete = 0 '.$where;
        $total = $omAvailableAct->act_getTNameCount('om_order_refund', $where);*/
     $parameterArr = array();
     $parameterArr['AbOrderList'] = $AbOrderids;
     $total = $OrderindexAct->act_showABOrder($ostatus, $otype, '', $parameterArr);
     $this->smarty->assign('abnormal_total', $total);
     //echo $total; exit;
     $num = $pagesize;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     //$limit	=	$page->limit;
     //var_dump($parameterArr);
     $omOrderList = $OrderindexAct->act_showABOrder($ostatus, $otype, $page->limit, $parameterArr);
     $this->smarty->assign('omOrderList', $omOrderList);
     $pm = $GoodsAct->act_getMaterInfoByList();
     $transportationList = $TransAPIAct->act_getCarrierListById();
     $this->smarty->assign('transportationList', $transportationList);
     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));
     }
     //获取系统所有状态
     //$statusList = copyOrderModel::selectStatusList();
     //var_dump($statusList); exit;
     //$this->smarty->assign('statusList', $statusList);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('account', $account);
     //$this->smarty->assign('sku', $sku);
     $this->smarty->assign('pm', $pm);
     $this->smarty->assign('omOrderList', $omOrderList);
     $this->smarty->display('orderindex.htm');
 }
コード例 #3
0
ファイル: orderModify.view.php プロジェクト: ohjack/newErp
 public function view_modifyOrderList()
 {
     global $memc_obj;
     $sysUserId = $_SESSION['sysUserId'];
     $modify_showerrorinfo = '';
     $OrderModifyAct = new OrderModifyAct();
     $OrderindexAct = new OrderindexAct();
     $UserCompetenceAct = new UserCompetenceAct();
     //var_dump($_GET); exit;
     if (isset($_GET) && !empty($_GET)) {
         $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
         $ostatus = isset($_GET['edit_ostatus']) ? $_GET['edit_ostatus'] : $_GET['ostatus'];
         $otype = isset($_GET['edit_otype']) ? $_GET['edit_otype'] : $_GET['otype'];
     }
     if (isset($_POST) && !empty($_POST)) {
         //var_dump($_POST); echo "<br>"; exit;
         $orderid = isset($_POST['orderid']) ? $_POST['orderid'] : '';
         $ostatus = isset($_POST['edit_ostatus']) ? $_POST['edit_ostatus'] : $_POST['ostatus'];
         $otype = isset($_POST['edit_otype']) ? $_POST['edit_otype'] : $_POST['otype'];
         $update_order = array();
         $update_userinfo = array();
         $update_tracknumber = array();
         //$orderid = $_POST['orderid'];
         //var_dump($_POST); exit;
         $updatestatus = false;
         if ($_POST['action'] == 'addDetail') {
             //var_dump($_GET); echo "<br>"; exit;
             $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
             $ostatus = isset($_GET['edit_ostatus']) ? $_GET['edit_ostatus'] : $_GET['ostatus'];
             $otype = isset($_GET['edit_otype']) ? $_GET['edit_otype'] : $_GET['otype'];
             if ($OrderModifyAct->act_batchAdd($orderid, $_POST)) {
                 $modify_showerrorinfo = "<font color='green'>添加成功</font>";
             } else {
                 $modify_showerrorinfo = "<font color='red'>添加失败</font>";
             }
         } else {
             if ($_POST['action'] == 'addNote') {
                 //var_dump($_GET); echo "<br>"; exit;
                 $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
                 $ostatus = isset($_GET['edit_ostatus']) ? $_GET['edit_ostatus'] : $_GET['ostatus'];
                 $otype = isset($_GET['edit_otype']) ? $_GET['edit_otype'] : $_GET['otype'];
                 if ($OrderModifyAct->act_addNote($orderid, $_POST)) {
                     $modify_showerrorinfo = "<font color='green'>添加成功</font>";
                 } else {
                     $modify_showerrorinfo = "<font color='red'>添加失败</font>";
                 }
             } else {
                 $visible_movefolder = $UserCompetenceAct->act_getInStatusIds($_POST['otype'], $sysUserId);
                 if (!in_array($_POST['edit_otype'], $visible_movefolder)) {
                     $modify_showerrorinfo = "<font color='red'>您没有改变订单状态的权限</font>";
                 } else {
                     if ($_POST['username'] != $_POST['edit_username']) {
                         $update_userinfo['username'] = $_POST['edit_username'];
                     }
                     if ($_POST['ostatus'] != $_POST['edit_ostatus']) {
                         $update_order['orderStatus'] = $_POST['edit_ostatus'];
                     }
                     if ($_POST['otype'] != $_POST['edit_otype']) {
                         $update_order['orderType'] = $_POST['edit_otype'];
                         $updatestatus = true;
                     }
                     if ($_POST['street'] != $_POST['edit_street']) {
                         $update_userinfo['street'] = $_POST['edit_street'];
                     }
                     if ($_POST['platformUsername'] != $_POST['edit_platformUsername']) {
                         $update_userinfo['platformUsername'] = $_POST['edit_platformUsername'];
                     }
                     if ($_POST['address2'] != $_POST['edit_address2']) {
                         $update_userinfo['address2'] = $_POST['edit_address2'];
                     }
                     if ($_POST['actualShipping'] != $_POST['edit_actualShipping']) {
                         $update_order['actualShipping'] = $_POST['edit_actualShipping'];
                     }
                     if ($_POST['city'] != $_POST['edit_city']) {
                         $update_userinfo['city'] = $_POST['edit_city'];
                     }
                     if ($_POST['state'] != $_POST['edit_state']) {
                         $update_userinfo['state'] = $_POST['edit_state'];
                     }
                     if ($_POST['countryName'] != $_POST['edit_countryName']) {
                         $update_userinfo['countryName'] = $_POST['edit_countryName'];
                     }
                     if ($_POST['zipCode'] != $_POST['edit_zipCode']) {
                         $update_userinfo['zipCode'] = $_POST['edit_zipCode'];
                     }
                     if ($_POST['landline'] != $_POST['edit_landline']) {
                         $update_userinfo['landline'] = $_POST['edit_landline'];
                     }
                     if ($_POST['phone'] != $_POST['edit_phone']) {
                         $update_userinfo['phone'] = $_POST['edit_phone'];
                     }
                     if ($_POST['transportId'] != $_POST['edit_transportId']) {
                         $update_order['transportId'] = $_POST['edit_transportId'];
                     }
                     if ($_POST['edit_tracknumber']) {
                         $update_tracknumber['omOrderId'] = $orderid;
                         $update_tracknumber['tracknumber'] = $_POST['edit_tracknumber'];
                         $update_tracknumber['addUser'] = $sysUserId;
                         $update_tracknumber['createdTime'] = time();
                         //var_dump($update_tracknumber); exit;
                     }
                     BaseModel::begin();
                     //开始事务
                     if ($update_order) {
                         //$sql = "UPDATE om_unshipped_order set ".array2sql($update_order)." WHERE id = ".$orderid;
                         //$msg = OrderLogModel::orderLog($orderid,$update_order['orderStatus'],$update_order['orderType'],$sql);
                         if (OrderindexModel::updateOrder('om_unshipped_order', $update_order, ' WHERE id = ' . $orderid)) {
                             if ($updatestatus) {
                                 $ProductStatus = new ProductStatus();
                                 if (!$ProductStatus->updateSkuStatusByOrderStatus(array($orderid), $batch_ostatus_val, $batch_otype_val)) {
                                     BaseModel::rollback();
                                 }
                             }
                             $modify_showerrorinfo = "<font color='green'>更新成功</font>";
                         } else {
                             $modify_showerrorinfo = "<font color='red'>更新失败</font>";
                             BaseModel::rollback();
                         }
                     }
                     if ($update_userinfo) {
                         //var_dump($update_userinfo);
                         if (OrderindexModel::updateOrder('om_unshipped_order_userInfo', $update_userinfo, ' WHERE omOrderId = ' . $orderid)) {
                             $modify_showerrorinfo = "<font color='green'>更新成功</font>";
                         } else {
                             $modify_showerrorinfo = "<font color='red'>更新失败</font>";
                             BaseModel::rollback();
                         }
                     }
                     if ($update_tracknumber) {
                         //echo $msg;
                         if (!OrderAddModel::insertOrderTrackRow($update_tracknumber)) {
                             /*self :: $errCode = "001";
                             		self :: $errMsg =  "跟踪号插入失败";
                             		return false;*/
                             $modify_showerrorinfo = "<font color='red'>跟踪号插入失败</font>";
                             BaseModel::rollback();
                         }
                     }
                     BaseModel::commit();
                     BaseModel::autoCommit();
                 }
             }
         }
     }
     $this->smarty->assign('modify_showerrorinfo', $modify_showerrorinfo);
     $omAvailableAct = new OmAvailableAct();
     //平台信息
     $platform = $omAvailableAct->act_getTNameList('om_platform', 'id,platform', 'WHERE is_delete=0');
     //var_dump($platform);
     $platformList = array();
     foreach ($platform as $v) {
         $platformList[$v['id']] = $v['platform'];
     }
     $this->smarty->assign('platformList', $platformList);
     /**导航 start**/
     $this->smarty->assign('ostatus', $ostatus);
     $this->smarty->assign('otype', $otype);
     //二级目录
     $StatusMenuAct = new StatusMenuAct();
     $ostatusList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = 0 AND is_delete=0');
     //var_dump($ostatusList);
     $this->smarty->assign('ostatusList', $ostatusList);
     $otypeList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $ostatus . '" AND is_delete=0');
     //var_dump($otypeList);
     $this->smarty->assign('otypeList', $otypeList);
     /*$o_secondlevel =  $omAvailableAct->act_getTNameList('om_status_menu','*','WHERE is_delete=0 and groupId=0 order by sort asc');
     		$this->smarty->assign('o_secondlevel', $o_secondlevel);*/
     $second_count = array();
     $second_type = array();
     foreach ($ostatusList as $o_secondinfo) {
         $orderStatus = $o_secondinfo['statusCode'];
         /*$accountacc = $_SESSION['accountacc'];
         		$oc_where = " where orderStatus='$orderStatus' ";
         		if($accountacc){
         			$oc_where .= ' AND ('.$accountacc.') ';
         		}*/
         $s_total = $OrderindexAct->act_showSearchOrderNum($orderStatus);
         //$s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", $oc_where);
         $second_count[$o_secondinfo['statusCode']] = $s_total;
         $s_type = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$orderStatus}' order by sort asc");
         $second_type[$o_secondinfo['statusCode']] = $s_type[0]['statusCode'];
     }
     //var_dump($second_count);
     $this->smarty->assign('second_count', $second_count);
     $this->smarty->assign('second_type', $second_type);
     //退款数量
     $refund_total = $omAvailableAct->act_getTNameCount("om_order_refund", " where is_delete=0");
     $this->smarty->assign('refund_total', $refund_total);
     //三级目录
     $o_threelevel = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$ostatus}' order by sort asc");
     $this->smarty->assign('o_threelevel', $o_threelevel);
     $three_count = array();
     foreach ($o_threelevel as $o_threeinfo) {
         $orderType = $o_threeinfo['statusCode'];
         $s_total = $OrderindexAct->act_showSearchOrderNum($ostatus, $orderType);
         //$s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order"," where orderStatus='$ostatus' and orderType='$orderType' and storeId=1 and is_delete=0");
         $three_count[$o_threeinfo['statusCode']] = $s_total;
     }
     $this->smarty->assign('three_count', $three_count);
     $toptitle = '订单显示页面';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 0);
     $threelevel = '1';
     //当前的三级菜单
     $this->smarty->assign('threelevel', $threelevel);
     $statusMenu = $omAvailableAct->act_getTNameList('om_status_menu', ' * ', 'WHERE is_delete=0 ');
     $this->smarty->assign('statusMenu', $statusMenu);
     $value = '';
     $where = '';
     switch ($searchTransportationType) {
         case '1':
             $transportation = CommonModel::getCarrierList(1);
             //快递
             break;
         case '2':
             $transportation = CommonModel::getCarrierList(0);
             //平邮
             break;
         default:
             $transportation = CommonModel::getCarrierList();
             //所有的
             break;
     }
     //var_dump($transportation); exit;
     $transportationList = array();
     foreach ($transportation as $tranValue) {
         $transportationList[$tranValue['id']] = $tranValue['carrierNameCn'];
     }
     //var_dump($transportationList); exit;
     $this->smarty->assign('transportation', $transportation);
     $this->smarty->assign('transportationList', $transportationList);
     //var_dump($orderid, $ostatus,$otype);
     $omOrderList = $OrderModifyAct->act_getModifyOrderList($orderid, $ostatus, $otype, $storeId = 1);
     //var_dump($omOrderList);
     //$sku	=	array();
     $account_where = ' WHERE is_delete = 0 ';
     if ($searchPlatformId) {
         $account_where .= ' AND platformId = ' . $searchPlatformId;
     }
     $accountList = $UserCompetenceAct->act_showGlobalUser();
     if ($accountList) {
         $account_where .= ' AND id in ( ' . join(',', $accountList) . ' ) ';
     }
     //帐号信息
     $accountList = $omAvailableAct->act_getTNameList('om_account', '*', $account_where);
     //var_dump($accountList); exit;
     $account = array();
     foreach ($accountList as $v) {
         $account[$v['id']] = $v['account'];
     }
     //包材信息
     $pm = GoodsModel::getMaterInfoByList();
     //获取系统所有状态
     $statusList = copyOrderModel::selectStatusList();
     $CurrencyAct = new CurrencyAct();
     $currencyList = $CurrencyAct->act_getCurrencyListById();
     //echo "<pre>"; print_r($currencyList); exit;
     $this->smarty->assign('currencyList', $currencyList);
     $this->smarty->assign('statusList', $statusList);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('account', $account);
     $this->smarty->assign('accountList', $accountList);
     $this->smarty->assign('pm', $pm);
     $this->smarty->assign('omOrderList', $omOrderList);
     $this->smarty->display('orderModify.htm');
 }
コード例 #4
0
ファイル: omAccount.view.php プロジェクト: ohjack/newErp
 public function view_showUserCompense()
 {
     $OmAccountAct = new OmAccountAct();
     $StatusMenuAct = new StatusMenuAct();
     $uid = $_GET['uid'];
     //var_dump($_POST); exit;
     $showinfo = '';
     if (isset($_POST['action']) && !empty($_POST['action'])) {
         if ($OmAccountAct->act_addUserCompense($_POST)) {
             $showinfo = "<font color='green'>添加权限成功!</font>";
         } else {
             $showinfo = "<font color='red'>添加权限失败!</font>";
         }
         $uid = $_POST['uid'];
     }
     if (empty($uid)) {
         header("location:index.php?mod=user&act=index");
         exit;
     }
     $this->smarty->assign('uid', $uid);
     $this->smarty->assign('showinfo', $showinfo);
     $UserCompenseList = $OmAccountAct->act_getUserCompenseList($uid);
     //echo "<pre>";
     //print_r($UserCompenseList); exit;
     //$visible_platform = array();
     //$visible_account  = array();
     //echo "<pre>";
     //var_dump($UserCompenseList);
     //$visible_platform = $UserCompenseList['visible_platform'];
     //$visible_account  = $UserCompenseList['visible_account'];
     $visible_movefolder = json_decode($UserCompenseList['visible_movefolder'], true);
     //$visible_showfolder = $UserCompenseList['visible_showfolder'];
     //$visible_editorder  = $UserCompenseList['visible_editorder'];
     $visible_platform_account = json_decode($UserCompenseList['visible_platform_account'], true);
     //var_dump($visible_platform_account); exit;
     /*if(empty($visible_movefolder)){
     			echo "=============";
     		}*/
     $key_visible_movefolder = array();
     if (is_array($visible_movefolder)) {
         $key_visible_movefolder = array_keys($visible_movefolder);
     }
     $StatusMenu = $StatusMenuAct->act_getStatusMenuListById('*', ' WHERE groupId != 0 ');
     //var_dump($StatusMenu);
     $statusGroupLists = $StatusMenuAct->act_getMenuGroupList();
     //echo "<pre>"; print_r($statusGroupLists); exit;
     //$all_platform = $UserCompenseList['all_platform'];
     //var_dump($all_platform);
     //$all_account = $UserCompenseList['all_account'];
     //$all_account = $UserCompenseList['all_account'];
     $arr_all_platform_account = $UserCompenseList['arr_all_platform_account'];
     $editorder_options = array(1 => '平台', '账号', '买家ID', '订单号', '下单时间', '付款时间', '产品总金额', '物流费用', '订单金额', 'Transaction ID', '币种', '估算重量', '买家选择发货物流', '跟踪号', 'Full name', 'Street1', 'Street2', 'City', 'State', 'Country	', 'Postcode', 'Tel1', 'Tel2', 'Tel3', '买家邮箱1', '买家邮箱2', '买家邮箱3', '订单备注');
     $this->smarty->assign('editorder_options', $editorder_options);
     //$this->smarty->assign('visible_platform', $visible_platform);
     //$this->smarty->assign('visible_account', $visible_account);
     $this->smarty->assign('visible_platform_account', $visible_platform_account);
     $this->smarty->assign('arr_all_platform_account', $arr_all_platform_account);
     $this->smarty->assign('key_visible_movefolder', $key_visible_movefolder);
     $this->smarty->assign('visible_showfolder', $visible_showfolder);
     $this->smarty->assign('visible_editorder', $visible_editorder);
     //$this->smarty->assign('all_platform', $all_platform);
     //$this->smarty->assign('all_account', $all_account);
     $this->smarty->assign('StatusMenu', $StatusMenu);
     $this->smarty->assign('statusGroupLists', $statusGroupLists);
     $this->smarty->assign('toptitle', '订单系统细颗粒度权限控制');
     $this->smarty->assign('toplevel', 3);
     $this->smarty->assign('secondlevel', '32');
     $this->smarty->display("showUserCompense.htm");
 }
コード例 #5
0
ファイル: common.model.php プロジェクト: ohjack/newErp
 public static function get_waiting_sale($sku)
 {
     //获取海外仓待发货数据 Herman.Xi
     $totalnums = 0;
     $combineskus = GoodsModel::getCombineBySku($sku);
     $skus = array($sku => 1) + $combineskus;
     /*$combineskus = get_combinesku($sku);
     		$skus = empty($combineskus) ? array() : array_keys($combineskus);
     		array_push($skus, $sku);*/
     $StatusMenuAct = new StatusMenuAct();
     $menuList = $StatusMenuAct->act_getStatusMenuList("*", " where dStatus = 1 and groupId = 0 and is_delete=0 and storeId= {$storeId} ");
     //var_dump($menuList); exit;
     $dStatusCodes = array();
     foreach ($menuList as $value) {
         $dStatusCodes[] = $value['statusCode'];
     }
     //var_dump($dStatusCodes);
     foreach ($skus as $_sku => $_num) {
         $ordersql = "SELECT \t\ta.id,b.sku,b.amount\n\t\t\t\t\t\tFROM \t\t\tom_unshipped_order AS a \n\t\t\t\t\t\tLEFT JOIN       om_unshipped_order_detail AS b \n\t\t\t\t\t\tON \t\t\t\tb.omOrderId = a.id \n\t\t\t\t\t\tWHERE \t\t\ta.orderStatus NOT IN (" . join(',', $dStatusCodes) . ") \n\t\t\t\t\t\tAND \t\t\ta.is_delete = 0 \n\t\t\t\t\t\tAND \t\t\tb.sku='{$_sku}' \n\t\t\t\t\t\tAND\t\t\t\ta.storeId = " . $storeId;
         //echo $ordersql;
         $query = self::$dbConn->query($ordersql);
         $ebay_ids = self::$dbConn->fetch_array_all($query);
         if (!empty($ebay_ids)) {
             foreach ($ebay_ids as $ebay_id) {
                 $realtimes = self::get_realtime($sku_info["sku"]);
                 $totalnums += $sku_info["amount"] * $realtimes;
             }
         }
     }
     return $totalnums;
     /*$sql = "SELECT b.ebay_amount ,b.sku
     						FROM ebay_order AS a 
     						LEFT JOIN ebay_orderdetail AS b ON a.ebay_ordersn = b.ebay_ordersn 
     						WHERE a.ebay_status  IN (705,706,707,710)
     						AND b.sku in ({$skus_str})
     						AND a.ebay_combine!='1'
     						"; 
     		$sql = $dbcon->execute($sql);
     		$skunums = $dbcon->getResultArray($sql);
     		foreach($skunums as $sku_info){
     			$realtimes = get_realtime($sku_info["sku"]);
     			$totalnums += ($sku_info["ebay_amount"]*$realtimes);
     		}
     		return $totalnums;*/
 }
コード例 #6
0
ファイル: orderRefund.action.php プロジェクト: ohjack/newErp
 /**
  * 申请退款
  */
 function act_applyRefund()
 {
     $id = isset($_POST['orderId']) ? trim($_POST['orderId']) : '';
     $ostatus = isset($_POST['orderStatus']) ? trim($_POST['orderStatus']) : '';
     $otype = isset($_POST['orderType']) ? trim($_POST['orderType']) : '';
     if ($id == '') {
         self::$errCode = 1;
         self::$errMsg = '参数非法!';
         return FALSE;
     }
     $refundedInfo = self::act_getRefundedSum($id);
     //var_dump($refundedInfo);
     //print_r($refundedInfo);
     $totalSum = $refundedInfo['totalSum'];
     $refundedSum = $refundedInfo['refundSum'];
     //var_dump($refundedSum);
     if ($refundedSum != 0 && $refundedSum >= $totalSum) {
         self::$errCode = 02;
         self::$errMsg = '该订单累计申请退款金额已达订单金额,不可再申请!';
         return FALSE;
     }
     $StatusMenuAct = new StatusMenuAct();
     $tableName = $StatusMenuAct->act_getOrderNameByStatus($ostatus, $otype);
     $orderInfo = OrderRefundModel::getOrderInfo($tableName, $id);
     //$orderObj  = new OrderRefundModel();
     //$orderInfo = OrderRefundModel::getTNameList($table, $field, $where);
     if (!$orderInfo) {
         $orderInfo['refundedSum'] = $refundedSum;
     }
     //var_dump($orderInfo); exit;
     self::$errCode = OrderRefundModel::$errCode;
     self::$errMsg = OrderRefundModel::$errMsg;
     return $orderInfo;
 }
コード例 #7
0
ファイル: orderModify.action.php プロジェクト: ohjack/newErp
 public function act_index()
 {
     $id = $_REQUEST['orderid'];
     $ostatus = $_REQUEST['ostatus'];
     $otype = $_REQUEST['otype'];
     $storeId = 1;
     $where = ' WHERE da.is_delete = 0 AND da.storeId = ' . $storeId . ' AND da.orderStatus = ' . $ostatus;
     if ($otype != '') {
         $where .= ' AND da.orderType	= ' . $otype;
     }
     $where .= ' AND da.id	= ' . $id;
     $StatusMenuAct = new StatusMenuAct();
     $tableName = $StatusMenuAct->act_getOrderNameByStatus($ostatus, $otype);
     $orderlist = OrderindexModel::showSearchOrderList($tableName, $where);
     $data['order'] = $orderlist[$id];
     //var_dump($orderlist); exit;
     /*$price	=	array();
     		$data['order']	=	OrderModifyModel::index($$tableName,$where);
     		foreach($data['order'] as $k => $v){
     			$data['order'][$k]['ordersTime']	=	date("Y-m-d H:i:s",$v['ordersTime']);
     			$data['order'][$k]['paymentTime']	=	date("Y-m-d H:i:s",$v['paymentTime']);
     			if($data['order'][$k]['createdTime'] != ''){
     				$data['order'][$k]['createdTime']	=	date("Y-m-d H:i:s",$v['createdTime']);
     			}
     			$goodinfo	=	GoodsModel::getSkuinfo($v['sku']);
     			$data['order'][$k]['price']			=	$goodinfo['goods_cost'];
     		}
     		$data['combinePackageMessage']	=	'';
     		
     		switch($data['order'][0]['combinePackage']){
     			case 0:
     				$data['combinePackageMessage']	=	'正常订单(未合并包裹)';
     				break;
     			case 1:
     				$result	=	OmAvailableModel::getTNameList(' `om_records_combinePackage` ',' * ',' WHERE main_order_id = "'.$data['order'][0]['id'].'"');
     				$data['combinePackageMessage']	.=	'该订单是合并包裹'.$result[0]['main_order_id'].'的一部分';
     				break;
     			case 2:
     				$result	=	OmAvailableModel::getTNameList(' `om_records_combinePackage` ',' * ',' WHERE split_order_id = "'.$data['order'][0]['id'].'"');
     				$data['combinePackageMessage']	.=	'该订单是合并包裹'.$result[0]['main_order_id'].'的一部分';
     				break;
     			default:
     				break;
     		}
     
     		$data['isSplitMessage']	=	'';
     
     		switch($data['order'][0]['isSplit']){
     			case 0:
     				$data['isSplitMessage']	=	'正常订单(未拆分)';
     				break;
     			case 1:
     				$result	=	OmAvailableModel::getTNameList(' `om_records_splitOrder` ',' * ',' WHERE main_order_id = "'.$data['order'][0]['id'].'"');
     				$data['isSplitMessage']	.=	'该订单拆分成'.count($result).'个订单';
     				break;
     			case 2:
     				$result	=	OmAvailableModel::getTNameList(' `om_records_combinePackage` ',' * ',' WHERE split_order_id = "'.$data['order'][0]['id'].'"');
     				$result	=	OmAvailableModel::getTNameList(' `om_records_combinePackage` ',' * ',' WHERE main_order_id = "'.$result[0]['main_order_id'].'"');
     				$data['isSplitMessage']	.=	'该订单与'.count($result).'个订单由订单'.$result[0]['main_order_id'].'拆分而来';
     				break;
     			default:
     				break;
     		}*/
     //$data['transport']	=	CommonModel::getCarrierList();
     //$data['materials']	=	GoodsModel::getMaterInfo();
     $data['operationLog'] = OmAvailableModel::getTNameList('`om_order_log`', ' * ', ' WHERE omOrderId = ' . $id);
     if (empty($data['operationLog'])) {
         $data['operationLog'] = array(array('note' => '暂无操作日志', 'createdTime' => ''));
     } else {
         foreach ($data['operationLog'] as $k => $v) {
             $data['operationLog'][$k]['createdTime'] = date("Y-m-d H:i:s", $v['createdTime']);
         }
     }
     //$data['currency'] = OmAvailableModel :: getTNameList('om_currency',' * ',' WHERE 1');
     //var_dump($data); exit;
     self::$errCode = OrderindexModel::$errCode;
     self::$errMsg = OrderindexModel::$errMsg;
     return $data;
 }
コード例 #8
0
ファイル: orderindex.action.php プロジェクト: ohjack/newErp
 public function act_showOrderList($ostatus, $otype, $where)
 {
     $StatusMenuAct = new StatusMenuAct();
     $tableName = $StatusMenuAct->act_getOrderNameByStatus($ostatus, $otype);
     $data = OrderindexModel::showOrderList($tableName, $where);
     self::$errCode = OrderindexModel::$errCode;
     self::$errMsg = OrderindexModel::$errMsg;
     return $data;
 }
コード例 #9
0
ファイル: orderindex.view.php プロジェクト: ohjack/newErp
 public function view_getOrderList()
 {
     global $memc_obj;
     $pagesize = isset($_GET['pnum']) && intval($_GET['pnum']) > 0 && intval($_GET['pnum']) < 101 ? intval($_GET['pnum']) : 20;
     //页面大小
     if ($_GET['debug'] == 1) {
         $starttime = time() + microtime();
         echo microtime() . '-----' . $starttime . "\n";
     }
     //菜单
     $status = '';
     $search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
     //搜索时使用的数据
     //order表
     $searchPlatformId = isset($_GET['platformId']) ? $_GET['platformId'] : '';
     //搜索平台
     $searchAccountId = isset($_GET['accountId']) ? $_GET['accountId'] : '';
     //搜索账号
     $searchIsNote = isset($_GET['isNote']) ? $_GET['isNote'] : '';
     //是否有留言
     $searchTransportationType = isset($_GET['transportationType']) ? $_GET['transportationType'] : '';
     //运输类型
     $searchTransportation = isset($_GET['transportation']) ? $_GET['transportation'] : '';
     //运输方式
     $searchIsBuji = isset($_GET['isBuji']) ? $_GET['isBuji'] : '';
     //是否补寄订单
     $searchIsLock = isset($_GET['isLock']) ? $_GET['isLock'] : '';
     //是否锁定
     $searchOrderTime1 = isset($_GET['OrderTime1']) ? $_GET['OrderTime1'] : '';
     //搜索下单初始时间
     $searchOrderTime2 = isset($_GET['OrderTime2']) ? $_GET['OrderTime2'] : '';
     //搜索下单结束时间
     //order_detail表
     $searchReviews = isset($_GET['reviews']) ? $_GET['reviews'] : '';
     //是否评价
     $searchSku = isset($_GET['sku']) ? $_GET['sku'] : '';
     //sku
     //$searchOmOrderId			=	'';																	//订单编号
     $searchOrderType = isset($_GET['selectOrderType']) ? $_GET['selectOrderType'] : '';
     //订单种类
     //order_userInfo表
     //$searchUsername				=	'';																	//买家名
     //$searchEmail				=	'';
     $countryName = isset($_GET['country']) ? $_GET['country'] : "";
     $state = isset($_GET['state']) ? $_GET['state'] : "";
     $city = isset($_GET['city']) ? $_GET['city'] : "";
     $zipCode = isset($_GET['zipCode']) ? $_GET['zipCode'] : "";
     //order_warehouse表
     //$weighTimeStart				= 	isset($_GET['searchTimeStart'])? $_GET['searchTimeStart']:"";
     //$weighTimeEnd				= 	isset($_GET['searchTimeEnd'])? $_GET['searchTimeEnd']:"";
     $searchTimeType = isset($_GET['searchTimeType']) ? $_GET['searchTimeType'] : '';
     //order_tracknumbe表
     //$searchTracknumber			=	'';																	//跟踪号
     //order_extension_ebay表
     //$searchTransId				=	'';																	//交易ID
     $searchKeywordsType = isset($_GET['KeywordsType']) ? $_GET['KeywordsType'] : '';
     //搜索关键字类型
     $searchKeywords = isset($_GET['Keywords']) ? $_GET['Keywords'] : '';
     //搜索关键字
     $this->smarty->assign('searchPlatformId', $searchPlatformId);
     $this->smarty->assign('searchAccountId', $searchAccountId);
     $this->smarty->assign('searchIsNote', $searchIsNote);
     $this->smarty->assign('searchTransportationType', $searchTransportationType);
     $this->smarty->assign('searchTransportation', $searchTransportation);
     $this->smarty->assign('searchIsBuji', $searchIsBuji);
     $this->smarty->assign('searchIsLock', $searchIsLock);
     $this->smarty->assign('searchOrderTime1', $searchOrderTime1);
     $this->smarty->assign('searchOrderTime2', $searchOrderTime2);
     $this->smarty->assign('searchReviews', $searchReviews);
     $this->smarty->assign('searchSku', $searchSku);
     $this->smarty->assign('searchOrderType', $searchOrderType);
     //$this->smarty->assign('searchEmail', $searchEmail);
     $this->smarty->assign('searchKeywordsType', $searchKeywordsType);
     $this->smarty->assign('searchKeywords', $searchKeywords);
     $this->smarty->assign('searchCountry', $countryName);
     $this->smarty->assign('searchState', $state);
     $this->smarty->assign('searchCity', $city);
     $this->smarty->assign('searchZipCode', $zipCode);
     //$this->smarty->assign('searchTimeStart', $weighTimeStart);
     //$this->smarty->assign('searchTimeEnd', $weighTimeEnd);
     $this->smarty->assign('searchTimeType', $searchTimeType);
     if ($_GET['debug'] == 1) {
         $dotime = time() + microtime();
         echo "firsttime ==={$dotime}=== " . ($dotime - $starttime) . "\n\n";
     }
     $OrderRefundAct = new OrderRefundAct();
     $omAvailableAct = new OmAvailableAct();
     $OrderindexAct = new OrderindexAct();
     //平台信息
     $OmAccountAct = new OmAccountAct();
     $WarehouseAPIAct = new WarehouseAPIAct();
     if ($_GET['debug'] == 1) {
         $dotime1 = time() + microtime();
         echo "secondtime === " . ($dotime1 - $dotime) . "\n\n";
     }
     $AbOrderList = $WarehouseAPIAct->act_getAbOrderList();
     //var_dump($AbOrderList); exit;
     if ($_GET['debug'] == 1) {
         $dotime = time() + microtime();
         echo "thirdtime === " . ($dotime - $dotime1) . "\n\n";
     }
     $AbOrderListArr = array();
     $AbOrderids = array();
     $AbOrderShow = array();
     foreach ($AbOrderList as $orderId) {
         $AbOrderInfo = $WarehouseAPIAct->act_getAbOrderInfo($orderId['id']);
         $AbOrderListArr[$orderId['originOrderId']] = $AbOrderInfo;
         $AbOrderids[] = $orderId['originOrderId'];
         $AbOrderShow[$orderId['originOrderId']] = $orderId['id'];
     }
     if ($_GET['debug'] == 1) {
         $dotime1 = time() + microtime();
         echo "forthtime === " . ($dotime1 - $dotime) . "\n\n";
     }
     //var_dump($AbOrderListArr); exit;
     $this->smarty->assign('AbOrderListArr', $AbOrderListArr);
     $this->smarty->assign('AbOrderShow', $AbOrderShow);
     //$platform	=  $omAvailableAct->act_getTNameList('om_platform','id,platform','WHERE is_delete=0');
     $platform = $OmAccountAct->act_getPlatformListByPower();
     //var_dump($platform);
     if ($_GET['debug'] == 1) {
         $dotime = time() + microtime();
         echo "fiftytime === " . ($dotime - $dotime1) . "\n\n";
     }
     $this->smarty->assign('platform', $platform);
     /**导航 start**/
     $default_ostatus = isset($_GET['ostatus']) ? $_GET['ostatus'] : C('STATEPENDING');
     /*if(isset($_GET['ostatus']) && !empty($_GET['ostatus'])){
     			$ostatus = $_GET['ostatus'];
     		}else{
     			$ostatus = C('STATEPENDING');
     		}*/
     $ostatus = $_GET['ostatus'];
     //echo C('STATEPENDING');
     $this->smarty->assign('ostatus', $ostatus);
     $otype = isset($_GET['otype']) ? $_GET['otype'] : '';
     $this->smarty->assign('otype', $otype);
     //二级目录
     $StatusMenuAct = new StatusMenuAct();
     $ostatusList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = 0 AND is_delete=0');
     //var_dump($ostatusList);
     $this->smarty->assign('ostatusList', $ostatusList);
     if ($ostatus) {
         $otypeList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $ostatus . '" AND is_delete=0');
     } else {
         $otypeList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $default_ostatus . '" AND is_delete=0');
     }
     if ($_GET['debug'] == 1) {
         $dotime1 = time() + microtime();
         echo "sixtytime === " . ($dotime1 - $dotime) . "\n\n";
     }
     //var_dump($otypeList);
     $this->smarty->assign('otypeList', $otypeList);
     /*$o_secondlevel =  $omAvailableAct->act_getTNameList('om_status_menu','*','WHERE is_delete=0 and groupId=0 order by sort asc');
     		$this->smarty->assign('o_secondlevel', $o_secondlevel);*/
     $second_count = array();
     $second_type = array();
     $accountacc = $_SESSION['accountacc'];
     //var_dump($ostatusList); echo "<br>";
     foreach ($ostatusList as $o_secondinfo) {
         $orderStatus = $o_secondinfo['statusCode'];
         //echo $orderStatus."============"; echo "<br>";
         $s_total = 0;
         //$OrderindexAct->act_showSearchOrderNum($orderStatus);
         //echo $orderStatus."==".$s_total; echo "<br>";
         $second_count[$o_secondinfo['statusCode']] = $s_total;
         //$s_type =  $omAvailableAct->act_getTNameList("om_status_menu","*","WHERE is_delete=0 and groupId='$orderStatus' order by sort asc");
         $s_type = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $orderStatus . '" AND is_delete=0 order by sort asc');
         $second_type[$orderStatus] = $s_type[0]['statusCode'];
     }
     if ($_GET['debug'] == 1) {
         $dotime = time() + microtime();
         echo "seventime === " . ($dotime - $dotime1) . "\n\n";
     }
     //var_dump($second_count);
     $this->smarty->assign('second_count', $second_count);
     $this->smarty->assign('second_type', $second_type);
     //var_dump($second_type);
     //退款数量
     $accountList = $_SESSION['accountList'];
     $platformList = $_SESSION['platformList'];
     //echo "<pre>"; print_r($accountList); exit;
     $where = " WHERE is_delete=0 ";
     $platformsee = array();
     for ($i = 0; $i < count($platformList); $i++) {
         $platformsee[] = $platformList[$i];
     }
     if ($platformsee) {
         $where .= ' AND platformId IN (' . join(",", $platformsee) . ') ';
     } else {
         //$where .= " AND 1=2 ";
     }
     $accountsee = array();
     for ($i = 0; $i < count($accountList); $i++) {
         $accountsee[] = $accountList[$i];
     }
     if ($accountsee) {
         $where .= ' AND accountId IN (' . join(",", $accountsee) . ') ';
     } else {
         //$where .= " AND 1=2 ";
     }
     //echo $where;
     //$refund_total = $omAvailableAct->act_getTNameCount("om_order_refund"," where is_delete=0 ");
     $refund_total = $OrderRefundAct->act_getRecordNums();
     $this->smarty->assign('refund_total', $refund_total);
     $parameterArr = array();
     //var_dump($AbOrderids);
     $parameterArr['AbOrderList'] = $AbOrderids;
     $total = $OrderindexAct->act_showABOrder($ostatus, $otype, '', $parameterArr);
     $this->smarty->assign('abnormal_total', $total);
     if ($_GET['debug'] == 1) {
         $dotime1 = time() + microtime();
         echo "8time === " . ($dotime1 - $dotime) . "\n\n";
     }
     //三级目录
     $three_count = array();
     if ($ostatus) {
         $o_threelevel = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$ostatus}' order by sort asc");
         foreach ($o_threelevel as $o_threeinfo) {
             $orderType = $o_threeinfo['statusCode'];
             /*$or_where = " where orderStatus='$ostatus' and orderType='$orderType' ";
             		if($accountacc){
             			$or_where .= ' AND ('.$accountacc.') ';
             		}*/
             //$s_total = $OrderindexAct->act_showSearchOrderNum($ostatus, $orderType);
             $s_total = $default_ostatus == 900 && $orderType == 21 ? 'n' : $OrderindexAct->act_showSearchOrderNum($default_ostatus, $orderType);
             //$s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", $or_where);
             $three_count[$o_threeinfo['statusCode']] = $s_total;
         }
     } else {
         $or_where = "WHERE is_delete=0 and groupId='{$default_ostatus}' ";
         if ($accountacc) {
             $or_where .= ' AND (' . $accountacc . ') ';
         }
         $or_where .= " order by sort asc";
         $o_threelevel = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$default_ostatus}' order by sort asc");
         foreach ($o_threelevel as $o_threeinfo) {
             $orderType = $o_threeinfo['statusCode'];
             /*$or_where = " where orderStatus='$ostatus' and orderType='$orderType' ";
             		if($accountacc){
             			$or_where .= ' AND ('.$accountacc.') ';
             		}*/
             $s_total = $default_ostatus == 900 && $orderType == 21 ? 'n' : $OrderindexAct->act_showSearchOrderNum($default_ostatus, $orderType);
             //$s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", $or_where);
             $three_count[$o_threeinfo['statusCode']] = $s_total;
         }
     }
     //
     if ($_GET['debug'] == 1) {
         $dotime = time() + microtime();
         echo "9time === " . ($dotime - $dotime1) . "\n\n";
     }
     $this->smarty->assign('o_threelevel', $o_threelevel);
     $this->smarty->assign('three_count', $three_count);
     $toptitle = '订单显示页面';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 0);
     $threelevel = '1';
     //当前的三级菜单
     $this->smarty->assign('threelevel', $threelevel);
     $statusMenu = $omAvailableAct->act_getTNameList('om_status_menu', ' * ', 'WHERE is_delete=0 ');
     $this->smarty->assign('statusMenu', $statusMenu);
     $value = '';
     $where = '';
     switch ($searchTransportationType) {
         case '1':
             $transportation = CommonModel::getCarrierList(1);
             //快递
             break;
         case '2':
             $transportation = CommonModel::getCarrierList(0);
             //平邮
             break;
         default:
             $transportation = CommonModel::getCarrierList();
             //所有的
             break;
     }
     if ($_GET['debug'] == 1) {
         $dotime1 = time() + microtime();
         echo "10time === " . ($dotime1 - $dotime) . "\n\n";
     }
     //var_dump($transportation); exit;
     $transportationList = array();
     foreach ($transportation as $tranValue) {
         $transportationList[$tranValue['id']] = $tranValue['carrierNameCn'];
     }
     //var_dump($transportationList); exit;
     $this->smarty->assign('transportation', $transportation);
     $this->smarty->assign('transportationList', $transportationList);
     if ($search == '') {
         /*$where	=	' WHERE is_delete = 0 AND storeId = 1 AND orderStatus = '.$ostatus;
         		if($otype	!=	''){
         			$where	.=	' AND orderType	=	'.$otype;
         		}*/
         //$total = $omAvailableAct->act_getTNameCount($orderForm, $where);
         $total = $OrderindexAct->act_showOrder($ostatus, $otype);
         //echo $total; exit;
         $num = $pagesize;
         //每页显示的个数
         $page = new Page($total, $num, '', 'CN');
         //$where .= " ORDER BY ordersTime " . $page->limit;
         //echo "========订单系统升级中========="; echo "<br>";
         $omOrderList = $OrderindexAct->act_showOrder($ostatus, $otype, $page->limit);
         //echo "<pre>"; var_dump($omOrderList); exit;
         //$omOrderList = $omAvailableAct->act_getTNameList($orderForm, '*', $where);
     } else {
         $parameterArr = array();
         $parameterArr['searchPlatformId'] = $searchPlatformId;
         $parameterArr['searchAccountId'] = $searchAccountId;
         $parameterArr['searchIsNote'] = $searchIsNote;
         $parameterArr['searchTransportationType'] = $searchTransportationType;
         $parameterArr['searchTransportation'] = $searchTransportation;
         $parameterArr['searchIsBuji'] = $searchIsBuji;
         $parameterArr['searchIsLock'] = $searchIsLock;
         $parameterArr['searchOrderTime1'] = $searchOrderTime1;
         $parameterArr['searchOrderTime2'] = $searchOrderTime2;
         $parameterArr['searchReviews'] = $searchReviews;
         $parameterArr['searchSku'] = trim($searchSku);
         $parameterArr['searchOrderType'] = $searchOrderType;
         $parameterArr['searchKeywordsType'] = $searchKeywordsType;
         $parameterArr['countryName'] = trim($countryName);
         $parameterArr['state'] = trim($state);
         $parameterArr['city'] = trim($city);
         $parameterArr['zipCode'] = trim($zipCode);
         $parameterArr['searchTimeType'] = trim($searchTimeType);
         $parameterArr['searchKeywords'] = trim($searchKeywords);
         //$parameterArr['searchKeywords']	=	trim($searchKeywords);
         /*if($_SESSION['sysUserId'] == 8){
         			var_dump($ostatus.'---'.$otype);
         		}*/
         //echo "订单系统升级中。。。。。。。<br>";
         //var_dump($parameterArr); echo "<br>";
         //$total = $OrderindexAct->act_index($parameterArr,$searchKeywordsType,$searchKeywords);
         $total = $OrderindexAct->act_showOrder($ostatus, $otype, '', $parameterArr);
         //echo $total; exit;
         $num = $pagesize;
         //每页显示的个数
         $page = new Page($total, $num, '', 'CN');
         //$limit	=	$page->limit;
         //var_dump($parameterArr);
         $omOrderList = $OrderindexAct->act_showOrder($ostatus, $otype, $page->limit, $parameterArr);
         //var_dump($omOrderList);
         //$omOrderList = OrderindexAct::act_index($parameterArr,$searchKeywordsType,$searchKeywords,$limit,$ostatus);
     }
     if ($_GET['debug'] == 1) {
         $dotime = time() + microtime();
         echo "11time ={$dotime}== " . ($dotime - $dotime1) . "\n\n";
     }
     //$sku	=	array();
     $account_where = ' WHERE is_delete = 0 ';
     if ($searchPlatformId) {
         $account_where .= ' AND platformId = ' . $searchPlatformId;
     }
     $UserCompetenceAct = new UserCompetenceAct();
     $accountList = $UserCompetenceAct->act_showGlobalUser();
     if ($accountList) {
         $account_where .= ' AND id in ( ' . join(',', $accountList) . ' ) ';
     }
     //帐号信息
     $accountList = $omAvailableAct->act_getTNameList('om_account', '*', $account_where);
     //var_dump($accountList); exit;
     $account = array();
     foreach ($accountList as $v) {
         $account[$v['id']] = $v['account'];
     }
     //包材信息
     $pm = GoodsModel::getMaterInfoByList();
     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;
     }
     //var_dump($page);
     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));
     }
     //echo $show_page;
     //获取系统所有状态
     $statusList = copyOrderModel::selectStatusList();
     if ($_GET['debug'] == 1) {
         $dotime1 = time() + microtime();
         echo "12time ={$dotime1}== " . ($dotime1 - $dotime) . "\n\n";
     }
     //echo $show_page;
     $this->smarty->assign('statusList', $statusList);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('account', $account);
     $this->smarty->assign('accountList', $accountList);
     $this->smarty->assign('pm', $pm);
     $this->smarty->assign('omOrderList', $omOrderList);
     $this->smarty->display('orderindex.htm');
 }
コード例 #10
0
ファイル: statusMenu.action.php プロジェクト: ohjack/newErp
 function act_updateMenuStatusAPI()
 {
     $orderId = post_check(trim($_REQUEST['orderId']));
     $ebay_status = $_REQUEST['ebay_status'];
     $final_status = $_REQUEST['final_status'];
     $truename = $_REQUEST['username'];
     if (empty($orderId)) {
         self::$errCode = 401;
         self::$errMsg = 'orderId is null';
         return false;
     }
     if (empty($ebay_status)) {
         self::$errCode = 402;
         self::$errMsg = 'ebay_status is null';
         return false;
     }
     if (empty($final_status)) {
         self::$errCode = 403;
         self::$errMsg = 'final_status is null';
         return false;
     }
     if (empty($truename)) {
         self::$errCode = 404;
         self::$errMsg = 'truename is null';
         return false;
     }
     $status1 = getStatusMenuByOldStatus($final_status);
     $orderStatus1 = $status1[0];
     $orderType1 = $status1[1];
     $status2 = getStatusMenuByOldStatus($ebay_status);
     $orderStatus2 = $status2[0];
     $orderType2 = $status2[1];
     $tableName = "om_unshipped_order";
     $data['orderStatus'] = $orderStatus1;
     $data['orderType'] = $orderType1;
     $where = " where id = {$orderId} AND orderStatus = {$orderStatus2} AND orderType = {$orderType2} AND is_delete = 0 ";
     $updatedata = OrderindexModel::updateOrder($tableName, $data, $where);
     if ($updatedata) {
         self::$errCode = 200;
         self::$errMsg = 'update success';
         return true;
     } else {
         self::$errCode = 405;
         self::$errMsg = 'update error';
         return false;
     }
 }
コード例 #11
0
 public function view_applyTheLineEUBTrackNumber()
 {
     global $memc_obj;
     $OmEUBTrackNumberAct = new OmEUBTrackNumberAct();
     if (isset($_GET) && !empty($_GET)) {
         $orderid = isset($_GET['orderid']) ? $_GET['orderid'] : '';
         $ostatus = isset($_GET['ostatus']) ? $_GET['ostatus'] : '';
         $otype = isset($_GET['otype']) ? $_GET['otype'] : '';
     }
     $showerrorinfo = '';
     //print_r($_POST);
     if (isset($_FILES) && !empty($_FILES)) {
         $info = $OmEUBTrackNumberAct->act_applyTheLineEUBTrackNumber();
         if ($info) {
             $showerrorinfo = "<font color=\"green\">上传成功!<br></font><font color=\"red\">" . $OmEUBTrackNumberAct::$errMsg . "</font>";
         } else {
             $showerrorinfo = "<font color=\"red\">上传成功!<br>" . $OmEUBTrackNumberAct::$errMsg . "</font>";
         }
     }
     $this->smarty->assign('showerrorinfo', $showerrorinfo);
     $omAvailableAct = new OmAvailableAct();
     //平台信息
     $platform = $omAvailableAct->act_getTNameList('om_platform', 'id,platform', 'WHERE is_delete=0');
     //var_dump($platform);
     $platformList = array();
     foreach ($platform as $v) {
         $platformList[$v['id']] = $v['platform'];
     }
     $this->smarty->assign('platformList', $platformList);
     /**导航 start**/
     $this->smarty->assign('ostatus', $ostatus);
     $this->smarty->assign('otype', $otype);
     //二级目录
     $StatusMenuAct = new StatusMenuAct();
     $ostatusList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = 0 AND is_delete=0');
     //var_dump($ostatusList);
     $this->smarty->assign('ostatusList', $ostatusList);
     $otypeList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $ostatus . '" AND is_delete=0');
     //var_dump($otypeList);
     $this->smarty->assign('otypeList', $otypeList);
     /*$o_secondlevel =  $omAvailableAct->act_getTNameList('om_status_menu','*','WHERE is_delete=0 and groupId=0 order by sort asc');
     		$this->smarty->assign('o_secondlevel', $o_secondlevel);*/
     $second_count = array();
     $second_type = array();
     foreach ($ostatusList as $o_secondinfo) {
         $orderStatus = $o_secondinfo['statusCode'];
         $accountacc = $_SESSION['accountacc'];
         $oc_where = " where orderStatus='{$orderStatus}' and storeId=1 and is_delete=0 ";
         if ($accountacc) {
             $oc_where .= ' AND (' . $accountacc . ') ';
         }
         $s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", $oc_where);
         $second_count[$o_secondinfo['statusCode']] = $s_total;
         $s_type = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$orderStatus}' order by sort asc");
         $second_type[$o_secondinfo['statusCode']] = $s_type[0]['statusCode'];
     }
     //var_dump($second_count);
     $this->smarty->assign('second_count', $second_count);
     $this->smarty->assign('second_type', $second_type);
     //退款数量
     $refund_total = $omAvailableAct->act_getTNameCount("om_order_refund", " where is_delete=0");
     $this->smarty->assign('refund_total', $refund_total);
     //三级目录
     $o_threelevel = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$ostatus}' order by sort asc");
     $this->smarty->assign('o_threelevel', $o_threelevel);
     $three_count = array();
     foreach ($o_threelevel as $o_threeinfo) {
         $orderType = $o_threeinfo['statusCode'];
         $s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", " where orderStatus='{$ostatus}' and orderType='{$orderType}' and storeId=1 and is_delete=0");
         $three_count[$o_threeinfo['statusCode']] = $s_total;
     }
     $this->smarty->assign('three_count', $three_count);
     $toptitle = '订单显示页面';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 0);
     $threelevel = '1';
     //当前的三级菜单
     $this->smarty->assign('threelevel', $threelevel);
     $statusMenu = $omAvailableAct->act_getTNameList('om_status_menu', ' * ', 'WHERE is_delete=0 ');
     $this->smarty->assign('statusMenu', $statusMenu);
     //var_dump($data); exit;
     $this->smarty->display('eubTheLineApply.htm');
 }
コード例 #12
0
ファイル: orderRefund.view.php プロジェクト: ohjack/newErp
 public function view_orderRefundList()
 {
     global $memc_obj;
     $pagesize = 200;
     //页面大小
     //菜单
     $status = '';
     //print_r($_GET);
     //搜索时使用的数据
     //order表
     $searchPlatformId = isset($_GET['platformId']) ? $_GET['platformId'] : '';
     //搜索平台
     $searchRefundType = isset($_GET['refundType']) ? $_GET['refundType'] : '';
     //退款类型
     $searchRefundStatus = isset($_GET['refundStatus']) ? $_GET['refundStatus'] : '';
     //
     $searchOmOrderId = isset($_GET['omOrderId']) ? $_GET['omOrderId'] : '';
     //订单编号
     $searchTransId = isset($_GET['transId']) ? $_GET['transId'] : '';
     //交易ID
     $searchApplyTime1 = isset($_GET['applyTime1']) ? $_GET['applyTime1'] : '';
     //初始时间
     $searchApplyTime2 = isset($_GET['applyTime2']) ? $_GET['applyTime2'] : '';
     //结束时间
     $status = isset($_GET['status']) ? $_GET['status'] : 0;
     //操作状态
     $orderType = isset($_GET['orderType']) ? $_GET['orderType'] : 1;
     //单据种类
     $ostatus = isset($_GET['ostatus']) ? $_GET['ostatus'] : 0;
     //一级分类
     //echo "------------------$searchOmOrderId----------------";
     $where = ' where is_delete=0 ';
     if ($searchPlatformId != '') {
         $where .= ' AND platformId = ' . $searchPlatformId;
     }
     if ($searchRefundType != '') {
         $where .= ' AND refundType = ' . $searchRefundType;
     }
     if ($searchTransId != '') {
         $where .= ' AND transId = ' . $searchTransId;
     }
     if ($searchOmOrderId != '') {
         $where .= ' AND omOrderId = ' . $searchOmOrderId;
     }
     if ($status != '') {
         $where .= ' AND status = ' . $status;
     }
     if ($searchApplyTime1 != '' && $searchApplyTime2 != '') {
         $where .= ' AND addTime >= "' . strtotime($searchApplyTime1) . '" AND addTime <= "' . strtotime($searchApplyTime2) . '" ';
     }
     $accountList = $_SESSION['accountList'];
     $platformList = $_SESSION['platformList'];
     //echo "<pre>"; print_r($accountList); exit;
     $platformsee = array();
     for ($i = 0; $i < count($platformList); $i++) {
         $platformsee[] = $platformList[$i];
     }
     if ($platformsee) {
         $where .= ' AND platformId IN (' . join(",", $platformsee) . ') ';
     } else {
         $where .= " AND 1=2 ";
     }
     $accountsee = array();
     for ($i = 0; $i < count($accountList); $i++) {
         $accountsee[] = $accountList[$i];
     }
     if ($accountsee) {
         $where .= ' AND accountId IN (' . join(",", $accountsee) . ') ';
     } else {
         $where .= " AND 1=2 ";
     }
     $this->smarty->assign('searchPlatformId', $searchPlatformId);
     $this->smarty->assign('searchRefundType', $searchRefundType);
     $this->smarty->assign('searchRefundStatus', $searchRefundStatus);
     $this->smarty->assign('searchOmOrderId', $searchOmOrderId);
     $this->smarty->assign('searchTransId', $searchTransId);
     $this->smarty->assign('searchApplyTime1', $searchApplyTime1);
     $this->smarty->assign('searchApplyTime2', $searchApplyTime2);
     $omAvailableAct = new OrderRefundAct();
     $OrderindexAct = new OrderindexAct();
     //平台信息
     $OmAccountAct = new OmAccountAct();
     $WarehouseAPIAct = new WarehouseAPIAct();
     $AbOrderList = $WarehouseAPIAct->act_getAbOrderList();
     //var_dump($AbOrderList); exit;
     $AbOrderListArr = array();
     $AbOrderids = array();
     $AbOrderShow = array();
     foreach ($AbOrderList as $orderId) {
         $AbOrderInfo = $WarehouseAPIAct->act_getAbOrderInfo($orderId['id']);
         $AbOrderListArr[$orderId['originOrderId']] = $AbOrderInfo;
         $AbOrderids[] = $orderId['originOrderId'];
         $AbOrderShow[$orderId['originOrderId']] = $orderId['id'];
     }
     //var_dump($AbOrderListArr); exit;
     $this->smarty->assign('AbOrderListArr', $AbOrderListArr);
     $this->smarty->assign('AbOrderShow', $AbOrderShow);
     //$platform	=  $omAvailableAct->act_getTNameList('om_platform','id,platform','WHERE is_delete=0');
     $platform = $OmAccountAct->act_getPlatformListByPower();
     $this->smarty->assign('platform', $platform);
     /**导航 start**/
     $this->smarty->assign('ostatus', $ostatus);
     $this->smarty->assign('status', $status);
     $this->smarty->assign('refund_status', $status);
     $StatusMenuAct = new StatusMenuAct();
     $ostatusList = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = 0 AND is_delete=0');
     /*var_dump($ostatusList);*/
     $this->smarty->assign('ostatusList', $ostatusList);
     //二级目录
     /*$o_secondlevel =  $omAvailableAct->act_getTNameList('om_status_menu','*','WHERE is_delete=0 and groupId=0 order by sort asc');
     		$this->smarty->assign('o_secondlevel', $o_secondlevel);*/
     $second_count = array();
     $second_type = array();
     foreach ($ostatusList as $o_secondinfo) {
         $orderStatus = $o_secondinfo['statusCode'];
         //echo $orderStatus."============"; echo "<br>";
         $s_total = $OrderindexAct->act_showSearchOrderNum($orderStatus);
         //echo $orderStatus."==".$s_total; echo "<br>";
         $second_count[$o_secondinfo['statusCode']] = $s_total;
         $s_type = $StatusMenuAct->act_getStatusMenuList('statusCode,statusName', 'WHERE groupId = "' . $orderStatus . '" AND is_delete=0 order by sort asc');
         $second_type[$orderStatus] = $s_type[0]['statusCode'];
     }
     $this->smarty->assign('second_count', $second_count);
     $this->smarty->assign('second_type', $second_type);
     //退款数量
     //echo $where;
     //$refund_total = $omAvailableAct->act_getTNameCount("om_order_refund", " where is_delete=0 ");
     $refund_total = $omAvailableAct->act_getRecordNums();
     $this->smarty->assign('refund_total', $refund_total);
     $parameterArr = array();
     //var_dump($AbOrderids);
     $parameterArr['AbOrderList'] = $AbOrderids;
     $total = $OrderindexAct->act_showABOrder($ostatus, $otype, '', $parameterArr);
     $this->smarty->assign('abnormal_total', $total);
     //三级目录
     /*$refund_one = $omAvailableAct->act_getTNameCount("om_order_refund",$where." and status=0");
     		$this->smarty->assign('refund_one', $refund_one);
     		$refund_two = $omAvailableAct->act_getTNameCount("om_order_refund",$where." and status=1");
     		$this->smarty->assign('refund_two', $refund_two);
     		$refund_three = $omAvailableAct->act_getTNameCount("om_order_refund",$where." and status=2");
     		$this->smarty->assign('refund_three', $refund_three);*/
     /**导航 end**/
     $refund_status = array('671' => array(1, 0), '673' => array(1, 1), '674' => array(1, 2), '675' => array(2, 0), '676' => array(2, 1), '677' => array(2, 2), '678' => array(3, 0), '679' => array(3, 1));
     $o_threelevel = $omAvailableAct->act_getTNameList("om_status_menu", "*", "WHERE is_delete=0 and groupId='{$ostatus}' order by sort asc");
     //var_dump($o_threelevel);
     $extral_str = array();
     foreach ($o_threelevel as $o_threeinfo) {
         $statusCode = $o_threeinfo['statusCode'];
         $torderType = $refund_status[$statusCode][0];
         $tostatus = $refund_status[$statusCode][1];
         $where = " WHERE orderType = '{$torderType}' and status = '{$tostatus}' and is_delete = 0 ";
         //echo $where; echo "<br>";
         $s_total = $omAvailableAct->act_getRecordNums($where);
         //$s_total = $omAvailableAct->act_getTNameCount("om_unshipped_order", $or_where);
         $three_count[$o_threeinfo['statusCode']] = $s_total;
         $extral_str[$o_threeinfo['statusCode']] = "orderType={$torderType}&status={$tostatus}";
     }
     $this->smarty->assign('extral_str', $extral_str);
     $this->smarty->assign('o_threelevel', $o_threelevel);
     $this->smarty->assign('three_count', $three_count);
     $toptitle = '退款操作页面';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 0);
     $threelevel = '1';
     //当前的三级菜单
     $this->smarty->assign('threelevel', $threelevel);
     $statusMenu = $omAvailableAct->act_getTNameList('om_status_menu', ' * ', 'WHERE is_delete=0');
     $this->smarty->assign('statusMenu', $statusMenu);
     //print_r($orderRefundList);//exit;
     //$where =	' WHERE is_delete = 0 '.$where;
     $where = " WHERE orderType = '{$orderType}' and status = '{$status}' and is_delete = 0 ";
     //echo $where;
     //$total = $omAvailableAct->act_getTNameCount('om_order_refund', $where);
     $total = $omAvailableAct->act_getRecordNums($where);
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     //$where .= " ORDER BY id " . $page->limit;
     //$orderRefundList = $omAvailableAct->act_getTNameList('om_order_refund', '*', $where);
     $orderRefundList = $omAvailableAct->act_getRefundList($where);
     //echo $where;
     if (empty($orderRefundList)) {
         $orderRefundList = array();
     }
     $this->smarty->assign('orderRefundList', $orderRefundList);
     $where = ' WHERE is_delete = 0 ';
     //$where = ' WHERE is_delete = 0 AND orderRefundId in('.$value.') '.$where;
     if (!empty($orderRefundList)) {
         foreach ($orderRefundList as $k => $v) {
             if ($value == '') {
                 $value = $v['id'];
             } else {
                 $value .= ',' . $v['id'];
             }
         }
         $where = ' WHERE is_delete = 0 AND orderRefundId in(' . $value . ') ';
     } else {
         $where .= " AND 1=2 ";
     }
     $orderRefundDetailList = $omAvailableAct->act_getTNameList('om_order_refund_detail', '*', $where);
     /*if(empty($orderRefundDetailList)){
     			$status	=	'无符合条件的订单';
     			$this->smarty->assign('status', $status);
     			$this->smarty->display('orderRefund.htm.htm');
     			exit;
     		}*/
     //print_r($orderRefundDetailList);
     if (empty($orderRefundDetailList)) {
         $orderRefundDetailList = array();
     }
     $this->smarty->assign('orderRefundDetailList', $orderRefundDetailList);
     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));
     }
     //获取系统所有状态
     $statusList = copyOrderModel::selectStatusList();
     $this->smarty->assign('status', $status);
     $this->smarty->assign('statusList', $statusList);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('account', $account);
     $this->smarty->assign('sku', $sku);
     $this->smarty->assign('pm', $pm);
     $this->smarty->assign('orderdEtailExtensionEbay', $orderdEtailExtensionEbay);
     $this->smarty->assign('omOrderList', $omOrderList);
     $this->smarty->assign('omOrderDetail', $omOrderDetail);
     //$this->smarty->assign('orderTracknumber', $orderTracknumber);
     $this->smarty->assign('omOrderExtensionEbay', $omOrderExtensionEbay);
     $this->smarty->assign('omOrderUserInfo', $omOrderUserInfo);
     $this->smarty->display('orderRefund.htm');
 }
コード例 #13
0
ファイル: orderInfo.model.php プロジェクト: ohjack/newErp
 public static function resendOrder($orderid, $note, $type, $old_ostatus, $old_otype)
 {
     !self::$dbConn ? self::initDB() : NULL;
     BaseModel::begin();
     //开始事务
     //$tableName = 'om_unshipped_order';
     //echo $old_ostatus; echo "<br>";
     //echo $old_otype; echo "<br>";
     $StatusMenuAct = new StatusMenuAct();
     $tableName = $StatusMenuAct->act_getOrderNameByStatus($old_ostatus, $old_otype);
     //echo $tableName;
     if ($type == 1) {
         $updatesql = 'update ' . $tableName . ' set isBuji=1,isCopy=1 where id=' . $orderid . ' and is_delete = 0 and storeId = 1';
     } else {
         $updatesql = 'update ' . $tableName . ' set isCopy=1 where id=' . $orderid . ' and is_delete = 0 and storeId = 1';
     }
     if (!self::$dbConn->query($updatesql)) {
         //更新状态失败
         BaseModel::rollback();
         self::$dbConn->query('SET AUTOCOMMIT=1');
         self::$errCode = '003';
         self::$errMsg = '订单信息不存在,无法复制!';
         return FALSE;
     }
     //产生新订单
     $where = ' WHERE id = ' . $orderid . ' and is_delete = 0 and storeId = 1';
     $orderData = OrderindexModel::showOrderList($tableName, $where);
     $orderDetail = $orderData[$orderid]['orderDetail'];
     if (!$orderDetail) {
         //更新状态失败
         BaseModel::rollback();
         self::$dbConn->query('SET AUTOCOMMIT=1');
         return FALSE;
     }
     $insert_orderDetail = array();
     foreach ($orderDetail as $detail) {
         $insert_orderDetailData = $detail['orderDetailData'];
         unset($insert_orderDetailData['id']);
         $insert_orderDetailExtenData = $detail['orderDetailExtenData'];
         unset($insert_orderDetailExtenData['omOrderdetailId']);
         $insert_orderDetail[] = array('orderDetailData' => $insert_orderDetailData, 'orderDetailExtenData' => $insert_orderDetailExtenData);
     }
     $obj_order_data = $orderData[$orderid]['orderData'];
     if ($obj_order_data['isBuji'] == 2) {
         self::$errCode = '003';
         self::$errMsg = "补寄产生订单不能补寄!";
         BaseModel::rollback();
         self::$dbConn->query('SET AUTOCOMMIT=1');
         return FALSE;
     }
     if ($obj_order_data['isCopy'] == 2) {
         self::$errCode = '003';
         self::$errMsg = "复制产生订单不能复制!";
         BaseModel::rollback();
         self::$dbConn->query('SET AUTOCOMMIT=1');
         return FALSE;
     }
     unset($obj_order_data['id']);
     $orderExtenData = $orderData[$orderid]['orderExtenData'];
     unset($orderExtenData['omOrderId']);
     $orderUserInfoData = $orderData[$orderid]['orderUserInfoData'];
     unset($orderExtenData['omOrderId']);
     if ($type == 1) {
         $obj_order_data['isCopy'] = 2;
         $obj_order_data['actualTotal'] = 0.0;
     } else {
         $obj_order_data['isCopy'] = 2;
         $obj_order_data['isBuji'] = 2;
         $obj_order_data['actualTotal'] = 0.0;
         $obj_order_data['orderStatus'] = C('STATEBUJI');
         $obj_order_data['orderType'] = C('STATEBUJI_DONE');
     }
     $orderNote = array('content ' => $note, 'userId' => $_SESSION['sysUserId'], 'createdTime' => time());
     $insert_orderData = array();
     $insert_orderData = array('orderData' => $obj_order_data, 'orderExtenData' => $orderExtenData, 'orderUserInfoData' => $orderUserInfoData, 'orderDetail' => $insert_orderDetail, 'orderNote' => $orderNote);
     //$orderNote = $orderData['orderNote'];
     //echo $insertsql;
     //var_dump($insert_orderData); exit;
     if ($insertId = OrderAddModel::insertAllOrderRowNoEvent($insert_orderData)) {
         //echo $split_log .= 'insert success!' . "\n"; exit;
         //var_dump($_mainId,$_spitId); exit;
         if (!OrderLogModel::insertOrderLog($insertId, '补寄产生订单')) {
             BaseModel::rollback();
             self::$errCode = '001';
             self::$errMsg = "补寄失败!";
             return false;
         }
         if (!OrderRecordModel::insertSendRecords($orderid, $insertId)) {
             BaseModel::rollback();
             self::$errCode = '002';
             self::$errMsg = "补寄失败添加记录失败!";
             return false;
         }
     } else {
         //$split_log .= '补寄新订单产生失败!' . "\n";
         BaseModel::rollback();
         self::$errCode = '003';
         self::$errMsg = "补寄新订单产生失败";
         return false;
     }
     BaseModel::commit();
     self::$errCode = '200';
     self::$errMsg = "补寄新订单成功!";
     return TRUE;
 }