dever il y a 3 ans
Parent
commit
69d21dd0e4
2 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 2 1
      app/shop/lib/Coupon.php
  2. 5 0
      app/shop/lib/Info.php

+ 2 - 1
app/shop/lib/Coupon.php

@@ -139,7 +139,8 @@ class Coupon
                 $shop_coupon = Dever::db('shop/coupon')->select($where);
                 $data['shop'] = array();
                 foreach ($shop_coupon as $k1 => $v1) {
-                    $shop = Dever::db('shop/info')->getOne(array('id' => $v1['shop_id'], 'city' => $data['city']));
+                    //$shop = Dever::db('shop/info')->getOne(array('id' => $v1['shop_id'], 'city' => $data['city']));
+                    $shop = Dever::load('shop/lib/info')->fetch($v1['shop_id'], $data['city'], Dever::input('lng'), Dever::input('lat'));
                     if ($shop) {
                         $data['shop'][] = $shop;
                     }

+ 5 - 0
app/shop/lib/Info.php

@@ -215,6 +215,11 @@ class Info
             $data = Dever::db('shop/info')->getOne($id);
         }
 
+        if ($data['city']) {
+            $city = Dever::db('area/city')->one($data['city']);
+            $data['city_name'] = $city['name'];
+        }
+
         return $data;
     }