Przeglądaj źródła

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

林琦海 5 lat temu
rodzic
commit
7a03d5dab2

+ 5 - 3
app/ghs/controllers/ApplyController.php

@@ -2,6 +2,7 @@
 
 namespace ghs\controllers;
 
+use biz\saas\classes\ApplyExtendClass;
 use bizTy\sj\classes\MerchantClass;
 use bizGhs\shop\services\ShopAdminService;
 use biz\saas\services\ApplyService;
@@ -17,7 +18,7 @@ use yii\web\Controller;
 
 class ApplyController extends BaseController
 {
-
+	
 	//邀请开店列表 shish 2021.1.28
 	public function actionList()
 	{
@@ -33,7 +34,7 @@ class ApplyController extends BaseController
 		$data = ApplyService::getApplyList($where);
 		util::success($data);
 	}
-
+	
 	//审核
 	public function actionCheck()
 	{
@@ -62,7 +63,8 @@ class ApplyController extends BaseController
 		$post['long'] = isset($post['longitude']) ? $post['longitude'] : '';
 		$post['lat'] = isset($post['latitude']) ? $post['latitude'] : '';
 		$post['from'] = ApplyClass::FROM_GHS;
-		ApplyService::addApply($post);
+		$post['certType'] = ApplyClass::CERT_TYPE_LICENSE;
+		ApplyService::addNewApply($post);
 		util::complete();
 	}
 	

+ 2 - 6
app/ghs/controllers/CustomController.php

@@ -72,7 +72,7 @@ class CustomController extends BaseController
 		$post['from'] = ApplyClass::FROM_GHS;
 		$post['introSjId'] = $this->sjId;
 		$post['introStyle'] = MerchantClass::STYLE_SUPPLIER;
-		$post['certType'] = ApplyExtendClass::CERT_TYPE_MOBILE;
+		$post['certType'] = ApplyClass::CERT_TYPE_MOBILE;
 		$mobile = $post['mobile'] ?? '';
 		$confirmMobile = $post['confirmMobile'];
 		if (stringUtil::isMobile($mobile) == false) {
@@ -81,11 +81,7 @@ class CustomController extends BaseController
 		if ($mobile != $confirmMobile) {
 			util::fail('二次号码填写不一致');
 		}
-		$extend = ApplyExtendClass::getByCondition(['certType' => ApplyExtendClass::CERT_TYPE_MOBILE, 'mobile' => $mobile]);
-		if (!empty($extend)) {
-			util::fail('此客户已存在');
-		}
-		ApplyService::addApply($post);
+		ApplyService::addNewApply($post);
 		util::complete('添加成功,等待审核');
 	}
 

+ 6 - 6
app/ghs/controllers/MerchantController.php

@@ -32,7 +32,7 @@ class MerchantController extends BaseController
 		$merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
 		util::success($merchant);
 	}
-
+	
 	//商家现有的会员等级 shish 2019.12.12
 	public function actionMemberLevel()
 	{
@@ -96,7 +96,7 @@ class MerchantController extends BaseController
 		$ids = SetAuthService::getAuthIdList($setId, $endId);
 		util::success(['ids' => $ids]);
 	}
-	
+
 	//商家信息 shish 2020.1.11
 	public function actionIntroduceShop()
 	{
@@ -106,10 +106,10 @@ class MerchantController extends BaseController
 			util::fail('没有找到介绍人');
 		}
 		$merchantName = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
-		$smallLogoUrl = isset($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : '';
-		$logoUrl = isset($merchant['logoUrl']) ? $merchant['logoUrl'] : '';
-		$data = ['merchantName' => $merchantName, 'smallLogoUrl' => $smallLogoUrl, 'id' => $id, 'logoUrl' => $logoUrl, 'fullAddress' => '暂无'];
+		$logoUrl = isset($merchant['smallLogoUrl']) && !empty($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : Yii::$app->params['imgHost'] . '/hhb_small.png';
+		$address = $merchant['address'] ?? '';
+		$data = ['merchantName' => $merchantName, 'smallLogoUrl' => $logoUrl, 'id' => $id, 'fullAddress' => $address];
 		util::success($data);
 	}
-	
+
 }

+ 12 - 0
app/ghs/controllers/WxBaseController.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace ghs\controllers;
+
+use common\components\jsSDK;
+use common\components\util;
+use Yii;
+
+class WxBaseController extends BaseController
+{
+
+}

+ 20 - 0
app/ghs/controllers/WxOpenController.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizTy\wx\classes\WxOpenClass;
+use common\components\jsSDK;
+use common\components\util;
+use Yii;
+
+class WxOpenController extends BaseController
+{
+
+	//获取小程序信息 shish 2021.2.25
+	public function actionGetMiniInfo()
+	{
+		$respond = WxOpenClass::getMiniInfo();
+		util::success($respond);
+	}
+
+}

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

