Преглед изворни кода

Merge branch 'master' of http://git.huaml.com/zhh/huahuibao

# Conflicts:
#	sql.sql
林琦海 пре 5 година
родитељ
комит
de9fe9e4bf

+ 2 - 2
app/ghs/controllers/BaseController.php

@@ -28,9 +28,9 @@ class BaseController extends PublicController
 	public function beforeAction($action)
 	{
 		//token验证
-		//$adminId = jwt::getLoginId();
+		$adminId = jwt::getLoginId();
 		//模拟用户
-		$adminId = 1;
+        //$adminId = 1;
 		$sjId = 0;
 		$sj = [];
 		$sjExtend = [];

+ 69 - 57
app/ghs/controllers/CustomController.php

@@ -13,61 +13,73 @@ use yii\web\Controller;
 
 class CustomController extends BaseController
 {
-	
-	//客户列表 shish 2021.7.8
-	public function actionList()
-	{
-		$get = Yii::$app->request->get();
-		$type = isset($get['type']) ? $get['type'] : 0;
-		$name = isset($get['name']) ? $get['name'] : '';
-		$where = ['merchantId' => $this->sjId];
-		switch ($type) {
-			case 1:
-				//已开店
-				$where['isOpen'] = 1;
-				break;
-			default:
-		}
-		if (!empty($name)) {
-			if (stringUtil::isMobile($name)) {
-				$where['mobile'] = $name;
-			} else {
-				$where['shopName'] = ['like', $name];
-			}
-		}
-		$list = CustomService::getCustomList($where);
-		util::success($list);
-	}
-	
-	//客户详情 shish 2021.1.8
-	public function actionDetail()
-	{
-		$get = Yii::$app->request->get();
-		$customId = $get['id'] ?? 0;
-		$info = CustomService::getCustomInfo($customId);
-		CustomClass::valid($info, $this->sjId);
-		$info['sn'] = 1254358;
-		util::success($info);
-	}
-	
-	//允许月结开关 shish 2021.1.8
-	public function actionDebt()
-	{
-		$get = Yii::$app->request->get();
-		$debt = isset($get['debt']) ? $get['debt'] : 0;
-		$customId = isset($get['customId']) ? $get['customId'] : 0;
-		$custom = CustomClass::getById($customId);
-		CustomClass::valid($custom, $this->sjId);
-		CustomClass::debt($custom, $debt);
-		util::complete();
-	}
-	
-	//添加新客户 shish 2021.1.8
-	public function actionAdd()
-	{
-		$post = Yii::$app->request->post();
-		ApplyService::addCustom($post, $this->sjId);
-		util::complete('已提交审核');
-	}
-	
+
+    //客户列表 shish 2021.7.8
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $type = isset($get['type']) ? $get['type'] : 0;
+        $name = isset($get['name']) ? $get['name'] : '';
+        $where = ['merchantId' => $this->sjId];
+        switch ($type) {
+            case 1:
+                //已开店
+                $where['isOpen'] = 1;
+                break;
+            default:
+        }
+        if (!empty($name)) {
+            if (stringUtil::isMobile($name)) {
+                $where['mobile'] = $name;
+            } else {
+                $where['shopName'] = ['like', $name];
+            }
+        }
+        $list = CustomService::getCustomList($where);
+        util::success($list);
+    }
+
+    //客户详情 shish 2021.1.8
+    public function actionDetail()
+    {
+        $get = Yii::$app->request->get();
+        $customId = $get['id'] ?? 0;
+        $info = CustomService::getCustomInfo($customId);
+        CustomClass::valid($info, $this->sjId);
+        $info['sn'] = 1254358;
+        util::success($info);
+    }
+
+    //允许月结开关 shish 2021.1.8
+    public function actionDebt()
+    {
+        $get = Yii::$app->request->get();
+        $debt = isset($get['debt']) ? $get['debt'] : 0;
+        $customId = isset($get['customId']) ? $get['customId'] : 0;
+        $custom = CustomClass::getById($customId);
+        CustomClass::valid($custom, $this->sjId);
+        CustomClass::debt($custom, $debt);
+        util::complete();
+    }
+
+    //添加新客户 shish 2021.1.8
+    public function actionAdd()
+    {
+        $post = Yii::$app->request->post();
+        ApplyService::addCustom($post, $this->sjId);
+        util::complete('已提交审核');
+    }
+
+    //欠款客户 shish 2021.2.4
+    public function actionDebtList()
+    {
+        $get = Yii::$app->request->get();
+        $where = ['merchantId' => $this->sjId, 'isDebt' => 1];
+        if (isset($get['name']) && !empty($get['name'])) {
+            $where['name'] = ['like', $get['name']];
+        }
+        $list = CustomService::getDebtList($where);
+        util::success($list);
+    }
+
 }

