| 
					
				 | 
			
			
				@@ -15,12 +15,27 @@ class Data extends Core 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where['start'] = Dever::maketime($day . ' 00:00:00');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $where['end'] = Dever::maketime($day . '23:59:59');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $where['end'] = Dever::maketime($day . ' 23:59:59');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where['shop_id'] = $this->shop_id;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $this->data['num_order'] = Dever::db('shop/sell_order')->getOrderNum($where);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $this->data['num_cash'] = Dever::db('shop/sell_order')->getCashNum($where);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $this->data['num_goods'] = Dever::db('shop/sell_order')->getGoodsNum($where);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->data['num_order'] = round(Dever::db('shop/sell_order')->getOrderNum($where), 2);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $cash = Dever::db('shop/sell_order')->getCashNum($where);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($cash) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$this->data['num_cash'] = $cash['total'];
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!$this->data['num_cash']) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$this->data['num_cash'] = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $goods = Dever::db('shop/sell_order')->getGoodsNum($where);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($goods) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$this->data['num_goods'] = $goods['total'];
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!$this->data['num_goods']) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$this->data['num_goods'] = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->data['num_cash'] = round($this->data['num_cash'], 2);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->data['num_goods'] = round($this->data['num_goods'], 2);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $this->data;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -29,11 +44,32 @@ class Data extends Core 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function sell_order()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where['shop_id'] = $this->shop_id;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $mobile = Dever::input('mobile');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($mobile) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$where['mobile'] = $mobile;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $status = Dever::input('status');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($status) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$where['status'] = $status;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $day = Dever::input('day');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $method = Dever::input('method');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($method) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$where['method'] = $method;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $pay_method = Dever::input('pay_method');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($pay_method) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$where['pay_method'] = $pay_method;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $day = Dever::input('day');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($day) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$where['start'] = Dever::maketime($day . ' 00:00:00');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        	$where['end'] = Dever::maketime($day . ' 23:59:59');
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $this->data = Dever::db('shop/sell_order')->page($where);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $this->data = Dever::db('shop/sell_order')->getAll($where);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($this->data) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $this->config = Dever::db('shop/sell_order')->config;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -44,40 +80,4 @@ class Data extends Core 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $this->data;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    # 获取订单详细信息
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function order_info($info, $type = 1)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $info['status_name'] = $this->config['status'][$info['status']];
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $info['method_name'] = $this->config['method'][$info['method']];
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if ($info['method'] == 1 && $info['status'] > 1) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $info['goods'] = Dever::db('shop/sell_order_goods')->select(array('order_id' => $info['id']));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $info['shop'] = Dever::db('shop/info')->find($info['shop_id']);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $info['cdate'] = date('Y-m-d H:i', $info['cdate']);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if ($type == 2) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            foreach ($info['goods'] as $k => $v) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $info['goods']['info'] = Dever::load('goods/lib/info')->getInfo($v['goods_id']);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($info['address_id']) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $info['address'] = Dever::db('passport/address')->find($info['address_id']);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($info['invoice_id']) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $info['invoice'] = Dever::db('passport/invoice')->find($info['invoice_id']);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($info['coupon_id']) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $coupon = Dever::db('shop/user_coupon')->find($info['coupon_id']);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if ($coupon) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $info['coupon'] = Dever::db('goods/coupon')->find($coupon['coupon_id']);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return $info;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |