<?php
/**
 * 销售
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author xiaogg <xiaogg@sina.cn>
 */
 
namespace Admin\Controller;
class SaleController extends BaseController{
    	public function index(){
		if($_POST){
			$postdata['keyword']=$keyword=I('keyword');
			$postdata['date_from']=I('date_from');
			$postdata['date_to']=I('date_to');
			if($keyword){
				$whereor['goods_name']=array('like','%'.$keyword.'%');
        			}
			if($postdata['date_from']){
				$map['addtime'] = array(array('GT',strtotime($postdata['date_from'])),array('lt',strtotime($postdata['date_to'])));	
			}
		}
		$adminid=UID;
		if($adminid !=1){
			$data['id']=$adminid;
			$store_id=M('Admin')->where($data)->field('store_id')->find();
			$map['store_id']=$store_id;
		}
		$lists = $this->lists('OrderGoods',$map);
		$this->assign('lists',$lists);
		$this->assign($postdata);
		$this->display();
	}
}