rabin 3 years ago
parent
commit
2239ef75c5
1 changed files with 15 additions and 2 deletions
  1. 15 2
      app/card/src/Api.php

+ 15 - 2
app/card/src/Api.php

@@ -240,11 +240,23 @@ class Api extends Core
                     }
                 } elseif ($info['type'] == 1) {
                     $config_type = Dever::db('shop/info')->config['config_type'];
+
+                    $info['shop_type'] = explode(',', $info['shop_type']);
+                    $this->data['card'][$k]['minfo'] = array();
+                    foreach ($type['shop_type'] as $tv) {
+                        if (isset($config_type[$tv])) {
+                            $this->data['card'][$k]['minfo'][] = $config_type[$tv];
+                        }
+                    }
+                    $this->data['card'][$k]['minfo'] = implode(',', $this->data['card'][$k]['minfo']) . '可用';
+
+                    /*
                     if ($info['shop_type'] && strstr($info['shop_type'], ',')) {
                         $this->data['card'][$k]['minfo'] = '全部店铺可用';
                     } elseif ($info['shop_type'] && isset($config_type[$info['shop_type']])) {
                         $this->data['card'][$k]['minfo'] = $config_type[$info['shop_type']] . '可用';
                     }
+                    */
                 } elseif ($info['type'] == 2 && $v['shop_id']) {
                     $shop = Dever::db('shop/info')->find($v['shop_id']);
                     if ($shop) {
@@ -370,7 +382,7 @@ class Api extends Core
                         }
                     }
                     $v['minfo'] = implode(',', $v['info']) . '可用';
-                    
+
                     if (in_array($shop_type, $type['shop_type'])) {
                         
                         if ($type['city_type'] == 1) {
@@ -384,7 +396,8 @@ class Api extends Core
                                 }
                             }
                             if ($city) {
-                                $v['minfo'] = '仅限' . $city['name'] . '可用';
+                                $city_info = Dever::db('area/city')->find($city);
+                                $v['minfo'] = '仅限' . $city_info['name'] . '可用';
                                 if ($city == $cur_city) {
                                     $this->data['card'][] = $v;
                                 } else {