+ 18 - 0
app/ghs/controllers/OrderClearController.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace ghs\controllers;
+
+use Yii;
+use common\components\util;
+
+class OrderClearController extends BaseController
+{
+
+    //收款 shish 2021.2.4
+    public function actionClear()
+    {
+        $ids = Yii::$app->request->post('id');
+        util::complete();
+    }
+
+}

+ 19 - 0
app/ghs/controllers/OrderController.php

@@ -6,6 +6,7 @@ use biz\merchant\services\MerchantExtendService;
 use biz\wx\classes\WxOpenClass;
 use bizGhs\admin\classes\AdminClass;
 use bizGhs\custom\classes\CustomClass;
+use bizGhs\custom\services\CustomService;
 use bizGhs\merchant\classes\ShopClass;
 use bizGhs\merchant\services\ShopService;
 use bizGhs\order\classes\OrderClass;
@@ -476,4 +477,22 @@ class OrderController extends BaseController
         util::success($out);
     }
 
+    //客户欠款的订单 shish 2021.2.4
+    public function actionDebtList()
+    {
+        $id = Yii::$app->request->get('id', 0);
+        $info = CustomClass::getCustom($id);
+        CustomClass::valid($info, $this->sjId);
+        $where = ['customId' => $id, 'debt' => 1];
+        $list = OrderService::getDebtOrderList($where);
+        util::success($list);
+    }
+
+    //收款 shish 2021.2.4
+    public function actionClearDebt()
+    {
+        $ids = Yii::$app->request->post('id');
+        util::complete();
+    }
+
 }

+ 2 - 2
app/ghs/controllers/ShopController.php

