コード例 #1
0
ファイル: orderAdd.view.php プロジェクト: ohjack/newErp
 public function view_addOrder()
 {
     $OmAccountAct = new OmAccountAct();
     $state = isset($_GET['state']) ? post_check($_GET['state']) : '';
     $this->smarty->assign('state', $state);
     //平台
     //$platform_lsit = OmAvailableModel::getTNameList("om_platform","*","where is_delete=0");
     $platform_lsit = $OmAccountAct->act_getPlatformListByPower();
     $tmpPlatformList = array();
     foreach ($platform_lsit as $value) {
         if (in_array($value['id'], array(3))) {
             $tmpPlatformList[] = $value;
         }
     }
     $platform_lsit = $tmpPlatformList;
     $this->smarty->assign('platform_lsit', $platform_lsit);
     //账号
     //$account_lsit = OmAvailableModel::getTNameList("om_account","*","where is_delete=0 and platformId=3");
     $account_lsit = $OmAccountAct->act_getAccountListByPlatform();
     $account_lsit = array();
     $this->smarty->assign('account_lsit', $account_lsit);
     //物流
     $Shiping = CommonModel::getCarrierList();
     $this->smarty->assign('Shiping', $Shiping);
     $toplevel = 2;
     //一级菜单的序号
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = 21;
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('toptitle', '订单添加');
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('orderAdd.htm');
 }
コード例 #2
0
ファイル: orderAdd.action.php プロジェクト: ohjack/newErp
 function act_sureAddOrder()
 {
     $order_data = array();
     $detail_data = array();
     $exten_data = array();
     $userinfo_data = array();
     $buyer_data = array();
     $time = time();
     $platform_id = trim($_POST['platform']);
     $username = trim($_POST['fullname']);
     $account_id = trim($_POST['account']);
     $street1 = trim($_POST['street1']);
     $platformUsername = trim($_POST['userid']);
     $email = trim($_POST['ebay_usermail1']);
     $street2 = trim($_POST['street2']);
     $recordNumber = trim($_POST['orderid']);
     $city = trim($_POST['city']);
     $ordersTime = strtotime(trim($_POST['ebay_createdtime']));
     $state = trim($_POST['state']);
     $paymentTime = strtotime(trim($_POST['ebay_paidtime']));
     $countryname = trim($_POST['country']);
     $ebay_itemprice = trim($_POST['ebay_itemprice']);
     $zipCode = trim($_POST['zip']);
     $shippingFee = trim($_POST['ebay_shipfee']);
     $ebay_tel1 = trim($_POST['tel1']);
     $actualTotal = trim($_POST['ebay_total']);
     $ebay_tel2 = trim($_POST['tel2']);
     $ebay_tel3 = trim($_POST['tel3']);
     $currency = trim($_POST['ebay_currency']);
     $other_currency = trim($_POST['other_currency']);
     $isCheckOrder = self::act_checkOrder();
     $returnArr = array();
     //返回的数组信息
     if (!$isCheckOrder) {
         $returnArr['errCode'] = self::$errCode;
         $returnArr['errMsg'] = self::$errMsg;
         return $returnArr;
     }
     if ($currency == '其他') {
         $currency = $other_currency;
     }
     $phone = trim($_POST['tel1']);
     $transId = trim($_POST['ebay_ptid']);
     $other_ptid = trim($_POST['other_ptid']);
     if ($transId == 'paypal' || $transId == 'Escrow' || $transId == '其他') {
         $transId = $other_ptid;
     }
     $PayPalPaymentId = $transId;
     $orderweight = trim($_POST['orderweight']);
     $ebay_usermail2 = trim($_POST['ebay_usermail2']);
     $ebay_carrier = trim($_POST['ebay_carrier']);
     $ebay_usermail3 = trim($_POST['ebay_usermail3']);
     $ebay_tracknumber = trim($_POST['ebay_tracknumber']);
     $ebay_noteb = trim($_POST['ebay_noteb']);
     $orderStatus = 100;
     $orderType = 101;
     $tracknumber = trim($_POST['ebay_tracknumber']);
     //order信息
     $orderData[$recordNumber]['orderData']['recordNumber'] = $recordNumber;
     $orderData[$recordNumber]['orderData']['ordersTime'] = $ordersTime;
     $orderData[$recordNumber]['orderData']['paymentTime'] = $paymentTime;
     $orderData[$recordNumber]['orderData']['actualTotal'] = $actualTotal;
     $orderData[$recordNumber]['orderData']['onlineTotal'] = $actualTotal;
     //默认线上总价和实际总价一样
     $orderData[$recordNumber]['orderData']['orderAddTime'] = time();
     //$orderData[$recordNumber]['orderData']['calcWeight'] = $orderweight;//估算重量
     $orderData[$recordNumber]['orderData']['accountId'] = $account_id;
     $orderData[$recordNumber]['orderData']['platformId'] = $platform_id;
     //添加状态信息
     $orderData[$recordNumber]['orderData']['orderStatus'] = 100;
     $orderData[$recordNumber]['orderData']['orderType'] = 101;
     $SYS_ACCOUNTS = OmAvailableModel::getPlatformAccount();
     foreach ($SYS_ACCOUNTS as $platform => $accounts) {
         foreach ($accounts as $accountId => $accountname) {
             if ($account_id == $accountId) {
                 if ($platform == 'ebay') {
                     //为ebay平台
                     $orderData[$recordNumber]['orderData']['isFixed'] = 2;
                 } else {
                     $orderData[$recordNumber]['orderData']['isFixed'] = 1;
                 }
             }
         }
     }
     $transportation = CommonModel::getCarrierList();
     //所有的
     foreach ($transportation as $tranValue) {
         if ($tranValue['id'] == $ebay_carrier) {
             $orderData[$recordNumber]['orderData']['transportId'] = $tranValue['id'];
             break;
         }
     }
     //order扩展信息
     $orderData[$recordNumber]['orderExtenData']['currency'] = $currency;
     $orderData[$recordNumber]['orderExtenData']['paymentStatus'] = "PAY_SUCCESS";
     //$orderData[$recordNumber]['orderExtenData']['transId']			    =	$transId;
     $orderData[$recordNumber]['orderExtenData']['PayPalPaymentId'] = $PayPalPaymentId;
     $orderData[$recordNumber]['orderExtenData']['platformUsername'] = $platformUsername;
     //user信息
     $orderData[$recordNumber]['orderUserInfoData']['platformUsername'] = $platformUsername;
     $orderData[$recordNumber]['orderUserInfoData']['username'] = $username;
     $orderData[$recordNumber]['orderUserInfoData']['email'] = $email;
     $orderData[$recordNumber]['orderUserInfoData']['street'] = $street1;
     $orderData[$recordNumber]['orderUserInfoData']['currency'] = $currency;
     $orderData[$recordNumber]['orderUserInfoData']['address2'] = $street2;
     $orderData[$recordNumber]['orderUserInfoData']['city'] = $city;
     $orderData[$recordNumber]['orderUserInfoData']['state'] = $state;
     $orderData[$recordNumber]['orderUserInfoData']['zipCode'] = $zipCode;
     $orderData[$recordNumber]['orderUserInfoData']['countryName'] = $countryname;
     $orderData[$recordNumber]['orderUserInfoData']['landline'] = !empty($ebay_tel2) ? $ebay_tel2 : $ebay_tel3;
     $orderData[$recordNumber]['orderUserInfoData']['phone'] = $phone;
     //note信息
     if (!empty($ebay_noteb)) {
         $orderData[$recordNumber]['orderNote']['content'] = $ebay_noteb;
         $orderData[$recordNumber]['orderNote']['userId'] = $_SESSION['sysUserId'];
         $orderData[$recordNumber]['orderNote']['createdTime'] = time();
     }
     //tracknumer信息
     $orderData[$recordNumber]['orderTrack']['tracknumber'] = $tracknumber;
     $sku_list = $_POST['sku'];
     $sku_count = $_POST['qty'];
     $ebay_itemtitle = $_POST['name'];
     $count = count($sku_list);
     for ($i = 0; $i < $count; $i++) {
         //detail信息
         $sku = $sku_list[$i];
         $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['sku'] = $sku_list[$i];
         $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['amount'] += $sku_count[$i];
         //累加
         $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['recordNumber'] = $recordNumber;
         $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['createdTime'] = time();
         $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['itemTitle'] = $ebay_itemtitle[$i];
     }
     foreach ($orderData as $id => $order) {
         //$orderData 中第一维只有一个元素,方便起见这里用foreach,虽然只循环一次
         $ret = commonModel::checkOrder($recordNumber);
         if ($ret) {
             $returnArr['errCode'] = 101;
             $returnArr['errMsg'] = "订单{$recordNumber}已存在!";
             return $returnArr;
         }
         //计算订单属性
         if (count($order['orderDetail']) == 1) {
             $detail = current($order['orderDetail']);
             if ($detail['orderDetailData']['amount'] == 1) {
                 $orderData[$id]['orderData']['orderAttribute'] = 1;
             } else {
                 $orderData[$id]['orderData']['orderAttribute'] = 2;
             }
         } else {
             $orderData[$id]['orderData']['orderAttribute'] = 3;
         }
         //计算订单重量及包材
         $obj_order_detail_data = array();
         foreach ($order['orderDetail'] as $sku => $detail) {
             $obj_order_detail_data[] = $detail['orderDetailData'];
         }
         $weightfee = commonModel::calcOrderWeight($obj_order_detail_data);
         $orderData[$id]['orderData']['calcWeight'] = $weightfee[0];
         $orderData[$id]['orderData']['pmId'] = $weightfee[1];
         $calcShippingInfo = CommonModel::calcAddOrderShippingFee($orderData[$id], $orderData[$id]['orderData']['isFixed']);
         //计算运费
         $orderData[$id]['orderData']['channelId'] = $calcShippingInfo['channelId'];
         $orderData[$id]['orderData']['calcShipping'] = $calcShippingInfo['fee'];
         //调用旧系统接口,先插入数据到旧系统
         $rtn = OldsystemModel::orderErpInsertorder($orderData[$id]);
         $insertData = array();
         if (empty($rtn)) {
             $returnArr['errCode'] = 102;
             $returnArr['errMsg'] = "接口返回异常,请重试!";
             return $returnArr;
         }
         if ($rtn['errcode'] == 200) {
             $rtn_data = $rtn['data'];
             $orderId = $rtn_data['orderId'];
             //echo "插入老系统成功,订单编号 [$orderId] \n";
             $pmId = $rtn_data['pmId'];
             $totalweight = $rtn_data['totalweight'];
             $shipfee = $rtn_data['shipfee'];
             $carrier = $rtn_data['carrier'];
             $carrierId = $rtn_data['carrierId'];
             $status = $rtn_data['status'];
             $orderData[$id]['orderData']['id'] = $orderId;
             //赋予新系统订单编号
             if ($orderData['orderData']['calcWeight'] != $totalweight) {
                 $insertData['old_totalweight'] = $totalweight;
                 $insertData['new_totalweight'] = $orderData[$id]['orderData']['calcWeight'];
                 $orderData[$id]['orderData']['calcWeight'] = $totalweight;
             }
             if ($orderData['orderData']['pmId'] != $pmId) {
                 $insertData['old_pmId'] = $pmId;
                 $insertData['new_pmId'] = $orderData[$id]['orderData']['pmId'];
                 $orderData[$id]['orderData']['pmId'] = $pmId;
             }
             if ($orderData['orderData']['calcShipping'] != $shipfee) {
                 $insertData['old_shippfee'] = $shipfee;
                 $insertData['new_shippfee'] = $orderData[$id]['orderData']['calcShipping'];
                 $orderData[$id]['orderData']['calcShipping'] = $shipfee;
             }
             if ($orderData['orderData']['transportId'] != $carrierId) {
                 $insertData['old_carrierId'] = $carrierId;
                 $insertData['new_carrierId'] = $orderData[$id]['orderData']['transportId'];
                 $orderData[$id]['orderData']['transportId'] = $carrierId;
             }
             if (!empty($insertData)) {
                 $insertData['ebay_id'] = $orderId;
                 $insertData['addtime'] = time();
                 //var_dump($insertData);
                 OldsystemModel::insertTempSyncRecords($insertData);
                 // 插入临时对比记录表
             }
             //缺货拦截
             $orderData[$id] = AutoModel::auto_contrast_intercept($orderData[$id]);
             //插入订单
             $info = OrderAddModel::insertAllOrderRowNoEvent($orderData[$id]);
             if ($info) {
                 $returnArr['errCode'] = 200;
                 $returnArr['errMsg'] = "订单{$id}上传成功!";
             } else {
                 $returnArr['errCode'] = 404;
                 $returnArr['errMsg'] = "订单{$id}上传失败!";
             }
         } else {
             $returnArr['errCode'] = 400;
             $returnArr['errMsg'] = "添加失败,原因为:{$rtn['msg']}!";
         }
     }
     return $returnArr;
 }
