私人领地

ecshop订单-》待付款,待发货,待收货,收货确认

// 订单 待付款、待发货、待收货、确认收货
    public function get_serch_order($type/*,$limit_statrt,$limit_end,$serch*/){
        $m =M()->pre.'order_info';
        $userid = $_SESSION['user_id'];
        
        if($type =='1'){  // 全部订单
            //echo '111';
            $serch = '';    
        }elseif($type=='2'){   // 待付款订单
            //echo '222';
            $serch .='order_status <> '.OS_INVALID.' and ';   // 去掉无效订单
            $serch .= 'pay_status ='.PS_UNPAYED;
        }elseif($type=='3'){  //  待发货订单
            $serch .='order_status <> '.OS_INVALID.' and ';   // 去掉无效订单
            $serch .= 'shipping_status ='.SS_UNSHIPPED.' and pay_status='.PS_PAYED;    
        }elseif($type=='4'){ // 待收货订单
            $serch .='order_status <> '.OS_INVALID.' and ';   // 去掉无效订单
            $serch .= 'pay_status='.PS_PAYED.' and shipping_status = '.SS_SHIPPED;        
        }elseif($type=='5'){  // 待评论订单
            $serch .='order_status <> '.OS_INVALID.' and ';   // 去掉无效订单
            $serch .= 'pay_status='.PS_PAYED.' and shipping_status = '.SS_RECEIVED;    
        }
        
        $sql = 'select * from '.$m.' where user_id='.$userid.' and '.$serch;    
        $result = $this->model->query($sql);
        return $result;
    }

 

posted @ 2015-11-30 12:00  狂奔的蜗牛Snails  阅读(1359)  评论(0编辑  收藏  举报