You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							43 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							43 lines
						
					
					
						
							1.1 KiB
						
					
					
				
								<?php
							 | 
						|
								
							 | 
						|
								/**
							 | 
						|
								 * 同步历史订单
							 | 
						|
								 */
							 | 
						|
								include_once dirname(dirname(__FILE__)).'/base/dealBase.php';
							 | 
						|
								
							 | 
						|
								class syncOrdersStatus extends dealBase {
							 | 
						|
								
							 | 
						|
								    public function setPara() {
							 | 
						|
								        $this->processnum = $GLOBALS['DAEMON_NUMLIMIT'][DAEMON_SYNC_ORDERS_STATUS];
							 | 
						|
								        $this->deal_sleep = 60;
							 | 
						|
								//         $this->is_while = false;
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    public function deal() {
							 | 
						|
								        $obj = new mOrder();
							 | 
						|
								        $order_list = $obj->getNotFinishedOrders();
							 | 
						|
								        if (empty($order_list)) return true;
							 | 
						|
								
							 | 
						|
								        $shopid2orders = array();
							 | 
						|
								        foreach ($order_list as $order) {
							 | 
						|
								            $shopid2orders[$order['shop_id']][] = $order['order_sn'];
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								        $pobj = new mPdd();
							 | 
						|
								
							 | 
						|
								        foreach ($shopid2orders as $shopid => $tids) {
							 | 
						|
								            $tids_status = $pobj->getPddOrderStatus($tids, '', $shopid);
							 | 
						|
								            if (!$tids_status) continue;
							 | 
						|
								
							 | 
						|
								            foreach ($tids_status as $info) {
							 | 
						|
								                if (!$info) continue;
							 | 
						|
								
							 | 
						|
								                $obj->updateOrderBySn($info['orderSn'], array('order_status'=>$info['order_status'], 'refund_status'=>$info['refund_status']));
							 | 
						|
								            }
							 | 
						|
								        }
							 | 
						|
								
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								}
							 | 
						|
								
							 | 
						|
								new syncOrdersStatus();
							 |