コード例 #3
0
ファイル: excelExport.action.php プロジェクト: ohjack/newErp
 public function act_eubTrucknumber()
 {
     date_default_timezone_set("Asia/Chongqing");
     error_reporting(0);
     $transportationlist = CommonModel::getCarrierList();
     $transportation = array();
     foreach ($transportationlist as $k1 => $v1) {
         $transportation[$v1['id']] = $v1['carrierNameCn'];
     }
     /*
             $strOrder = '';
             $arr_orders   = array();
             $arr_accounts   = array();
             $arr_records = explode(',', $strTxet);
             foreach ($arr_records as $k => $v) {
                 list($order,$account) = explode('--', $v);
                 $arr_orders[] = $order;
                 $arr_accounts[] = $account;
                 $strOrder .= "','".$order;
             }
             echo "<pre>";
             echo $strOrder;
             //print_r($arr_orders);
             //print_r($arr_accounts);
             exit;*/
     /*$table = " `om_unshipped_order_detail` AS b 
                 LEFT JOIN `om_unshipped_order` AS a  ON a.id = b.omOrderId
                 LEFT JOIN `om_unshipped_order_userInfo` AS c ON a.id = c.omOrderId
                 LEFT JOIN `om_unshipped_order_extension_aliexpress` AS d ON a.id = d.omOrderId
                 LEFT JOIN `om_unshipped_order_detail_extension_aliexpress` AS e ON b.id = e.omOrderdetailId 
                 LEFT JOIN `om_order_tracknumber` as f ON a.id = f.omOrderId 
                 LEFT JOIN `om_account` AS g ON a.accountId = g.id ";
             
             $field = " a.recordNumber,g.account,c.platformUsername,a.ordersTime,a.paymentTime,a.onlineTotal,a.actualShipping,a.actualTotal,d.currency,a.calcWeight,d.declaredPrice,d.PayPalPaymentId,b.sku,b.amount,e.itemTitle,d.feedback,c.username,c.countryName,c.state,c.city,c.street,c.zipCode,c.landline,c.phone,a.transportId ";
     
             $where = " WHERE a.platformId = '16' AND a.orderAddTime > '1394035200' AND  a.orderAddTime < '1394467200' ";
     
             $omAvailableAct  = new OmAvailableAct();          
             $unShipOrderList =  $omAvailableAct->act_getTNameList($table, $field, $where);
     
             foreach ($unShipOrderList as $k2 => $v2) { //key代表最外层的维数           
                 $detail = $v;
                 $detail['transportName'] = $transportation[$v2['transportId']];
     
                 unset($detail['transportId']);
     
                 $excel->addRow($detail);
             }
     
     
             echo "<pre>";
             print_r($unShipOrderList);
             exit;*/
     $fileName = "UnShipments" . date('Y-m-d') . ".xls";
     $excel = new ExportDataExcel('browser', $fileName);
     $excel->initialize();
     $row = array('订单编号', '买家名称', '买家邮箱1', '买家邮箱2', '买家邮箱3', '下单时间', '付款时间', '产品总金额', '物流费用', '订单金额', '币种', 'Transaction ID', '申报价值', '估算重量', 'SKU', '数量', '产品名称', '订单备注', '收货人名称', '收货国家', '州/省', '城市', '地址', '邮编', '联系电话1', '联系电话2', '联系电话3', '手机', '买家选择物流', '平台账号', '跟踪号');
     $excel->addRow($row);
     $table = " `om_shipped_order_detail` AS b  \n            LEFT JOIN `om_shipped_order` AS a  ON a.id = b.omOrderId\n            LEFT JOIN `om_shipped_order_userInfo` AS c ON a.id = c.omOrderId\n            LEFT JOIN `om_shipped_order_extension_aliexpress` AS d ON a.id = d.omOrderId\n            LEFT JOIN `om_shipped_order_detail_extension_aliexpress` AS e ON b.id = e.omOrderdetailId LEFT JOIN `om_order_tracknumber` as f ON a.id = f.omOrderId \n            LEFT JOIN `om_account` AS g ON a.accountId = g.id \n            LEFT JOIN `om_order_notes` AS h ON a.id = h.omOrderId ";
     $field = " a.recordNumber,a.ordersTime,a.paymentTime,a.onlineTotal,a.actualShipping,a.actualTotal,a.calcWeight,a.transportId,d.declaredPrice,d.PayPalPaymentId,b.sku,b.amount,e.itemTitle,d.feedback,c.platformUsername,c.email,c.username,c.countryName,c.currency,c.state,c.city,c.street,c.zipCode,c.landline,c.phone,f.tracknumber,g.account,h.content ";
     $where = " WHERE a.recordNumber in ('559220080488213','61291048149790','61291014326917','61285636311954','61299676786510','61257847770012','1171653376007','1342566038012','1342550690012','1342524909012','1342515426012','1342413527012','1342399574012','1342390599012','1342367093012','1342314002012','1342310983012','1342290240012','1342133149012','1342120869012','1342118622012','1342081543012','1172474925007','1172315504007','1172299770007','1172296184007','1172272680007','1172232882007','1172223365007','1172182526007','1172126469007','558981387361611','558487478479670','558460023922925','557494022572438','DD14030800858','DD14030800269','DD14030800028','DD14030800525','DD14030800473','DD14030800333','DD14030800327','DD14030800255','DD14030800252','DD14030800222','DD14030800123','DD14030800120','DD14030800114','DD14030800111','DD14030701909','DD14030701900','DD14030701897','DD14030701870','DD14030701862','DD14030701825','DD14030701804','DD14030701724','DD14030701628','DD14030701582','DD14030701521','DD14030701456','DD14030701453','DD14030800027','DD14030701839','DD14030701759','171854-1','171795-1','21230-1','21221-1','61300512856554','DD14030600356','560386182450074','560445368025526','560735706789508','tt26353  clock-maker-2003','557295691973440','560574194439744','560875202763990','560762748300826','559871057882405','1171983566007','559987766894519','558843852813198','026-2038948-1825953','560195307202708','560118439761577','560614570129474','560604162366800','61233033960335','61225401138144','61275776866334','61283751550514','61284381471047','61271644078579','61285971256188','61286694581510','61286457896555','61273360806194','61287102116285','61288784939131','61289515402687','61290457641996','61291268481630','61292236773732','61278564524075','61298273217872','61284209829125','61300945144583','61271728212854','61303225891249','61266347810315','61282400441698','61257905772517','61283695281297','61273648438832','61279523250615','61297173545612','61300390671128','61301813182124','61283752032239','61284146363591','61287931644618','61293690836849','61299950555255','61300354697689','61288949877623','61286041305506','61301553743972','61277379550615','61294274238692','61281604636692','61261903830103','61257008371173','61275686039202','61291354923312','61291893569713','61278566094239','61278769877617','61293864388329','61282765315776','61298697699029','61284928938443','61299558787159','61302422095276','61272643402639','202-8393434-1143552','224697','188403','026-9661670-0337959','58452','223786','223741','220371','188117','186781','188235','223689','218802','197544','188074','60262','558246027770826','528226','223407','218656','101770','1341546884012','1760855','176832','526693','219168','CN100013211','222168','61270307460048','105-8385470-2341026','106-8240274-1106603','523208','218133','61274545010953','61280384012104','61281919468547','61285998314076','61278855631594','61280505522639','61268603902803','61219012417370','61279110037621','61274064981817','61264566746663','61279266542058','61282198497751','61283350036547','61275139782894','61276103852273','61280872818965','61280057928870','61278504882195','61281135133896','61281392411898','61281294973925','61268565467244','61282631771728','61269563947797','61279838412445','61274342499990','61263606811067','61274785500124','61222565934461','26354','26356','26349','26345  jerikavazquezbermudez','61275958205863','61269285568291','61270402108315','61274339549496','61274546569687','61274802947529','61275751827350','61262847093901','61276629817558','61278175910616','61266721802310','61279901031227','61280690942912','61286380743625','61297839638906','61307624738338','61277028514524','61261240188489','61299055455120','26335','DD14030700132','DD14030601731','DD14030601397','DD14030601302','DD14030601298','DD14030700978','DD14030700788','DD14030700499','DD14030700332','DD14030700214','DD14030700204','DD14030601996','DD14030601838','DD14030601748','DD14030601585','DD14030601395','DD14030601384','DD14030601297','DD14030601284','DD14030700241','DD14030700069','DD14030601842','DD14030601707','171767','171755','171731','171724','171716','171676','21193','171659','171636','23640','10060#EF14030600078#00001','10058#EF14030600033#00001','10053#ED14030500099#00003','10052#ED14030500099#00002','10052#CIC14030600011#00001','10051#EF14030600007#00002','10050#EF14030600001#00004','10039#ED14022800279#00001','61288625724862','61301695017139','61262016159344','61268148743481','61302659500997','61281583119393','61286067476828','61273077999487','61288025605103','1325','1324','1323','1319','1318','1317','1341033505012','1341009132012','1341824240012','1341696946012','1341694163012','1341575187012','1341552132012','1171516107007','1171507984007','1171492136007','1171575046007','1172017468007','1172004350007','1171994219007','1171984578007','1171926583007','1171924919007','1171904569007','1171903716007','1171840428007','1171820921007','1171933127007','1341496314012','1341452776012','1341430719012','1341387307012','1341344799012','1341318614012','1341248976012','1341228817012','1341187566012','1341113133012','1171038439007','1171033243007','1170993495007','1171481958007','1171474896007','1171472379007','1171457400007','1171449215007','1171447905007','1171416970007','1171251355007','1171196353007','1171165850007','1171147108007','1171039940007','26337','DL00063245','61281572272997','61280185621112','558897626662002','559457550085319','559964179142377','559936580977023','559364883586789','558042806763467','557981705438975','558266733802235','558198507852622','557953639231007','557957714549391','557958516721499','557183300613704','557882892610971','557616359665851','1171017114007','1171004617007','1170988981007','1170976546007','1170433249007','558951559459508','559400560676789','559630880572235','559540508725117','559070020338919','558834837695702','1169337760','5581989066539311','558007554317350','559143459057814','1456015806','1456031064','558064192600975','1168657452','CYBS06140309','559167238163972','557996971531592','557659877402622','558001924546789','557729957608803','558094428083493','558167306158085','558274562942401','558386251311684','558527284183280','880823','558088270434082','558796179128106','558923216912503','558797711647636','558884118112405','219398','112-8281922-9312205','558575557867256','1455857822','1455944107','1455944508','1455957240','1455959108','1455959695','1455964405','1455964817','1455974683','1455975207','1455991212','1456014821','1456020637','1456021409','1456043496','1456045982','1455952462','1455953028','1455956237','1455962265','1455962496','1455971675','1455971936','1455973327','1455976832','1455985967','1455987643','1455996313','526380','157972','187584','223184','223181','CYBS13140316','525712','223049','89562','CN100012942','DL00079730','DL00079644','DD14030502002','DD14030501926','DD14030501877','DD14030501771','DD14030501558','DD14030501507','DD14030501495','DD14030501444','DD14030501147','DD14030601105','DD14030601102','DD14030600470','DD14030600252','DD14030501930','DD14030501886','DD14030501804','DD14030501297','DD14030501232','BD14030601169','187186','DL00080075','DL00077878','218374','187024','523612','33598','558057068255073','557772672117459','1455848911','1455941088','1455954864','1455957247','1455959313','1455967410','196296','186350') ";
     $omAvailableAct = new OmAvailableAct();
     $unShipOrderList = $omAvailableAct->act_getTNameList($table, $field, $where);
     foreach ($unShipOrderList as $k2 => $v2) {
         //key代表最外层的维数
         $detail = $v2;
         $ordersTime = date('Y-m-d', $detail['ordersTime']);
         $paymentTime = date('Y-m-d', $detail['paymentTime']);
         $transport = $transportation[$v2['transportId']];
         $note = $detail['content'] . ' ' . $detail['feedback'];
         $detailRow = array($detail['recordNumber'], $detail['platformUsername'], $detail['email'], '', '', $ordersTime, $paymentTime, $detail['onlineTotal'], $detail['actualShipping'], $detail['actualTotal'], $detail['currency'], $detail['PayPalPaymentId'], $detail['declaredPrice'], $detail['calcWeight'], $detail['sku'], $detail['amount'], $detail['itemTitle'], $note, $detail['username'], $detail['countryName'], $detail['state'], $detail['city'], $detail['street'], $detail['zipCode'], $detail['landline'], '', '', $detail['phone'], $transport, $detail['account'], $detail['tracknumber']);
         $excel->addRow($detailRow);
     }
     $excel->finalize();
     exit;
 }
コード例 #4
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');
 }
コード例 #5
0
ファイル: fetch_DL_orders.php プロジェクト: ohjack/newErp
 $orderdata['orderType'] = C('STATEPENDING_CONV');
 $orderdata['ordersTime'] = strtotime(trim($value['CreatedTime']));
 //平台下单时间
 $orderdata['paymentTime'] = strtotime(trim($value['PaidTime']));
 $orderdata['onlineTotal'] = $trade['price'];
 //线上总金额
 $orderdata['actualTotal'] = mysql_real_escape_string(trim($value['Total']));
 //付款总金额
 $transport = mysql_real_escape_string(trim($value['ShippingModuleCode']));
 $transport = carrier($transport);
 //$trans = $memc_obj->get_extral("trans_system_carrier");
 if ($transport == "中国邮政挂号" || $transport == "中国邮政平邮") {
     $orderNote['content'] = base64_decode(trim($value['OrderNote']));
 }
 //$orderdata['transportId'] = $flip_carrierList[$transport];                                                       //运输方式id
 $transportation = CommonModel::getCarrierList();
 //所有的
 foreach ($transportation as $tranValue) {
     if ($tranValue['carrierNameCn'] == $transport) {
         $orderdata['transportId'] = $tranValue['id'];
         break;
     }
     //$transportationList[$tranValue['id']] = $tranValue['carrierNameCn'];
 }
 if (count($value['Items']) == 1 && $value['Items'][0]['Quantity'] == 1) {
     $orderdata['orderAttribute'] = 1;
 } elseif (count($value['Items']) == 1 && $value['Items'][0]['Quantity'] > 1) {
     $orderdata['orderAttribute'] = 2;
 } else {
     $orderdata['orderAttribute'] = 3;
 }
