yingzi 2 年之前
父节点
当前提交
7ed408d8c2
共有 2 个文件被更改,包括 39 次插入0 次删除
  1. 36 0
      Controller/Cashier/Cashier.Class.php
  2. 3 0
      Controller/Cashier/CashierGoods.Class.php

+ 36 - 0
Controller/Cashier/Cashier.Class.php

@@ -6,9 +6,11 @@ use JinDouYun\Controller\BaseController;
 use JinDouYun\Model\Cashier\MCashier;
 use JinDouYun\Model\Cashier\MCashierCart;
 use JinDouYun\Model\Market\MCoupon;
+use JinDouYun\Model\Enterprise\MEnterprise;
 use Mall\Framework\Core\ErrorCode;
 use Mall\Framework\Core\StatusCode;
 
+
 /**
  * Description: 收银台,订单计算提成
  * Class Cashier
@@ -20,6 +22,8 @@ class Cashier extends BaseController
      * @var MCashier
      */
     private $objMCashier;
+    private $objMEnterprise;
+    
 
     /**
      * Cashier constructor.
@@ -33,6 +37,7 @@ class Cashier extends BaseController
     {
         parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode);
         $this->objMCashier = new MCashier($this->onlineUserId, $this->onlineEnterpriseId);
+        $this->objMEnterprise = new MEnterprise();
     }
 
     /**
@@ -102,6 +107,37 @@ class Cashier extends BaseController
         }
         parent::sendOutput($result->getData());
     }
+    
+    /**
+     * Doc: (des="获取通用收银客户信息")
+     * User: XMing
+     * Date: 2020/9/11
+     * Time: 2:23 下午
+     * @throws \Exception
+     */
+    public function getCommonCustomerInfo()
+    {
+        if(empty($this->onlineEnterpriseId)){
+            parent::sendOutput('企业信息不存在', ErrorCode::$paramError);
+        }
+        $params['enterpriseId'] = $this->onlineEnterpriseId;
+        
+        $result = $this->objMEnterprise->getEnterpriseInfo($params);
+        if (!$result->isSuccess()) {
+            parent::sendOutput($result->getData(), $result->getErrorCode());
+        }
+        $data = $result->getData();
+        if(empty($data )){
+            parent::sendOutput('企业信息不存在', ErrorCode::$paramError);
+        }
+//        $mobile = $data["commonCashierCustomerMobile"];
+        $mobile = "13600000001";
+        $result = $this->objMCashier->searchCustomerDetails($mobile);
+        if (!$result->isSuccess()) {
+            parent::sendOutput($result->getData(), $result->getErrorCode());
+        }
+        parent::sendOutput($result->getData());
+    }
 
     /**
      * 添加购物车,公共字段

+ 3 - 0
Controller/Cashier/CashierGoods.Class.php

@@ -37,6 +37,9 @@ class CashierGoods extends BaseController
             'areaCode'=> '',
             'shopId'  => isset($params['shopId']) ? $params['shopId'] : '',
         ];
+        if(empty($selectParams["shopId"])){
+            $this->sendOutput('请先选择门店', ErrorCode::$paramError );
+        }
         $pageParams = pageToOffset($params['page']?:1, $params['pageSize']?:10);
         $selectParams['limit'] = $pageParams['limit'];
         $selectParams['offset'] = $pageParams['offset'];