dever 3 år sedan
förälder
incheckning
0be27769db
2 ändrade filer med 14 tillägg och 0 borttagningar
  1. 7 0
      app/goods/lib/Manage.php
  2. 7 0
      app/shop/src/Buy.php

+ 7 - 0
app/goods/lib/Manage.php

@@ -112,6 +112,13 @@ class Manage
             $update['where_id'] = $id;
             Dever::db('goods/info')->update($update);
         }
+
+        $status = Dever::param('status', $data);
+        if ($status > 0) {
+            Dever::db('shop/goods')->update(array('goods_id' => $id, 'status' => $status));
+            Dever::db('store/goods')->update(array('goods_id' => $id, 'status' => $status));
+            Dever::db('factory/goods')->update(array('goods_id' => $id, 'status' => $status));
+        }
     }
 
     /**

+ 7 - 0
app/shop/src/Buy.php

@@ -22,6 +22,13 @@ class Buy extends Core
 		if (!$this->shop) {
 			Dever::alert('门店不存在');
 		}
+
+		# 得到公里数
+		$lng = Dever::input('lng');
+		$lat = Dever::input('lat');
+		if ($lng && $lat) {
+			$this->shop['distance'] = Dever::distance($lng, $lat, $shop['lng'], $shop['lat']);
+		}
 	}
 
 	# 分享