Quellcode durchsuchen

增加退货地址

stanley-king vor 8 Jahren
Ursprung
Commit
46a8ae3634
2 geänderte Dateien mit 10 neuen und 11 gelöschten Zeilen
  1. 7 8
      mobile/control/control.php
  2. 3 3
      mobile/control/member_refund.php

+ 7 - 8
mobile/control/control.php

@@ -15,7 +15,7 @@ require_once (BASE_ROOT_PATH . "/helper/statistics_helper.php");
 class mobileControl
 {
     //客户端类型
-    protected $client_type_array = array('android', 'wap', 'wechat', 'ios', 'ajax', 'web');
+    private static $stClienTypes = array('android', 'wap', 'wechat', 'ios', 'ajax', 'web');
 
     //列表默认分页数
     protected $page_size;
@@ -42,8 +42,6 @@ class mobileControl
         } else {
             $this->cur_page = 1;
         }
-        $page = $this->cur_page;
-        Log::record("curpage = {$page}",Log::DEBUG);
         initpage($this->page_size, $this->cur_page);
         $this->check_app_type();
         statistics_helper::instance()->add_call($_GET);
@@ -81,15 +79,16 @@ class mobileControl
     protected function check_app_type()
     {
         $client = strtolower(trim($_SERVER['HTTP_CLIENT_TYPE']));
-        $version = trim($_SERVER['HTTP_CLIENT_VERSION']);
+        $client = strtolower($client);
 
+        $version = trim($_SERVER['HTTP_CLIENT_VERSION']);
         if (empty($client)) {
             $client = $_POST['client_type'];
         } else {
             $_SESSION['is_app'] = true;
         }
 
-        if (empty($client) || !in_array($client, $this->client_type_array)) {
+        if (empty($client) || !in_array($client, self::$stClienTypes)) {
             $_SESSION['client_type'] = 'wap';
         } else {
             $_SESSION['client_type'] = $client;
@@ -126,11 +125,12 @@ class mobileControl
     {
         static $json_clients = array('android', 'ios');
 
-        if(!is_null($type)) {
+        if(!empty($type)) {
             $show_type = $type;
         } else {
             $show_type = $_SESSION['client_type'];
         }
+        Log::record("show_type = {$show_type}",Log::DEBUG);
 
         if (in_array($show_type, $json_clients))
         {
@@ -181,14 +181,13 @@ class mobileControl
     {
         static $json_clients = array('android', 'ios');
 
-        if(!is_null($type)) {
+        if(!empty($type)) {
             $show_type = $type;
         } else {
             $show_type = $_SESSION['client_type'];
         }
         Log::record("show_type = {$show_type}",Log::DEBUG);
 
-
         if (in_array($show_type, $json_clients))
         {
             joutput_data($data);

+ 3 - 3
mobile/control/member_refund.php

@@ -46,7 +46,8 @@ class member_refundControl extends mbMemberControl
             if($order == false) {
                 return self::outerr(errcode::ErrParamter,"查不到该订单");
             } else {
-                return self::outsuccess(array('refund' => $refund,'order' => $order));
+                global $config;
+                return self::outsuccess(array('refund' => $refund,'order' => $order,'return_address' => $config['return_address']));
             }
         }
     }
@@ -68,8 +69,7 @@ class member_refundControl extends mbMemberControl
             if($order == false) {
                 return self::outerr(errcode::ErrParamter,"查不到该订单");
             } else {
-                global $config;
-                return self::outsuccess(array('order' => $order,'return_address' => $config['return_address']));
+                return self::outsuccess(array('order' => $order));
             }
         }
     }