Przeglądaj źródła

省略商贸区商户名字超长的问题

sunxbiao 1 rok temu
rodzic
commit
9778d7e102
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      app/controller/api/store/merchant/Merchant.php

+ 3 - 0
app/controller/api/store/merchant/Merchant.php

@@ -185,6 +185,9 @@ class Merchant extends BaseController
185
                 $goods = $this->repository->productList($mer['mer_id'],$where, 1, 3,$this->userInfo,false,$is_commercetrade);
185
                 $goods = $this->repository->productList($mer['mer_id'],$where, 1, 3,$this->userInfo,false,$is_commercetrade);
186
                 if(empty($goods['list'])) continue;
186
                 if(empty($goods['list'])) continue;
187
                 $mer['goods_list'] = $goods['list'];
187
                 $mer['goods_list'] = $goods['list'];
188
+                if (mb_strlen($mer['mer_name']) > 8) {
189
+                    $mer['mer_name'] = mb_substr($mer['mer_name'], 0, 8) . '...';
190
+                }
188
                 $return_list[] = $mer;
191
                 $return_list[] = $mer;
189
             }
192
             }
190
         }
193
         }