コード例 #6
0
ファイル: orderModify.action.php プロジェクト: ohjack/newErp
 public function act_changeTransportation()
 {
     $transportationType = $_REQUEST['transportationType'];
     switch ($transportationType) {
         case '1':
             $transportation = CommonModel::getCarrierList(1);
             //快递
             break;
         case '2':
             $transportation = CommonModel::getCarrierList(0);
             //平邮
             break;
         default:
             $transportation = CommonModel::getCarrierList();
             //所有运输方式
             break;
     }
     if ($transportation) {
         return $transportation;
     } else {
         self::$errCode = '998';
         self::$errMsg = '无法取到运输方式';
         return false;
     }
 }
コード例 #7
0
 public function view_guoneiSaleImport()
 {
     //var_dump($_POST);//exit;
     include_once WEB_PATH . "lib/PHPExcel.php";
     //phpexcel
     include_once WEB_PATH . "conf/scripts/script.ebay.config.php";
     //global $SYSTEM_ACCOUNTS,$__liquid_items_fenmocsku,$__liquid_items_BuiltinBattery,$__liquid_items_SuperSpecific,$__liquid_items_Paste;
     $toptitle = '速卖通线下订单导入';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 2);
     $this->smarty->assign('secondlevel', 220);
     $OmAccountAct = new OmAccountAct();
     $aliexpressAccountList = $OmAccountAct->act_getINNERAccountList();
     $this->smarty->assign("aliexpressAccountList", $aliexpressAccountList);
     if (isset($_FILES['aliexpressFile']['tmp_name'])) {
         $filePath = $_FILES['aliexpressFile']['tmp_name'];
         $PHPExcel = new PHPExcel();
         $PHPReader = new PHPExcel_Reader_Excel2007();
         if (!$PHPReader->canRead($filePath)) {
             $PHPReader = new PHPExcel_Reader_Excel5();
             if (!$PHPReader->canRead($filePath)) {
                 echo 'no Excel';
                 return;
             }
         }
         $PHPExcel = $PHPReader->load($filePath);
         $currentSheet = $PHPExcel->getSheet(0);
         //$excellists    = excel2array($PHPExcel, $filePath, 0, 0);
         //print_r($excellists);print_r($_SESSION);
         $orderid = array();
         $orderData = array();
         //$orderarr = OrderindexModel::showSearchOrderList("om_unshipped_order","where da.id=14448");
         //echo "<pre>";print_r($orderarr);
         $account = $_POST['aliexpressAccount'];
         $transportation = CommonModel::getCarrierList();
         //所有的
         $c = 2;
         while (true) {
             $aa = 'A' . $c;
             $bb = 'B' . $c;
             $cc = 'C' . $c;
             $dd = 'D' . $c;
             $ee = 'E' . $c;
             $ff = 'F' . $c;
             $gg = 'G' . $c;
             $hh = 'H' . $c;
             $ii = 'I' . $c;
             $jj = 'J' . $c;
             $kk = 'K' . $c;
             $ll = 'L' . $c;
             $mm = 'M' . $c;
             $nn = 'N' . $c;
             $oo = 'O' . $c;
             $pp = 'P' . $c;
             $qq = 'Q' . $c;
             $rr = 'R' . $c;
             $ss = 'S' . $c;
             $tt = 'T' . $c;
             $uu = 'U' . $c;
             $vv = 'V' . $c;
             $ww = 'W' . $c;
             $xx = 'X' . $c;
             $yy = 'Y' . $c;
             $zz = 'Z' . $c;
             $c++;
             $recordNumber = trim($currentSheet->getCell($aa)->getValue());
             $userId = trim($currentSheet->getCell($bb)->getValue());
             $skuStr = trim($currentSheet->getCell($cc)->getValue());
             $amount = trim($currentSheet->getCell($dd)->getValue());
             $countryName = trim($currentSheet->getCell($ee)->getValue());
             $actualTotal = trim($currentSheet->getCell($ff)->getValue());
             $currency = trim($currentSheet->getCell($gg)->getValue());
             $street1 = trim($currentSheet->getCell($hh)->getValue());
             $street2 = trim($currentSheet->getCell($ii)->getValue());
             $carrierNameCn = trim($currentSheet->getCell($jj)->getValue());
             $city = trim($currentSheet->getCell($kk)->getValue());
             $state = trim($currentSheet->getCell($ll)->getValue());
             $zipCode = trim($currentSheet->getCell($mm)->getValue());
             $phone = trim($currentSheet->getCell($nn)->getValue());
             $trackNumber = trim($currentSheet->getCell($oo)->getValue());
             $noteStr = trim($currentSheet->getCell($pp)->getValue());
             $ordersTime = time();
             $paymentTime = time();
             $email = '';
             $onlineTotal = '';
             $shippingFee = '';
             $transId = '';
             $note = '';
             $username = $userId;
             $platformUsername = $userId;
             $PayPalPaymentId = $transId;
             if (empty($recordNumber)) {
                 break;
             }
             $skuArrlist = explode(',', $skuStr);
             $noteArr = explode(',', $noteStr);
             $skuCount = count($skuArrlist);
             for ($i = 0; $i < $skuCount; $i++) {
                 list($sku, $amount) = explode('*', $skuArrlist[$i]);
                 //echo "--sku=$sku---amount=$amount-------";
                 //detail信息
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['sku'] = $sku;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['amount'] = $amount;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['recordNumber'] = $recordNumber;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['createdTime'] = time();
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['itemTitle'] = $noteArr[$i];
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['transId'] = $transId;
                 if (!empty($note)) {
                     $orderData[$recordNumber]['orderNote'][$c]['content'] = $note;
                     $orderData[$recordNumber]['orderNote'][$c]['userId'] = $_SESSION['sysUserId'];
                 }
             }
             //order信息
             $orderData[$recordNumber]['orderData']['recordNumber'] = $recordNumber;
             $orderData[$recordNumber]['orderData']['ordersTime'] = $ordersTime;
             $orderData[$recordNumber]['orderData']['paymentTime'] = $paymentTime;
             $orderData[$recordNumber]['orderData']['onlineTotal'] = $onlineTotal;
             $orderData[$recordNumber]['orderData']['actualTotal'] = $actualTotal;
             $orderData[$recordNumber]['orderData']['actualShipping'] = $shippingFee;
             $orderData[$recordNumber]['orderData']['calcShipping'] = $shippingFee;
             $orderData[$recordNumber]['orderData']['orderAddTime'] = time();
             $orderData[$recordNumber]['orderData']['orderStatus'] = 100;
             $orderData[$recordNumber]['orderData']['orderType'] = 101;
             $SYS_ACCOUNTS = OmAvailableModel::getTNameList("om_account", "*", " where account='{$account}'");
             $orderData[$recordNumber]['orderData']['accountId'] = $SYS_ACCOUNTS[0]['id'];
             $orderData[$recordNumber]['orderData']['platformId'] = $SYS_ACCOUNTS[0]['platformId'];
             $plataccountId = $SYS_ACCOUNTS[0]['id'];
             $platformId = $SYS_ACCOUNTS[0]['platformId'];
             $SYS_ACCOUNTS = OmAvailableModel::getPlatformAccount();
             foreach ($SYS_ACCOUNTS as $platform => $accounts) {
                 foreach ($accounts as $accountId => $accountname) {
                     if ($account == $accountname) {
                         if ($platform == "ebay") {
                             $orderData[$recordNumber]['orderData']['isFixed'] = 2;
                         } else {
                             $orderData[$recordNumber]['orderData']['isFixed'] = 1;
                         }
                     }
                 }
             }
             foreach ($transportation as $tranValue) {
                 if ($tranValue['carrierNameCn'] == $carrierNameCn) {
                     $orderData[$recordNumber]['orderData']['transportId'] = $tranValue['id'];
                     break;
                 }
             }
             if ($trackNumber != '') {
                 $orderData[$recordNumber]['orderTrack']['tracknumber'] = $trackNumber;
                 $orderData[$recordNumber]['orderTrack']['addUser'] = $_SESSION['sysUserId'];
                 $orderData[$recordNumber]['orderTrack']['createdTime'] = time();
             }
             //order扩展信息
             $orderData[$recordNumber]['orderExtenData']['currency'] = $currency;
             $orderData[$recordNumber]['orderExtenData']['paymentStatus'] = "PAY_SUCCESS";
             $orderData[$recordNumber]['orderExtenData']['transId'] = $recordNumber;
             // 交易id;;
             $orderData[$recordNumber]['orderExtenData']['PayPalPaymentId'] = $PayPalPaymentId;
             $orderData[$recordNumber]['orderExtenData']['platformUsername'] = $platformUsername;
             $orderData[$recordNumber]['orderExtenData']['currency'] = $currency;
             //user信息
             $orderData[$recordNumber]['orderUserInfoData']['platformUsername'] = $platformUsername;
             $orderData[$recordNumber]['orderUserInfoData']['username'] = $username;
             $orderData[$recordNumber]['orderUserInfoData']['email'] = $email;
             $orderData[$recordNumber]['orderUserInfoData']['street'] = $street1;
             $orderData[$recordNumber]['orderUserInfoData']['address2'] = ${$street2};
             $orderData[$recordNumber]['orderUserInfoData']['currency'] = $currency;
             //$orderData[$recordNumber]['orderUserInfoData']['address3'] = $address3;
             $orderData[$recordNumber]['orderUserInfoData']['city'] = $city;
             $orderData[$recordNumber]['orderUserInfoData']['state'] = $state;
             $orderData[$recordNumber]['orderUserInfoData']['zipCode'] = $zipCode;
             $orderData[$recordNumber]['orderUserInfoData']['countryName'] = $countryName;
             $orderData[$recordNumber]['orderUserInfoData']['landline'] = $phone;
             $orderData[$recordNumber]['orderUserInfoData']['phone'] = $phone;
             //note信息
             if (!empty($note)) {
                 $orderData[$recordNumber]['orderNote'][$c]['content'] = $note;
                 $orderData[$recordNumber]['orderNote'][$c]['userId'] = $_SESSION['sysUserId'];
             }
         }
         //print_r($orderData);
         //echo "<pre>";print_r($orderData);//exit;
         $message = "";
         foreach ($orderData as $id => $order) {
             //echo $id;
             //$msg = commonModel::checkOrder($id);
             $msg = commonModel::checkRecordNumber($id, $platformId, $plataccountId);
             if ($msg) {
                 $message .= "<font color='red'>订单{$id}已存在!</font><br>";
                 continue;
             }
             //计算订单属性
             if (count($order['orderDetail']) == 1) {
                 $detail = current($order['orderDetail']);
                 if ($detail['orderDetailData']['amount'] == 1) {
                     $orderData[id]['orderData']['orderAttribute'] = 1;
                 } else {
                     $orderData[id]['orderData']['orderAttribute'] = 2;
                 }
             } else {
                 $orderData[id]['orderData']['orderAttribute'] = 3;
             }
             //计算订单重量及包材
             $obj_order_detail_data = array();
             foreach ($order['orderDetail'] as $sku => $detail) {
                 $obj_order_detail_data[] = $detail['orderDetailData'];
             }
             $weightfee = commonModel::calcOrderWeight($obj_order_detail_data);
             $orderData[$id]['orderData']['calcWeight'] = $weightfee[0];
             //$orderData[$value[0]]['orderData']['calcShipping'] = $weightfee[3];
             $orderData[$id]['orderData']['pmId'] = $weightfee[1];
             //计算运费
             $calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, $orderData[$id]['orderData']['isFixed']);
             //计算运费
             $orderData[$id]['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
             //$orderData[$id]['orderData']['calcShipping'] = $calcShippingInfo['fee']['fee'];
             //缺货拦截
             $orderData[$id] = AutoModel::auto_contrast_intercept($orderData[$id]);
             /*$orderData[$id]['orderData']['orderStatus'] = $status['orderStatus'];
             		$orderData[$id]['orderData']['orderType'] = $status['orderType'];*/
             //echo "<pre>";print_r($orderData[$id]);
             //print_r($orderData);
             //exit;
             //插入订单
             $info = OrderAddModel::insertAllOrderRowNoEvent($orderData[$id]);
             if ($info) {
                 $message .= "<font color='green'>订单{$id}上传成功!</font><br>";
             } else {
                 $message .= "<font color='red'>订单{$id}上传失败!</font><br>";
             }
         }
         $this->smarty->assign("showerrorinfo", $message);
         //header("location:index.php?mod=underLineOrderImport&act=importOrder");
     }
     $this->smarty->display('guoneiSaleImport.htm');
 }
コード例 #8
0
ファイル: orderLoad.view.php プロジェクト: ohjack/newErp
 public function view_aliexpressimport()
 {
     $this->smarty->assign('toplevel', 2);
     $this->smarty->assign('secondlevel', 24);
     $OmAccountAct = new OmAccountAct();
     //$aliexpressAccountList = $OmAccountAct->act_getAccountListByPid(2);
     $aliexpressAccountList = $OmAccountAct->act_getAccountListAliexpress();
     var_dump($aliexpressAccountList);
     $aliexpressAccountList = json_decode($aliexpressAccountList, true);
     $this->smarty->assign("aliexpressAccountList", $aliexpressAccountList);
     $this->smarty->display('aliexpressImport.htm');
     include_once WEB_PATH . "lib/PHPExcel.php";
     //phpexcel
     $toptitle = 'underLineOrderImport';
     //头部title
     $this->smarty->assign('toptitle', $toptitle);
     $this->smarty->assign('toplevel', 2);
     $this->smarty->assign('secondlevel', 22);
     if (isset($_FILES['orderUpfile']['tmp_name'])) {
         $filePath = $_FILES['orderUpfile']['tmp_name'];
         $PHPExcel = new PHPExcel();
         $PHPReader = new PHPExcel_Reader_Excel2007();
         if (!$PHPReader->canRead($filePath)) {
             $PHPReader = new PHPExcel_Reader_Excel5();
             if (!$PHPReader->canRead($filePath)) {
                 echo 'no Excel';
                 return;
             }
         }
         $PHPExcel = $PHPReader->load($filePath);
         $currentSheet = $PHPExcel->getSheet(0);
         //$excellists    = excel2array($PHPExcel, $filePath, 0, 0);
         //print_r($excellists);print_r($_SESSION);
         $orderid = array();
         $orderData = array();
         //$orderarr = OrderindexModel::showSearchOrderList("om_unshipped_order","where da.id=14448");
         //echo "<pre>";print_r($orderarr);
         $c = 2;
         while (true) {
             $aa = 'A' . $c;
             $bb = 'B' . $c;
             $cc = 'C' . $c;
             $dd = 'D' . $c;
             $ee = 'E' . $c;
             $ff = 'F' . $c;
             $gg = 'G' . $c;
             $hh = 'H' . $c;
             $ii = 'I' . $c;
             $jj = 'J' . $c;
             $kk = 'K' . $c;
             $ll = 'L' . $c;
             $mm = 'M' . $c;
             $nn = 'N' . $c;
             $oo = 'O' . $c;
             $pp = 'P' . $c;
             $qq = 'Q' . $c;
             $rr = 'R' . $c;
             $ss = 'S' . $c;
             $tt = 'T' . $c;
             $uu = 'U' . $c;
             $vv = 'V' . $c;
             $ww = 'W' . $c;
             $xx = 'X' . $c;
             $yy = 'Y' . $c;
             $zz = 'Z' . $c;
             $c++;
             $account = trim($currentSheet->getCell($aa)->getValue());
             $recordNumber = trim($currentSheet->getCell($bb)->getValue());
             $platformUsername = trim($currentSheet->getCell($cc)->getValue());
             $email = trim($currentSheet->getCell($dd)->getValue());
             $ordersTime = trim($currentSheet->getCell($ee)->getValue());
             $paymentTime = trim($currentSheet->getCell($ff)->getValue());
             $sku = trim($currentSheet->getCell($gg)->getValue());
             $amount = trim($currentSheet->getCell($hh)->getValue());
             $itemTitle = trim($currentSheet->getCell($ii)->getValue());
             $note = trim($currentSheet->getCell($jj)->getValue());
             $itemPrice = trim($currentSheet->getCell($kk)->getValue());
             $shippingFee = trim($currentSheet->getCell($ll)->getValue());
             $actualTotal = trim($currentSheet->getCell($mm)->getValue());
             $currency = trim($currentSheet->getCell($nn)->getValue());
             $transId = trim($currentSheet->getCell($oo)->getValue());
             $username = trim($currentSheet->getCell($pp)->getValue());
             $street = trim($currentSheet->getCell($qq)->getValue());
             $address2 = trim($currentSheet->getCell($rr)->getValue());
             $address3 = trim($currentSheet->getCell($ss)->getValue());
             $city = trim($currentSheet->getCell($tt)->getValue());
             $state = trim($currentSheet->getCell($uu)->getValue());
             $zipCode = trim($currentSheet->getCell($vv)->getValue());
             $countryName = trim($currentSheet->getCell($ww)->getValue());
             $landline = trim($currentSheet->getCell($xx)->getValue());
             $carrierNameCn = trim($currentSheet->getCell($yy)->getValue());
             if (empty($account)) {
                 break;
             }
             if (in_array($recordNumber, $orderid)) {
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['sku'] = $sku;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['amount'] = $amount;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['itemPrice'] = $itemPrice;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['shippingFee'] = $shippingFee;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['itemTitle'] = $itemTitle;
                 //$orderData['orderDetail']['orderDetailExtenData']['note'] = $value[10];
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['transId'] = $transId;
                 if (!empty($note)) {
                     $orderData[$recordNumber]['orderNote'][$c]['content'] = $note;
                     $orderData[$recordNumber]['orderNote'][$c]['userId'] = $_SESSION['sysUserId'];
                 }
             } else {
                 $orderid[] = $recordNumber;
                 //order信息
                 $orderData[$recordNumber]['orderData']['recordNumber'] = $recordNumber;
                 $orderData[$recordNumber]['orderData']['ordersTime'] = strtotime($ordersTime);
                 $orderData[$recordNumber]['orderData']['paymentTime'] = strtotime($paymentTime);
                 $orderData[$recordNumber]['orderData']['actualTotal'] = $actualTotal;
                 $orderData[$recordNumber]['orderData']['orderAddTime'] = time();
                 $SYSTEM_ACCOUNTS = OmAvailableModel::getTNameList("om_account", "*", " where account='{$account}'");
                 $orderData[$recordNumber]['orderData']['accountId'] = $SYSTEM_ACCOUNTS[0]['id'];
                 $orderData[$recordNumber]['orderData']['platformId'] = $SYSTEM_ACCOUNTS[0]['platformId'];
                 $SYSTEM_ACCOUNTS = OmAvailableModel::getPlatformAccount();
                 foreach ($SYSTEM_ACCOUNTS as $platform => $accounts) {
                     foreach ($accounts as $accountId => $accountname) {
                         if ($account == $accountname) {
                             if ($platform == "ebay") {
                                 $orderData[$recordNumber]['orderData']['isFixed'] = 2;
                             } else {
                                 $orderData[$recordNumber]['orderData']['isFixed'] = 1;
                             }
                         }
                     }
                 }
                 $transportation = CommonModel::getCarrierList();
                 //所有的
                 foreach ($transportation as $tranValue) {
                     if ($tranValue['carrierNameCn'] == $carrierNameCn) {
                         $orderData[$recordNumber]['orderData']['transportId'] = $tranValue['id'];
                         break;
                     }
                     //$transportationList[$tranValue['id']] = $tranValue['carrierNameCn'];
                 }
                 //order扩展信息
                 $orderData[$recordNumber]['orderExtenData']['currency'] = $currency;
                 $orderData[$recordNumber]['orderExtenData']['paymentStatus'] = "PAY_SUCCESS";
                 $orderData[$recordNumber]['orderExtenData']['transId'] = $recordNumber;
                 // 交易id;;
                 $orderData[$recordNumber]['orderExtenData']['platformUsername'] = $platformUsername;
                 //$orderData[$recordNumber]['orderExtenData']['currency']				=	$currency;
                 //user信息
                 $orderData[$recordNumber]['orderUserInfoData']['platformUsername'] = $platformUsername;
                 $orderData[$recordNumber]['orderUserInfoData']['username'] = $username;
                 $orderData[$recordNumber]['orderUserInfoData']['email'] = $email;
                 $orderData[$recordNumber]['orderUserInfoData']['street'] = $street;
                 $orderData[$recordNumber]['orderUserInfoData']['currency'] = $currency;
                 $orderData[$recordNumber]['orderUserInfoData']['address2'] = $address2;
                 $orderData[$recordNumber]['orderUserInfoData']['address3'] = $address3;
                 $orderData[$recordNumber]['orderUserInfoData']['city'] = $city;
                 $orderData[$recordNumber]['orderUserInfoData']['state'] = $state;
                 $orderData[$recordNumber]['orderUserInfoData']['zipCode'] = $zipCode;
                 $orderData[$recordNumber]['orderUserInfoData']['countryName'] = $countryName;
                 $orderData[$recordNumber]['orderUserInfoData']['landline'] = $landline;
                 //detail信息
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['sku'] = $sku;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['amount'] = $amount;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['itemPrice'] = $itemPrice;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['shippingFee'] = $shippingFee;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['recordNumber'] = $recordNumber;
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailData']['createdTime'] = time();
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['itemTitle'] = $itemTitle;
                 //$orderData['orderDetail']['orderDetailExtenData']['note'] = $value[10];
                 $orderData[$recordNumber]['orderDetail'][$sku]['orderDetailExtenData']['transId'] = $transId;
                 //note信息
                 if (!empty($note)) {
                     $orderData[$recordNumber]['orderNote'][$c]['content'] = $note;
                     $orderData[$recordNumber]['orderNote'][$c]['userId'] = $_SESSION['sysUserId'];
                 }
             }
         }
         //echo "<pre>";print_r($orderData);
         $message = "";
         foreach ($orderData as $id => $order) {
             $msg = commonModel::checkOrder($id);
             if ($msg) {
                 $message .= "<font color='red'>订单{$id}已存在!</font><br>";
                 continue;
             }
             //计算订单属性
             if (count($order['orderDetail']) == 1) {
                 $detail = current($order['orderDetail']);
                 if ($detail['orderDetailData']['amount'] == 1) {
                     $orderData[id]['orderData']['orderAttribute'] = 1;
                 } else {
                     $orderData[id]['orderData']['orderAttribute'] = 2;
                 }
             } else {
                 $orderData[id]['orderData']['orderAttribute'] = 3;
             }
             //计算订单重量及包材
             $obj_order_detail_data = array();
             foreach ($order['orderDetail'] as $sku => $detail) {
                 $obj_order_detail_data[] = $detail['orderDetailData'];
             }
             $weightfee = commonModel::calcOrderWeight($obj_order_detail_data);
             $orderData[$id]['orderData']['calcWeight'] = $weightfee[0];
             //$orderData[$value[0]]['orderData']['calcShipping'] = $weightfee[3];
             $orderData[$id]['orderData']['pmId'] = $weightfee[1];
             //计算运费
             $calcShippingInfo = CommonModel::calcAddOrderShippingFee($insertOrder, $orderData[$id]['orderData']['isFixed']);
             //计算运费
             $orderData[$id]['orderData']['channelId'] = $calcShippingInfo['fee']['channelId'];
             //缺货拦截
             $status = commonModel::auto_contrast_intercept($orderData[$id]);
             $orderData[$id]['orderData']['orderStatus'] = $status['orderStatus'];
             $orderData[$id]['orderData']['orderType'] = $status['orderType'];
             //print_r($order);
             //插入订单
             $info = OrderAddModel::insertAllOrderRowNoEvent($order);
             if ($info) {
                 $message .= "<font color='green'>订单{$id}上传成功!</font><br>";
             } else {
                 $message .= "<font color='red'>订单{$id}上传失败!</font><br>";
             }
         }
         $this->smarty->assign("showerrorinfo", $message);
         //header("location:index.php?mod=underLineOrderImport&act=importOrder");
     }
     $this->smarty->display('underLineOrderImport.htm');
 }
