dever 3 years ago
parent
commit
8f9fb5e7dc

+ 1 - 5
app/mshop/src/Core.php

@@ -28,15 +28,11 @@ class Core
             Dever::alert('请选择门店');
         }
 
-        $this->shop = Dever::db('shop/info')->find($this->shop_id);
+        $this->shop = Dever::db('shop/info')->getOne($this->shop_id);
 
         if (!$this->shop) {
             Dever::alert('门店不存在');
         }
-
-        if ($this->shop['status'] != 1) {
-            Dever::alert('门店不存在');
-        }
     }
 
     public function checkLogin()

+ 1 - 0
app/mshop/src/Data.php

@@ -267,6 +267,7 @@ class Data extends Core
         $pay_type = Dever::input('pay_type', 1);
         $mobile = Dever::input('mobile');
         $cash = Dever::input('cash');
+        Dever::setInput('pay_method', 2);
 
         if (!$mobile) {
             Dever::alert('手机号不能为空');

+ 1 - 2
app/shop/database/coupon.php

@@ -145,12 +145,11 @@ return array
             'option' => array
             (
                 'shop_id' => 'yes',
-                'status' => 1,
                 'state' => 1,
             ),
             'type' => 'all',
             'page' => array(10, 'list'),
-            'order' => array('status' => 'asc','edate' => 'asc', 'id' => 'desc'),
+            'order' => array('id' => 'desc'),
             'col' => '*',
         ),
 

+ 6 - 2
app/shop/lib/Info.php

@@ -125,9 +125,13 @@ class Info
         if ($id) {
             $where .= ' and id = ' . $id;
         }
-        $sql = 'select id,name,`desc`,truename,mobile,lng,lat,address,open,worktime,method,gotime,pdesc,round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';
+        if ($lng && $lat) {
+            $sql = 'select id,name,`desc`,truename,mobile,lng,lat,address,open,worktime,method,gotime,pdesc,round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';
 
-        $data = Dever::db('shop/info')->$method($sql, array(), $page);
+            $data = Dever::db('shop/info')->$method($sql, array(), $page);
+        } else {
+            $data = Dever::db('shop/info')->getOne($id);
+        }
 
         return $data;
     }

+ 12 - 2
app/shop/lib/Sell.php

@@ -151,6 +151,7 @@ class Sell
         $info['status_name'] = $this->config['status'][$info['status']];
         $info['method_name'] = $this->config['method'][$info['method']];
         $info['pay_method_name'] = $this->config['pay_method'][$info['pay_method']];
+        $info['pay_type_name'] = $this->config['pay_type'][$info['pay_type']];
 
         if ($this->type == 1) {
             if ($info['status'] == 2) {
@@ -648,7 +649,13 @@ class Sell
                 $card_update['ddate'] = time();
                 Dever::db('goods/card_code')->update($card_update);
             }
-        	return 'ok';
+        	return array
+            (
+                'order' => '',
+                'order_num' => $order_data['order_num'],
+                'order_id' => $id,
+                'type' => 'pay',
+            );
         }
 
         $param = array
@@ -676,6 +683,8 @@ class Sell
         }
         # 使用优惠券
         $this->useCoupon($coupon_id, $user_coupon_id);
+        $result['order_num'] = $order_data['order_num'];
+        $result['order_id'] = $id;
         return $result;
     }
 
@@ -742,7 +751,8 @@ class Sell
         }
 
         $result = Dever::load('pay/api.pay', $param);
-
+        $result['order_num'] = $order_data['order_num'];
+        $result['order_id'] = $id;
         return $result;
     }
 

+ 1 - 1
main/lib/Core.php

@@ -8,7 +8,7 @@ class Core
 {
     protected $uid = -1;
     protected $use = array();
-    protected $data = array();
+    public $data = array();
 
     public function __construct()
     {