Browse Source

增加H5商城

stanley-king 8 năm trước cách đây
mục cha
commit
0d0e1b3ce1

+ 0 - 0
data/resource/mobile/shop/xxx.txt


+ 19 - 12
mobile/control/cart.php

@@ -332,7 +332,8 @@ class cartControl extends mobileControl
 
         $cart_list = explode(',', urldecode($_POST['cart_list']));
         $new_cart_list = array();
-        if (is_array($cart_list)) {
+        if (is_array($cart_list))
+        {
             foreach ($cart_list as $value) {
                 if (preg_match_all('/^(\d{1,10})\|(\d{1,6})$/', $value, $match)) {
                     if (intval($match[2][0]) > 0) {
@@ -345,10 +346,13 @@ class cartControl extends mobileControl
             $condition = array('buyer_id' => $_SESSION['member_id']);
             $original_cart_list = $model_cart->listCart('db', $condition);
             $quantity_error = array();
-            foreach ($original_cart_list as $key => $value) {
-                if (array_key_exists($value['cart_id'], $new_cart_list)) {
+            foreach ($original_cart_list as $key => $value)
+            {
+                if (array_key_exists($value['cart_id'], $new_cart_list))
+                {
                     $quantity = intval($new_cart_list[$value['cart_id']]);
-                    if (intval($value['goods_num']) !== $quantity) {
+                    if (intval($value['goods_num']) !== $quantity)
+                    {
                         if (!$this->_check_goods_storage($value, $quantity, $_SESSION['member_id'])) {
                             array_push($quantity_error, array('cart_id' => $value['cart_id'], 'quantity' => $quantity, 'err_info' => '库存不足'));
                         } else {
@@ -356,25 +360,28 @@ class cartControl extends mobileControl
                             $data['goods_num'] = $quantity;
                             $update = $model_cart->editCart($data, array('cart_id' => $value['cart_id']));
                             if (!$update) {
-                                return joutput_error(errcode::ErrCart, '购物车修改失败');
+                                return self::outerr(errcode::ErrCart, '购物车修改失败');
                             }
                         }
                     }
-                } else {
+                }
+                else
+                {
                     $delete = $model_cart->delCart('db', array('cart_id' => $value['cart_id']));
                     if (!$delete) {
-                        return joutput_error(errcode::ErrCart, '购物车修改失败');
+                        return self::outerr(errcode::ErrCart, '购物车修改失败');
                     }
                 }
             }
 
             if (count($quantity_error) > 0) {
-                joutput_data(array('result' => '0', 'quantity_error' => $quantity_error));
+                self::outsuccess(array('result' => '0', 'quantity_error' => $quantity_error));
             } else {
-                joutput_data(array('result' => '1'));
+                self::outsuccess(array('result' => '1','quantity_error' => NULL));
             }
-        } else {
-            return joutput_error(errcode::ErrCart, '购物车列表格式错误');
+        }
+        else {
+            return self::outerr(errcode::ErrCart, '购物车列表格式错误');
         }
     }
 
@@ -552,7 +559,7 @@ class cartControl extends mobileControl
             $model_cart->delCart('db', $condition);
         }
 
-        joutput_data(array('result' => '1'));
+        self::outsuccess(array('result' => '1'));
     }
 
      /**

+ 0 - 2
mobile/control/goods.php

@@ -417,8 +417,6 @@ class goodsControl extends mobileControl
         unset($goods_detail['goods_info']['spec_value']);
         unset($goods_detail['goods_info']['spec_name']);
         unset($goods_detail['goods_info']['goods_spec']);
-        //unset($goods_detail['goods_info']['goods_attr']);
-
         unset($goods_detail['groupbuy_info']);
         unset($goods_detail['xianshi_info']);
 

+ 22 - 0
mobile/control/home.php

@@ -0,0 +1,22 @@
+<?php
+/**
+ * cms首页
+ *
+ *
+ *
+ */
+
+//use Shopnc\Tpl;
+
+defined('InShopNC') or exit('Access Invalid!');
+
+
+class homeControl extends indexControl
+{
+    public function __construct()
+    {
+        $_POST['client_type'] = 'wap';
+        $_GET['client_type'] = 'wap';
+        parent::__construct();
+    }
+}

+ 1 - 1
mobile/control/index.php

@@ -43,7 +43,7 @@ class indexControl extends mobileHomeControl
         $goods_list = $helper->get_infos($goods_ids);
         return self::outsuccess(array('special_list' => $ret,'goods_list' =>$goods_list, 'sale_list' => $sale_list));
     }
-
+    
     /**
      * 专题
      */

+ 13 - 0
mobile/control/member_address.php

@@ -221,6 +221,19 @@ class member_addressControl extends mbMemberControl
     public function area_listOp()
     {
         $area_id = intval($_POST['area_id']);
+        if ($area_id > 0) {
+            $key = 'area_parent_id' . $area_id;
+        } else {
+            $key = area_deep;
+        }
+
+        $prefix = 'mb_';
+        $ret = rcache($key, $prefix);
+        if(empty($ret))
+        {
+
+        }
+
         $from = $_POST['from'];
         if ($from === 'app') {
             $area_list = $this->_get_area_list($area_id);

+ 0 - 17
mobile/control/member_order.php

@@ -21,20 +21,8 @@ class member_orderControl extends mbMemberControl
         parent::__construct();
     }
 
-    /**
-     * 订单列表
-     */
     public function order_listOp()
     {
-        $page = trim($_GET['page']);
-        $curpage = trim($_GET['curpage']);
-        if (!isset($_GET['page'])) {
-            $page = "100";
-            $curpage = "1";
-            $this->page = 100;
-        }
-        initpage($page, $curpage);
-
         $model_order = Model('order');
         $condition = array();
         $condition['buyer_id'] = $_SESSION['member_id'];
@@ -59,7 +47,6 @@ class member_orderControl extends mbMemberControl
             $value['if_lock'] = $model_order->getOrderOperateState('lock', $value);
             //显示物流跟踪
             $value['if_deliver'] = $model_order->getOrderOperateState('deliver', $value);
-
             //订单是否能退货
             $value['if_refund_return'] = $model_refund->getRefundState($value);
 
@@ -70,7 +57,6 @@ class member_orderControl extends mbMemberControl
             }
 
             $value['refund_id'] = (string)$model_refund->getRefundId($value,$value['refund_state']);
-
             $order_group_list[$value['pay_sn']]['order_list'][] = $value;
 
             //如果有在线支付且未付款的订单则显示合并付款链接
@@ -111,9 +97,6 @@ class member_orderControl extends mbMemberControl
         self::outsuccess($array_data);
     }
 
-    /**
-     * 订单信息
-     */
     public function order_infoOp()
     {
         $model_order = Model('order');

+ 0 - 12
test/composer.json

@@ -1,12 +0,0 @@
-{
-  "name": "lrlz/panda",
-  "description": "description_text",
-  "minimum-stability": "stable",
-  "license": "proprietary",
-  "authors": [
-    {
-      "name": "author's name",
-      "email": "email@example.com"
-    }
-  ]
-}

+ 1 - 1
test/pay_helperTest.php

@@ -12,7 +12,7 @@ class pay_helperTest extends PHPUnit_Framework_TestCase
 {
     public function testAdd()
     {
-        $this->assertContainsOnly('string', ['1', '2', 3]);
+        $this->assertContainsOnly('string', ['1', '2', '3']);
     }
 
 }