コード例 #9
0
ファイル: exportsToXls.view.php プロジェクト: ohjack/newErp
 public function view_exportsToXls1()
 {
     error_reporting(E_ALL);
     /*$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'] : '';*/
     //foreach($_GET as $k=>$v){
     //			//if(isset($_))
     //		}
     $type = isset($_GET['type']) ? trim($_GET['type']) : "";
     $order = isset($_GET['order']) ? trim($_GET['order']) : "";
     $where = " WHERE ";
     $where_arr = array();
     $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_arr[] = ' da.platformId IN ( ' . join(',', $platformsee) . ' ) ';
     }
     $accountsee = array();
     for ($i = 0; $i < count($accountList); $i++) {
         $accountsee[] = $accountList[$i];
     }
     if ($accountsee) {
         $where_arr[] = ' da.accountId IN ( ' . join(",", $accountsee) . ' ) ';
     }
     if ($type == 1) {
         $arr = explode(",", $order);
         $ostatus = $arr[0];
         $otype = $arr[1];
         $where_arr[] = " da.is_delete=0 ";
         if ($ostatus) {
             $where_arr[] = " da.orderStatus='{$ostatus}' ";
         }
         if ($otype) {
             $where_arr[] = " da.orderType='{$otype}' ";
         }
         //$where = "where da.orderStatus='{$ostatus}' and da.orderType='{$otype}' and da.is_delete=0";
     } elseif ($type == 2) {
         $where_arr[] = " da.id in({$order}) ";
     }
     $where .= join(' AND ', $where_arr);
     //echo $where; exit;
     $orderarr = OrderindexModel::showSearchOrderList("om_unshipped_order", $where);
     //echo count($orderarr); exit;
     $exporter = new ExportDataExcel("browser", "xls1" . $date . ".xls");
     //echo "<pre>"; print_r($orderarr[98]);exit;
     $exporter->initialize();
     // starts streaming data to web browser
     $exporter->addRow(array("日期", "账号", "订单编号", "重量", "邮费", "运输方式", "交易号", "客户ID", "仓位号", "料号", "数量", "国家", "包裹总价值", "币种", "包装员", "挂号条码", "是/否"));
     foreach ($orderarr as $key => $value) {
         $paymentTime = date("Y-m-d", $value['orderData']['paymentTime']);
         $accountArr = OmAccountModel::accountInfo($value['orderData']['accountId']);
         $account = $accountArr['account'];
         //$account 			= $account['account'];
         $orderid = $key;
         $weight = $value['orderWarehouse']['actualWeight'];
         $shipfee = $value['orderWarehouse']['actualShipping'];
         $packagerId = $value['orderWarehouse']['packagerId'];
         $packager = UserModel::getUsernameById($packagerId);
         $transportation = CommonModel::getCarrierList();
         //所有的
         $transportationList = array();
         foreach ($transportation as $tranValue) {
             if ($tranValue['id'] == $value['orderData']['transportId']) {
                 $transport = $tranValue['carrierNameCn'];
                 break;
             }
             //$transportationList[$tranValue['id']] = $tranValue['carrierNameCn'];
         }
         //$plateform 			= exportsToXlsModel::plateformIdToName($value['orderData']['platformId']);
         $plateformArr = OmAccountModel::platformListById($value['orderData']['platformId']);
         $plateform = $plateformArr[$value['orderData']['platformId']];
         //$plateform			= $plateform['platform'];
         $transId = $value['orderExtenData']['transId'];
         $currency = $value['orderExtenData']['currency'];
         $userId = $value['orderUserInfoData']['platformUsername'];
         $countryName = $value['orderUserInfoData']['countryName'];
         $actualTotal = $value['orderData']['actualTotal'];
         $recordNumber = $value['orderData']['recordNumber'];
         $trackNumber = $value['orderTracknumber'][0]['tracknumber'];
         $orderDetails = $value['orderDetail'];
         if (count($orderDetails) == 1) {
             foreach ($value['orderDetail'] as $key => $detail) {
                 $skuId = $key;
             }
             $exporter->addRow(array($paymentTime, $account, $orderid, $weight, $shipfee, $transport, $recordNumber, $userId, "", $orderDetails[$skuId]['orderDetailData']['sku'], $orderDetails[$skuId]['orderDetailData']['amount'], $countryName, $actualTotal, $currency, $packager, $trackNumber, ""));
         } else {
             $exporter->addRow(array($paymentTime, $account, $orderid, $weight, $shipfee, $transport, $recordNumber, $userId, "", "", "", $countryName, $actualTotal, $currency, $packager, $trackNumber, ""));
             foreach ($orderDetails as $detail) {
                 $exporter->addRow(array($paymentTime, $account, $orderid, "", "", $transport, "", "", "", $detail['orderDetailData']['sku'], $detail['orderDetailData']['amount'], $countryName, "", "", "", "", ""));
             }
         }
     }
     $exporter->finalize();
     // writes the footer, flushes remaining data to browser.
     exit;
 }
コード例 #10
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');
 }
コード例 #11
0
ファイル: aliexpress.php プロジェクト: ohjack/newErp
 }
 if (!empty($noteb)) {
 }
 $isNote = 0;
 if (!empty($noteb)) {
     $isNote = 1;
     $orderdata['orderType'] = C('STATEPENDING_MSG');
 }
 $orderdata['isNote'] = $isNote;
 $orderExtAli['feedback'] = implode(" ", $noteb);
 if (count($carrier) == 1) {
     $carrier_name = get_carrier_name($carrier[0]);
     //$orderdata['carrier']	=	$carrier_name;
 }
 $transportId = '';
 $transportList = CommonModel::getCarrierList();
 foreach ($transportList as $key => $trans) {
     if ($trans['carrierNameCn'] == $carrier_name) {
         $transportId = $trans['id'];
         break;
     }
 }
 $expressArr = CommonModel::getCarrierInfoById(1);
 //var_dump($expressArr);
 if (in_array($transportId, $expressArr)) {
     $orderdata['orderType'] = C('STATEPENDING_HASARRIVED');
 }
 $orderdata['transportId'] = $transportId;
 //运输方式ID
 // print_r($orderdata);
 // exit;