<?php
namespace member\controller;
use source\Controller;
class Chajian extends Controller {
    public function index(){
    	$this->display();
    }
  /**
 * 106云盘自动发卡平台网盘系统
 * ============================================================================
 * 版权所有 2016-2028 扎兰屯市姝妍计算机服务有限公司，并保留所有权利。
 * 网站地址: http://www.106ym.com
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
 * ============================================================================
 */ 
    public function lists(){
    	$where = array();
    	$where['buyer_id'] = session("user_auth.id");
    	$type = I('type',false);
    	$no = I('no',false);
    	if($type){
    		$where['status'] = $type;
    	}
    	if($no){
    		$where['order_no'] = array('like','%'.$no.'%');
    	}
    	$list = M("chajian_order")->where($where)->select();
    	$type = $this->get_status_all('status',37);
    	$this->list = $list;
    	$this->type = $type;
    	$this->sql=M('chajian_order')->getLastsql();
    	$this->display();
    }
    
    public function get_status_all($field,$model){
		$extra=M('attribute')->where(array('model_id'=>$model,'name'=>$field))->getField('extra');
		$extra=parse_config_attr($extra);
		return $extra;
	}
}