@@ -69,7 +69,7 @@ class ApplyController extends BaseController
 		if (stringUtil::isMobile($post['mobile']) == false) {
 			util::fail('请填写正确手机号');
 		}
-		ApplyService::addApply($post);
+		ApplyService::addNewApply($post);
 		util::complete();
 	}
 	

+ 20 - 0
app/shop/controllers/WxOpenController.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace shop\controllers;
+
+use bizTy\wx\classes\WxOpenClass;
+use common\components\jsSDK;
+use common\components\util;
+use Yii;
+
+class WxOpenController extends BaseController
+{
+
+	//获取小程序信息 shish 2021.2.25
+	public function actionGetMiniInfo()
+	{
+		$respond = WxOpenClass::getMiniInfo();
+		util::success($respond);
+	}
+
+}

+ 13 - 0
biz-ty/wx/classes/WxMiniBaseClass.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace bizTy\wx\classes;
+
+use Yii;
+use bizTy\base\classes\BaseClass;
+
+class WxMiniBaseClass extends BaseClass
+{
+	
+	public static $baseFile = '\bizTy\wx\models\WxMiniBase';
+	
+}

+ 46 - 0
biz-ty/wx/classes/WxOpenClass.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace bizTy\wx\classes;
+
+use bizTy\sj\classes\MerchantClass;
+use common\components\util;
+use Yii;
+use bizTy\base\classes\BaseClass;
+
+class WxOpenClass extends BaseClass
+{
+	
+	public static $baseFile = '\bizTy\wx\models\WxOpen';
+	
+	const OPEN_STYLE_RETAIL = 1;
+	const OPEN_STYLE_GHS = 2;
+	
+	//获取所有的小程序信息 shish 2021.2.25
+	public static function getMiniInfo()
+	{
+		$ghsOpen = self::getGhsOpen();
+		$wxGhsMiniBaseId = $ghsOpen['wxGhsMiniBaseId'] ?? 0;
+		$arr = [];
+		$ghsMini = WxMiniBaseClass::getById($wxGhsMiniBaseId);
+		$arr['ghs']['miniAppId'] = $ghsMini['miniAppId'] ?? '';
+		$retailOpen = self::getRetailOpen();
+		$wxMiniBaseId = $retailOpen['wxMiniBaseId'] ?? 0;
+		$wxMini = WxMiniBaseClass::getById($wxGhsMiniBaseId);
+		$arr['retail']['miniAppId'] = $wxMini['miniAppId'] ?? '';
+		return $arr;
+	}
+	
+	//取供货商平台信息 shish 2021.2.25
+	public static function getGhsOpen()
+	{
+		//暂时只有一个平台,取一个平台
+		return self::getByCondition(['style' => self::OPEN_STYLE_RETAIL]);
+	}
+	
+	//取零售平台信息 shish 2021.2.25
+	public static function getRetailOpen()
+	{
+		return self::getByCondition(['style' => self::OPEN_STYLE_RETAIL]);
+	}
+	
+}

+ 15 - 0
biz-ty/wx/models/WxMiniBase.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace bizTy\wx\models;
+
+use bizTy\base\models\Base;
+
+class WxMiniBase extends Base
+{
+	
+	public static function tableName()
+	{
+		return 'xhWxMiniBase';
+	}
+	
+}

+ 13 - 0
biz-ty/wx/models/WxOpen.php

@@ -0,0 +1,13 @@
+<?php
+namespace bizTy\wx\models;
+use bizTy\base\models\Base;
+
+class WxOpen extends Base
+{
+
+	public static function tableName()
+	{
+		return 'xhWxOpen';
+	}
+
+}

+ 14 - 0
biz-ty/wx/services/WxMiniBaseService.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace bizTy\wx\services;
+
+use bizTy\base\services\BaseService;
+use bizTy\wx\classes\WxOpenClass;
+use Yii;
+
+class WxMiniBaseService extends BaseService
+{
+	
+	public static $baseFile = '\bizTy\wx\classes\WxMiniBaseClass';
+	
+}

+ 14 - 0
biz-ty/wx/services/WxOpenService.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace bizTy\wx\services;
+
+use bizTy\base\services\BaseService;
+use bizTy\wx\classes\WxOpenClass;
+use Yii;
+
+class WxOpenService extends BaseService
+{
+
+	public static $baseFile = '\bizTy\wx\classes\WxOpenClass';
+
+}

+ 6 - 1
biz/saas/classes/ApplyClass.php

@@ -24,7 +24,12 @@ class ApplyClass extends BaseClass
 	const STATUS_UN_PASS = 3;
 	const STATUS_HAS_PAY = 4;
 	const STATUS_EXPIRE = 5;