@@ -145,8 +145,8 @@ class ShopController extends BaseController
     {
         $res = [];
         //adminId 为 super 才有权限看到所有的门店
-        if($this->adminId['super']==1){
-            $res = ShopClass::getAllShop($this->sjId,$filed = 'id,shopName,avatar');
+        if($this->admin['super']==1){
+            $res = ShopClass::getAllShop($this->sjId);
         }
         util::success($res);
     }

+ 18 - 13
app/saas/controllers/WxOpenController.php

@@ -29,7 +29,7 @@ class WxOpenController extends PublicController
     //开放平台开始授权 shish 2020.1.16
     public function actionBeginAuth()
     {
-        $sjId = Yii::$app->request->get('id', 0);
+        $sjId = Yii::$app->request->get('id', 'hd');
         $open = WxOpenService::getOpen();
         //1只显示公众号 2只显示小程序  3显示公众号和小程序
         $authType = Yii::$app->request->get('authType', 3);
@@ -50,7 +50,7 @@ class WxOpenController extends PublicController
         if (isset($get['auth_code']) == false) {
             util::stop('公众号授权回调未成功');
         }
-        $id = $get['id'] ?? 0;
+        $id = $get['id'] ?? 'hd';
 
         $code = $get['auth_code'];
         //使用授权码换取公众号的接口调用凭据和授权信息
@@ -88,10 +88,10 @@ class WxOpenController extends PublicController
         $qrCodeUrl = $authorize_info['qrcode_url'];
         $accessTokenTime = date("Y-m-d H:i:s", (time() + $expires_in - 100));//安全起见,将过期时间设置得比微信里还短100秒
 
-        if ($id == 0) {
+        if ($id == 'ghs') {
             //这是供货商
             $sjWxInfo = WxOpenClass::getGhsWxInfo();
-        } elseif ($id == -1) {
+        } elseif ($id == 'hd') {
             //这是零售商
             $sjWxInfo = WxOpenClass::getWxInfo();
         } else {
@@ -119,14 +119,14 @@ class WxOpenController extends PublicController
                 'miniRefreshToken' => $authorize_refresh_token,
             ];
 
-            if ($id <= 0) {
+            if (is_numeric($id) == false) {
                 $wxMiniBaseId = 0;
                 $msg = '未知状态';
-                if ($id == 0) {
+                if ($id == 'ghs') {
                     //供货商
                     $wxMiniBaseId = $open['wxGhsMiniBaseId'] ?? 0;
                     $msg = '供货商小程序绑定成功';
-                } elseif ($id == -1) {
+                } elseif ($id == 'hd') {
                     //零售店
                     $wxMiniBaseId = $open['wxMiniBaseId'] ?? 0;
                     $msg = '零售店小程序绑定成功';
@@ -152,7 +152,7 @@ class WxOpenController extends PublicController
 
             if (isset($sjWxInfo['wxAppId']) && !empty($sjWxInfo['wxAppId'])) {
                 if ($sjWxInfo['wxAppId'] != $authorizeAppId) {
-                    util::stop('授权的公众号与商家已绑定的公众号不一致');
+                    util::stop("授权的公众号与商家已绑定的公众号不一致,授权公众号appId:{$authorizeAppId} 商家公众号:{$sjWxInfo['wxAppId']}");
                 }
             }
 
@@ -169,15 +169,15 @@ class WxOpenController extends PublicController
             $wxData['wxRefreshToken'] = $authorize_refresh_token;
 
 
-            if ($id <= 0) {
+            if (is_numeric($id) == false) {
 
                 $wxBaseId = 0;
                 $msg = '未知状态';
-                if ($id == 0) {
+                if ($id == 'ghs') {
                     //供货商公众号
                     $wxBaseId = $open['wxGhsBaseId'] ?? 0;
                     $msg = '供货商公众号绑定成功';
-                } elseif ($id == -1) {
+                } elseif ($id == 'hd') {
                     //零售商公众号
                     $wxBaseId = $open['wxBaseId'] ?? 0;
                     $msg = '零售商公众号绑定成功';
@@ -342,8 +342,13 @@ class WxOpenController extends PublicController
         }
         //解绑小程序和公众号绑定的平台
         if ($id == 14) {
-            wxUtil::unbindAccount($merchant, $isOpen);
-            wxUtil::unbindMiniProgram($merchant, $isOpen);
+            echo '<pre>';
+            Yii::info("解绑信息:" . json_encode($merchant));
+            $r = wxUtil::unbindAccount($merchant, $isOpen);
+            print_r($r);
+            $r = wxUtil::unbindMiniProgram($merchant, $isOpen);
+            print_r($r);
+            Yii::$app->end();
         }
         Yii::$app->end();
 

+ 1 - 1
app/shop/controllers/ConsoleController.php

@@ -19,7 +19,7 @@ class ConsoleController extends BaseController
 	{
 		$asset = MerchantAssetService::getByMerchantId($this->sjId);
 		$notice = [
-			//['title' => '您还有10天试用期结束 ', 'action' => '立即续费', 'clickHint' => '请在手机上进行续费', 'url' => 'http://www.test.com'],
+			['title' => '您的试用期还有7天,点击免费续期1年 ', 'action' => '详情', 'clickHint' => '请在手机上进行续费', 'url' => 'http://www.test.com', 'page' => 'page/notice/recharge'],
 		];
 		//今天访客数
 		$todayVisit = StatVisitService::getTodayVisitNum($this->sjId);

+ 17 - 0
app/shop/controllers/PurchaseClearController.php

@@ -20,4 +20,21 @@ class PurchaseClearController extends BaseController
 		util::success($respond);
 	}
 
+	public function actionWxPay()
+	{
+		$string = '{
+    "code": 1,
+    "msg": "操作成功",
+    "data": {
+        "appId": "wx21b7c3ef12082099",
+        "nonceStr": "i7f1e9z6ls42f3342m4j2bngxj6rq08e",
+        "package": "prepay_id=wx042304351179687ee46ee32d8ecf420000",
+        "signType": "MD5",
+        "timeStamp": "1612451097",
+        "paySign": "39FD249CD03B24FDA1755493F09D7C2E"
+    }
+}';
+		echo $string;
+	}
+	
 }

+ 59 - 50
biz-ghs/custom/classes/CustomClass.php

@@ -4,59 +4,68 @@ namespace bizGhs\custom\classes;
 
 use bizGhs\merchant\classes\MerchantClass;
 use common\components\business;
+use common\components\util;
 use Yii;
 use biz\base\classes\BaseClass;
 
 class CustomClass extends BaseClass
 {
-	
-	public static $baseFile = '\bizGhs\custom\models\Custom';
-	
-	public static function getCustomByIds($ids)
-	{
-		$list = self::getByIds($ids, null, 'id');
-		return self::groupBaseInfo($list);
-	}
-	
-	//整合头像等信息 shish 2021.1.8
-	public static function groupBaseInfo($list)
-	{
-		if (empty($list)) {
-			return $list;
-		}
-		//获取客户信息
-		$downIdList = array_unique(array_filter(array_column($list, 'downId')));
-		$retailInfo = MerchantClass::getByIds($downIdList, null, 'id');
-		foreach ($list as $key => $val) {
-			$downId = $val['downId'];
-			$currentInfo = isset($retailInfo[$downId]) ? $retailInfo[$downId] : [];
-			//组合头像
-			$currentInfo = business::formatMerchantLogo($currentInfo);
-			$list[$key]['smallAvatar'] = isset($currentInfo['smallLogoUrl']) ? $currentInfo['smallLogoUrl'] : '';
-			$list[$key]['avatar'] = isset($currentInfo['logoUrl']) ? $currentInfo['logoUrl'] : '';
-			$list[$key]['visitTime'] = '06-11 12:50';
-			$list[$key]['level'] = 0;
-		}
-		return $list;
-	}
-	
-	//欠款权限开关 shish 2021.1.8
-	public static function debt($custom, $debt)
-	{
-		$id = isset($custom['id']) ? $custom['id'] : 0;
-		self::updateById($id, ['debt' => $debt]);
-		return true;
-	}
-	
-	//权限判断 shish 2021.1.8
-	public static function valid($custom, $merchantId)
-	{
-		if (empty($custom)) {
-			util::fail('没有找到客户');
-		}
-		if ($custom['merchantId'] != $merchantId) {
-			util::fail('您没有权限操作此客户');
-		}
-	}
-	
+
+    public static $baseFile = '\bizGhs\custom\models\Custom';
+
+    //获取客户信息 shish 2021.2.4
+    public static function getCustom($id)
+    {
+        $info = self::getById($id);
+        $respond = self::groupBaseInfo([$info]);
+        return current($respond);
+    }
+
+    public static function getCustomByIds($ids)
+    {
+        $list = self::getByIds($ids, null, 'id');
+        return self::groupBaseInfo($list);
+    }
+
+    //整合头像等信息 shish 2021.1.8
+    public static function groupBaseInfo($list)
+    {
+        if (empty($list)) {
+            return $list;
+        }
+        //获取客户信息
+        $downIdList = array_unique(array_filter(array_column($list, 'downId')));
+        $retailInfo = MerchantClass::getByIds($downIdList, null, 'id');
+        foreach ($list as $key => $val) {
+            $downId = $val['downId'];
+            $currentInfo = isset($retailInfo[$downId]) ? $retailInfo[$downId] : [];
+            //组合头像
+            $currentInfo = business::formatMerchantLogo($currentInfo);
+            $list[$key]['smallAvatar'] = isset($currentInfo['smallLogoUrl']) ? $currentInfo['smallLogoUrl'] : '';
+            $list[$key]['avatar'] = isset($currentInfo['logoUrl']) ? $currentInfo['logoUrl'] : '';
+            $list[$key]['visitTime'] = '06-11 12:50';
+            $list[$key]['level'] = 0;
+        }
+        return $list;
+    }
+
+    //欠款权限开关 shish 2021.1.8
+    public static function debt($custom, $debt)
+    {
+        $id = isset($custom['id']) ? $custom['id'] : 0;
+        self::updateById($id, ['debt' => $debt]);
+        return true;
+    }
+
+    //权限判断 shish 2021.1.8
+    public static function valid($custom, $merchantId)
+    {
+        if (empty($custom)) {
+            util::fail('没有找到客户');
+        }
+        if ($custom['merchantId'] != $merchantId) {
+            util::fail('您没有权限操作此客户');
+        }
+    }
+
 }

+ 49 - 39
biz-ghs/custom/services/CustomService.php

@@ -9,43 +9,53 @@ use Yii;
 
 class CustomService extends BaseService
 {
-	
-	public static $baseFile = '\bizGhs\custom\classes\CustomClass';
-	
-	public static function getCustomList($where)
-	{
-		$data = CustomClass::getList('*', $where, 'addTime DESC');
-		$data['isOpenNum'] = 10;
-		$data['allNum'] = 80;
-		$list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
-		if (empty($list)) {
-			return $data;
-		}
-		$data['list'] = CustomClass::groupBaseInfo($list);
-		return $data;
-	}
-	
-	//获取客户信息,包括商家头像和店长信息 shish 2021.1.8
-	public static function getCustomInfo($customId)
-	{
-		$custom = CustomClass::getById($customId);
-		if (empty($custom)) {
-			return [];
-		}
-		$list = CustomClass::groupBaseInfo([$custom]);
-		$custom = current($list);
-		$downShopId = $custom['downShopId'] ?? 0;
-		$downShop = \biz\merchant\classes\ShopClass::getById($downShopId);
-		$super = \biz\merchant\classes\ShopClass::getSuper($downShopId);
-		$custom['province'] = $downShop['province'] ?? '';
-		$custom['city'] = $downShop['city'] ?? '';
-		$custom['address'] = $downShop['address'] ?? '';
-		$custom['floor'] = $downShop['floor'] ?? '';
-		$custom['lat'] = $downShop['lat'] ?? '';
-		$custom['long'] = $downShop['long'] ?? '';
-		$custom['userName'] = $super['adminName'] ?? '';
-		$custom['mobile'] = $super['mobile'] ?? '';
-		return $custom;
-	}
-	
+
+    public static $baseFile = '\bizGhs\custom\classes\CustomClass';
+
+    public static function getCustomList($where)
+    {
+        $data = CustomClass::getList('*', $where, 'addTime DESC');
+        $data['isOpenNum'] = 10;
+        $data['allNum'] = 80;
+        $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
+        if (empty($list)) {
+            return $data;
+        }
+        $data['list'] = CustomClass::groupBaseInfo($list);
+        return $data;
+    }
+
+
+    //获取客户信息,包括商家头像和店长信息 shish 2021.1.8
+    public static function getCustomInfo($customId)
+    {
+        $custom = CustomClass::getById($customId);
+        if (empty($custom)) {
+            return [];
+        }
+        $list = CustomClass::groupBaseInfo([$custom]);
+        $custom = current($list);
+        $downShopId = $custom['downShopId'] ?? 0;
+        $downShop = \biz\merchant\classes\ShopClass::getById($downShopId);
+        $super = \biz\merchant\classes\ShopClass::getSuper($downShopId);
+        $custom['province'] = $downShop['province'] ?? '';
+        $custom['city'] = $downShop['city'] ?? '';
+        $custom['address'] = $downShop['address'] ?? '';
+        $custom['floor'] = $downShop['floor'] ?? '';
+        $custom['lat'] = $downShop['lat'] ?? '';
+        $custom['long'] = $downShop['long'] ?? '';
+        $custom['userName'] = $super['adminName'] ?? '';
+        $custom['mobile'] = $super['mobile'] ?? '';
+        return $custom;
+    }
+
+    //欠款客户列表 shish 2021.126
+    public static function getDebtList($where)
+    {
+        $data = CustomClass::getList('*', $where, 'debtAmount DESC');
+        $data['customNum'] = 10;
+        $data['debtAmount'] = 29980;
+        return $data;
+    }
+
 }

+ 68 - 68
biz-ghs/merchant/classes/ShopClass.php

@@ -13,81 +13,81 @@ use biz\base\classes\BaseClass;
 class ShopClass extends BaseClass
 {
 
-	public static $baseFile = '\bizGhs\merchant\models\Shop';
+    public static $baseFile = '\bizGhs\merchant\models\Shop';
 
-	public static function getShopList($where)
-	{
-		$list = self::getList('*', $where, 'addTime DESC');
-		return $list;
-	}
+    public static function getShopList($where)
+    {
+        $list = self::getList('*', $where, 'addTime DESC');
+        return $list;
+    }
 
-	//获取商家默认的门店ID shish 2020.1.19
-	public static function getDefaultShopId($merchant)
-	{
-		return isset($merchant['defaultShopId']) ? $merchant['defaultShopId'] : 0;
-	}
+    //获取商家默认的门店ID shish 2020.1.19
+    public static function getDefaultShopId($merchant)
+    {
+        return isset($merchant['defaultShopId']) ? $merchant['defaultShopId'] : 0;
+    }
 
-	//创建门店 shish 2021.1.14
-	public static function addShop($data)
-	{
-		$data['createTime'] = date("Y-m-d H:i:s");
-		$shopName = isset($data['shopName']) ? $data['shopName'] : '';
-		if (empty($shopName)) {
-			util::fail('请填写门店名称');
-		}
-		$exists = self::getByCondition(['merchantId' => $data['merchantId'], 'shopName' => $shopName]);
-		if (!empty($exists)) {
-			util::fail('门店名称已经存在');
-		}
-		$shop = self::add($data);
-		return $shop;
-	}
+    //创建门店 shish 2021.1.14
+    public static function addShop($data)
+    {
+        $data['createTime'] = date("Y-m-d H:i:s");
+        $shopName = isset($data['shopName']) ? $data['shopName'] : '';
+        if (empty($shopName)) {
+            util::fail('请填写门店名称');
+        }
+        $exists = self::getByCondition(['merchantId' => $data['merchantId'], 'shopName' => $shopName]);
+        if (!empty($exists)) {
+            util::fail('门店名称已经存在');
+        }
+        $shop = self::add($data);
+        return $shop;
+    }
 
-	//更新门店 shish 2020.2.29
-	public static function updateShop($id, $data)
-	{
-		$shopName = isset($data['shopName']) ? $data['shopName'] : '';
-		$merchantId = $data['merchantId'];
-		$findShop = self::getByCondition(['merchantId' => $merchantId, 'shopName' => $shopName]);
-		if (!empty($findShop) && $findShop['id'] != $id) {
-			util::fail('门店名称已经存在');
-		}
-		return self::updateById($id, $data);
-	}
+    //更新门店 shish 2020.2.29
+    public static function updateShop($id, $data)
+    {
+        $shopName = isset($data['shopName']) ? $data['shopName'] : '';
+        $merchantId = $data['merchantId'];
+        $findShop = self::getByCondition(['merchantId' => $merchantId, 'shopName' => $shopName]);
+        if (!empty($findShop) && $findShop['id'] != $id) {
+            util::fail('门店名称已经存在');
+        }
+        return self::updateById($id, $data);
+    }
 
-	//取商家所有门店 shish 2020.2.29
-	public static function getAllShop($merchantId,$filed="",$order=null)
-	{
-		return self::getAllByCondition(['merchantId' => $merchantId],$order,$filed);
-	}
+    //取商家所有门店 shish 2020.2.29
+    public static function getAllShop($merchantId)
+    {
+        return self::getAllByCondition(['merchantId' => $merchantId], null, 'id,shopName,avatar');
+    }
 
-	//验证权限 shish 2021.1.14
-	public static function valid($shop, $merchantId)
-	{
-		if (isset($shop['merchantId']) && $shop['merchantId'] == $merchantId) {
-			return true;
-		}
-		util::fail('您没有权限访问此店铺');
-	}
+    //验证权限 shish 2021.1.14
+    public static function valid($shop, $merchantId)
+    {
+        if (isset($shop['merchantId']) && $shop['merchantId'] == $merchantId) {
+            return true;
+        }
+        util::fail('您没有权限访问此店铺');
+    }
 
-	//删除门店 shish 2020.3.1
-	public static function deleteShop($shop)
-	{
-		if (isset($shop['default']) && $shop['default'] == 1) {
-			util::fail('默认门店不允许删除');
-		}
-		$id = $shop['id'];
-		self::updateById($id, ['delStatus' => 1]);
-	}
+    //删除门店 shish 2020.3.1
+    public static function deleteShop($shop)
+    {
+        if (isset($shop['default']) && $shop['default'] == 1) {
+            util::fail('默认门店不允许删除');
+        }
+        $id = $shop['id'];
+        self::updateById($id, ['delStatus' => 1]);
+    }
 
-	//生成收款码 shish 2021.1.14
-	public static function generateGatheringCode($merchantId, $shopId)
-	{
-		$url = Yii::$app->params['ghsDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $shopId;
-		//强制转成https
-		$url = httpUtil::becomeHttps($url);
-		$gatheringCode = qrCodeUtil::generateGatheringQrCode($url, $merchantId, $shopId, '', 10);
-		return $gatheringCode;
-	}
+    //生成收款码 shish 2021.1.14
+    public static function generateGatheringCode($merchantId, $shopId)
+    {
+        $url = Yii::$app->params['ghsDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $shopId;
+        //强制转成https
+        $url = httpUtil::becomeHttps($url);
+        $gatheringCode = qrCodeUtil::generateGatheringQrCode($url, $merchantId, $shopId, '', 10);
+        return $gatheringCode;
+    }
 
 }

+ 11 - 0
biz-ghs/order/services/OrderService.php

@@ -61,6 +61,17 @@ class OrderService extends BaseService
         return $data;
     }
 
+    //欠款记录 shish 2021.2.4
+    public static function getDebtOrderList($where)
+    {
+        $list = OrderClass::getAllList(['id', 'orderSn', 'actPrice', 'addTime'], $where, 'addTime DESC');
+        return [
+            'list' => $list,
+            'num' => 59,
+            'totalAmount' => 25915.00
+        ];
+    }
+
     //取客户最近若干条订单 shish 2019.11.30
     public static function getUserOrder($userId, $limit = 10, $order = null, $with = null)
     {

+ 25 - 0
sql.sql

@@ -1087,3 +1087,28 @@ CREATE TABLE `xhExpress` (
   PRIMARY KEY (`id`),
   UNIQUE KEY `uni_deliveryId` (`deliveryId`)
 ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='即时配送快递公司信息';
+
+=========
+== shish 2021-2-2
+
+将供货商和零售店绑定到自己的开放平台下 并且更新 xhWxBase 和 xhWxMiniBase 下的openAppId值
+
+===========
+== shish 20201-2-4
+ALTER TABLE `xhGhsCustom` ADD isDebt TINYINT NOT NULL DEFAULT 0 COMMENT '是否有欠款 0没有 1有' AFTER debt;
+ALTER TABLE xhGhsOrder ADD debt TINYINT NOT NULL DEFAULT 0 COMMENT '0没有欠款 1有欠款' AFTER `refund`;
+CREATE TABLE `xhGhsOrderClear` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `prePrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '应付款,原价,未修改价格,打折前',
+  `actPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实际付款,实价,修改后价格,打折后',
+  `orderSn` CHAR(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '订单号',
+  `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `orderIds` TEXT COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'id的json串',
+  `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
+  `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+  PRIMARY KEY (`id`)
+) COMMENT='清算订单';
+CREATE TABLE `xhGhsOrderClearSn` (
+  `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (`id`)
+) AUTO_INCREMENT=12358276 COMMENT='清算订单号';