Bladeren bron

debug card_type return

stanley-king 4 jaren geleden
bovenliggende
commit
227d3bc128
2 gewijzigde bestanden met toevoegingen van 9 en 9 verwijderingen
  1. 5 5
      core/framework/function/core.php
  2. 4 4
      mobile/control/member_card.php

+ 5 - 5
core/framework/function/core.php

@@ -741,7 +741,7 @@ function del_share_images()
 
         foreach ($files as $file)
         {
-            if (in_array($file, array('.','..'))) {
+            if (in_array($file, ['.','..'])) {
                 continue;
             }
             @unlink($share_image_cache_path. $file);
@@ -823,7 +823,7 @@ function subdomain(){
 		if(empty($line) || strtolower($line) == 'www') return 0;
 
 		$model_store = Model('store');
-		$store_info = $model_store->getStoreInfo(array('store_domain'=>$line));
+		$store_info = $model_store->getStoreInfo(['store_domain'=>$line]);
 		//二级域名存在
 		if ($store_info['store_id'] > 0){
 			$store_id = $store_info['store_id'];
@@ -857,7 +857,7 @@ function ncReplaceText($message,$param){
  */
 function str_cut($string, $length, $dot = '')
 {
-	$string = str_replace(array('&nbsp;', '&amp;', '&quot;', '&#039;', '&ldquo;', '&rdquo;', '&mdash;', '&lt;', '&gt;', '&middot;', '&hellip;'), array(' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'), $string);
+	$string = str_replace(['&nbsp;', '&amp;', '&quot;', '&#039;', '&ldquo;', '&rdquo;', '&mdash;', '&lt;', '&gt;', '&middot;', '&hellip;'], [' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'], $string);
 	$strlen = strlen($string);
 	if($strlen <= $length) return $string;
 	$maxi = $length - strlen($dot);
@@ -897,7 +897,7 @@ function str_cut($string, $length, $dot = '')
 			$strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i];
 		}
 	}
-	$strcut = str_replace(array('&', '"', "'", '<', '>'), array('&amp;', '&quot;', '&#039;', '&lt;', '&gt;'), $strcut);
+	$strcut = str_replace(['&', '"', "'", '<', '>'], ['&amp;', '&quot;', '&#039;', '&lt;', '&gt;'], $strcut);
 	return $strcut.$dot;
 }
 
@@ -1120,7 +1120,7 @@ function getCMSArticleImageUrl($image_path, $image_name, $type='list') {
         if(!empty($image_array['path'])) {
             $image_path = $image_array['path'];
         }
-        $ext_array = array('list','max');
+        $ext_array = ['list','max'];
         $file_path = ATTACH_CMS.DS.'article'.DS.$image_path.DS.str_ireplace('.', '_'.$type.'.', $image_name);
         if(file_exists(BASE_PATH.DS.$file_name)) {
             $image_name = UPLOAD_SITE_URL.DS.$file_path;

+ 4 - 4
mobile/control/member_card.php

@@ -1,5 +1,5 @@
 <?php
-
+declare(strict_types=0);
 
 defined('InShopNC') or exit('Access Invalid!');
 
@@ -27,7 +27,6 @@ class member_cardControl extends mbMemberControl
         }
 
         $ret = $this->format($card_list);
-
         self::outsuccess(['card_list' => $ret]);
     }
 
@@ -36,8 +35,9 @@ class member_cardControl extends mbMemberControl
         $ret = [];
         foreach ($card_list as $item) {
             $card = new mtopcard\topcard($item);
-            $ret[] = $card->format();
-            $ret['card_type'] = mtopcard\scard_type($ret['card_type']);
+            $item = $card->format();
+            $item['card_type'] = mtopcard\scard_type($item['card_type']);
+            $ret[] = $item;
         }
         return $ret;
     }