-
+	
+	//证件类型
+	const CERT_TYPE_LICENSE = 1;
+	const CERT_TYPE_PERSON = 2;
+	const CERT_TYPE_MOBILE = 3;
+	
 	//添加申请 shish 2020.2.10
 	public static function addApply($data)
 	{

+ 0 - 5
biz/saas/classes/ApplyExtendClass.php

@@ -15,11 +15,6 @@ class ApplyExtendClass extends BaseClass
 
     public static $baseFile = '\biz\saas\models\ApplyExtend';
 
-	//证件类型
-    const CERT_TYPE_LICENSE = 1;
-	const CERT_TYPE_PERSON = 2;
-	const CERT_TYPE_MOBILE = 3;
-
     public static function getExtendByIds($ids)
     {
         $list = self::getAllByCondition(['applyId' => ['in', $ids]], null, '*', 'applyId');

+ 9 - 3
biz/saas/services/ApplyService.php

@@ -75,11 +75,11 @@ class ApplyService extends BaseService
 	}
 	
 	//申请开店 shish 2021.01.28
-	public static function addApply($data)
+	public static function addNewApply($data)
 	{
 		$style = $data['style'] ?? 0;
 		if (in_array($style, [MerchantClass::STYLE_RETAIL, MerchantClass::STYLE_SUPPLIER]) == false) {
-			util::fail('请确认开店资料');
+			util::fail('请确认商家类型');
 		}
 		$mobile = $data['mobile'] ?? 0;
 		if (empty($mobile)) {
@@ -88,10 +88,16 @@ class ApplyService extends BaseService
 		if (stringUtil::isMobile($mobile) == false) {
 			util::fail('请填写正确手机号');
 		}
+		//查询客户提交的证件
+		$certType = $data['certType'] ?? ApplyClass::CERT_TYPE_LICENSE;
+		$extend = ApplyClass::getByCondition(['certType' => $certType, 'mobile' => $mobile]);
+		if (!empty($extend)) {
+			util::fail('已申请过了');
+		}
 		$adminId = $data['adminId'] ?? 0;
 		$from = $data['from'] ?? 0;
 		if (in_array($from, [ApplyClass::FROM_GHS, ApplyClass::FROM_RETAIL]) == false) {
-			util::fail('请确认开店资料是否完整!');
+			util::fail('申请没有填写来源');
 		}
 		$prefix = $data['province'] == $data['city'] ? $data['province'] : $data['province'] . $data['city'];
 		$dist = $data['dist'] ?? '';

+ 13 - 4
sql.sql

@@ -1064,13 +1064,13 @@ ALTER TABLE `xhCustom` ADD `mobile` VARCHAR(15) NOT NULL DEFAULT '0' COMMENT '
 ALTER TABLE xhCustom ADD `visitTime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '最后一次访问时间' AFTER `member`;
 
 ======
-==linqh 2021.1.31
+==linqh 2021-1-31
 
 ALTER TABLE `xhGhsProduct`
 ADD COLUMN `priceLabel`  tinyint(2) UNSIGNED NOT NULL DEFAULT 1 COMMENT '价格标识(price): 1 自动调价,2改价' AFTER `price`;
 
 ======
-==linqh 2021.2.2
+==linqh 2021-2-2
 ALTER TABLE `xhGhsStockRecord`
 MODIFY COLUMN `itemNum`  decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '花材数量' AFTER `itemId`;
 
@@ -1090,7 +1090,7 @@ CREATE TABLE `xhExpressLocal` (
 =========
 == shish 2021-2-2
 
-将供货商和零售店绑定到自己的开放平台下 并且更新 xhWxBase 和 xhWxMiniBase 下的openAppId值
+将供货商和零售店的公众号和小程序绑定到自我开放平台下 并且更新 xhWxBase 和 xhWxMiniBase 下的openAppId值
 
 ===========
 == shish 20201-2-4
@@ -1257,6 +1257,15 @@ CREATE TABLE IF NOT EXISTS `xhUserPast` (
 ALTER TABLE xhUserPast CHANGE `integral` growth INT(11) NOT NULL DEFAULT '0' COMMENT '成长值';
 
 ===
-==linqh 2021.2.24
+==linqh 2021-2-24
 ALTER TABLE `xhExpress`
 ADD COLUMN `shopNo`  varchar(100) NOT NULL DEFAULT '' COMMENT '门店' AFTER `appSecret`;
+
+========
+== shish 2021-2-25
+需要琦海配好线上的wss以及确认HTTP_ORIGIN限制问题
+
+ALTER TABLE xhApply ADD `licenseNo` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '营业执照号码' AFTER `name`;
+ALTER TABLE xhApply ADD `certType` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '证件类型 1营业执照 2身份证号 3手机号' AFTER `licenseNo`;
+ALTER TABLE xhApplyExtend DROP COLUMN `certType`;
+ALTER TABLE xhWxOpen ADD `style` TINYINT NOT NULL DEFAULT 1 COMMENT '平台类型 1零售 2供货' AFTER `appSecret`;