shish 5 лет назад
Родитель
Сommit
ce6b29dda1

+ 2 - 2
app-mall/controllers/PayController.php

@@ -43,8 +43,8 @@ class PayController extends BaseController
 		$post['payWay'] = $this->isWx == true ? 0 : 1;
 		$lat2 = $post['receiveLat'];//收货人纬度
 		$lng2 = $post['long'];//收货人经度
-		$lat1 = $this->sj['shopLat'];//花店纬度
-		$lng1 = $this->sj['shopLong'];//花店经度
+		$lat1 = $this->sj['lat'];//花店纬度
+		$lng1 = $this->sj['long'];//花店经度
 		$calcDistance = util::getDistance($lat1, $lng1, $lat2, $lng2);//防止别人改动,PHP计算的距离会比腾讯js算的小,但能保证有一定准确性
 		$post['sendDistance'] = $post['sendDistance'] >= $calcDistance ? $post['sendDistance'] : $calcDistance;//二地距离
 		$sendDistance = $post['sendDistance'];

+ 7 - 7
biz-ghs/merchant/classes/MerchantClass.php

@@ -67,16 +67,16 @@ class MerchantClass extends BaseClass
         $data['status'] = 0;//待审核
         $data['createTime'] = $date;
         $data['updateTime'] = $date;
-        $data['shopLat'] = isset($data['lat']) ? $data['lat'] : (string)0;
-        $data['shopLong'] = isset($data['long']) ? $data['long'] : (string)0;
-        $data['shopPrecision'] = (string)0;
+        $data['lat'] = isset($data['lat']) ? $data['lat'] : (string)0;
+        $data['long'] = isset($data['long']) ? $data['long'] : (string)0;
+        $data['precision'] = (string)0;
         $data['wxToken'] = stringUtil::buildWxToken(0);
-        $data['shopPhotoList'] = isset($data['shopPhotoList']) ? $data['shopPhotoList'] : '';
+        $data['photoList'] = isset($data['photoList']) ? $data['photoList'] : '';
         $data['merchantName'] = isset($data['merchantName']) ? $data['merchantName'] : '';
-        $data['shopProvince'] = isset($data['province']) ? $data['province'] : '';
-        $data['shopCity'] = isset($data['city']) ? $data['city'] : '';
+        $data['province'] = isset($data['province']) ? $data['province'] : '';
+        $data['city'] = isset($data['city']) ? $data['city'] : '';
         $data['shopDist'] = isset($data['dist']) ? $data['dist'] : '';
-        $data['shopAddress'] = isset($data['address']) ? $data['address'] : '';
+        $data['address'] = isset($data['address']) ? $data['address'] : '';
         $data['alipayAccount'] = isset($data['alipayAccount']) ? $data['alipayAccount'] : '';
         $data['alipayAccountName'] = isset($data['alipayAccountName']) ? $data['alipayAccountName'] : '';
         //默认设置为代理商

+ 2 - 2
biz-ghs/merchant/services/ShopService.php

@@ -17,9 +17,9 @@ class ShopService extends BaseService
 	public static function getSendCost($lat, $lng, $jsStatDistance, $shopInfo)
 	{
 		//门店纬度
-		$shopLat = $shopInfo['shopLat'];
+		$shopLat = $shopInfo['lat'];
 		//门店经度
-		$shopLong = $shopInfo['shopLong'];
+		$shopLong = $shopInfo['long'];
 		//后端计算距离再确认
 		$phpStatDistance = util::getDistance($shopLat, $shopLong, $lat, $lng);
 		if ($phpStatDistance > $jsStatDistance) {

+ 2 - 2
biz-hd/merchant/services/ShopService.php

@@ -17,9 +17,9 @@ class ShopService extends BaseService
 	public static function getSendCost($lat, $lng, $jsStatDistance, $shopInfo)
 	{
 		//门店纬度
-		$shopLat = $shopInfo['shopLat'];
+		$shopLat = $shopInfo['lat'];
 		//门店经度
-		$shopLong = $shopInfo['shopLong'];
+		$shopLong = $shopInfo['long'];
 		//后端计算距离再确认
 		$phpStatDistance = util::getDistance($shopLat, $shopLong, $lat, $lng);
 		if ($phpStatDistance > $jsStatDistance) {

+ 7 - 7
biz-mall/merchant/classes/MerchantClass.php

@@ -67,16 +67,16 @@ class MerchantClass extends BaseClass
         $data['status'] = 0;//待审核
         $data['createTime'] = $date;
         $data['updateTime'] = $date;
-        $data['shopLat'] = isset($data['lat']) ? $data['lat'] : (string)0;
-        $data['shopLong'] = isset($data['long']) ? $data['long'] : (string)0;
-        $data['shopPrecision'] = (string)0;
+        $data['lat'] = isset($data['lat']) ? $data['lat'] : (string)0;
+        $data['long'] = isset($data['long']) ? $data['long'] : (string)0;
+        $data['precision'] = (string)0;
         $data['wxToken'] = stringUtil::buildWxToken(0);
-        $data['shopPhotoList'] = isset($data['shopPhotoList']) ? $data['shopPhotoList'] : '';
+        $data['photoList'] = isset($data['photoList']) ? $data['photoList'] : '';
         $data['merchantName'] = isset($data['merchantName']) ? $data['merchantName'] : '';
-        $data['shopProvince'] = isset($data['province']) ? $data['province'] : '';
-        $data['shopCity'] = isset($data['city']) ? $data['city'] : '';
+        $data['province'] = isset($data['province']) ? $data['province'] : '';
+        $data['city'] = isset($data['city']) ? $data['city'] : '';
         $data['shopDist'] = isset($data['dist']) ? $data['dist'] : '';
-        $data['shopAddress'] = isset($data['address']) ? $data['address'] : '';
+        $data['address'] = isset($data['address']) ? $data['address'] : '';
         $data['alipayAccount'] = isset($data['alipayAccount']) ? $data['alipayAccount'] : '';
         $data['alipayAccountName'] = isset($data['alipayAccountName']) ? $data['alipayAccountName'] : '';
         //默认设置为代理商

+ 2 - 2
biz-mall/merchant/services/ExpressService.php

@@ -19,8 +19,8 @@ class ExpressService extends BaseService
 	{
 		$shop = ShopClass::getById($shopId);
 		$shopLat = isset($shop['lat']) ? $shop['lat'] : '';
-		$shopLong = isset($shop['long']) ? $shop['long'] : '';
-		$distance = mapUtil::calculateDistance($shopLong, $shopLat, $lng, $lat);
+		$shopLong  = isset($shop['long']) ? $shop['long'] : '';
+		$distance = mapUtil::calculateDistance($shopLong , $shopLat, $lng, $lat);
 		$perKiloFee = isset($extend['freight']) ? $extend['freight'] : 10;
 		$freeDistance = isset($extend['freeDistance']) ? $extend['freeDistance'] : 5;
 		$fee = 0;

+ 2 - 2
biz-mall/merchant/services/ShopService.php

@@ -17,9 +17,9 @@ class ShopService extends BaseService
 	public static function getSendCost($lat, $lng, $jsStatDistance, $shopInfo)
 	{
 		//门店纬度
-		$shopLat = $shopInfo['shopLat'];
+		$shopLat = $shopInfo['lat'];
 		//门店经度
-		$shopLong = $shopInfo['shopLong'];
+		$shopLong = $shopInfo['long'];
 		//后端计算距离再确认
 		$phpStatDistance = util::getDistance($shopLat, $shopLong, $lat, $lng);
 		if ($phpStatDistance > $jsStatDistance) {

+ 1 - 1
biz/shop/services/ShopService.php

@@ -19,7 +19,7 @@ class ShopService extends BaseService
 		//门店纬度
 		$shopLat = $shopInfo['shopLat'];
 		//门店经度
-		$shopLong = $shopInfo['shopLong'];
+		$shopLong = $shopInfo['long'];
 		//后端计算距离再确认
 		$phpStatDistance = util::getDistance($shopLat, $shopLong, $lat, $lng);
 		if ($phpStatDistance > $jsStatDistance) {

+ 8 - 8
biz/sj/services/MerchantService.php

@@ -60,16 +60,16 @@ class MerchantService extends BaseService
         //生成商家
         $applyData['accountStyle'] = 0;
         $applyData['status'] = 1;
-        $applyData['shopLat'] = isset($applyData['lat']) ? $applyData['lat'] : (string)0;
-        $applyData['shopLong'] = isset($applyData['long']) ? $applyData['long'] : (string)0;
-        $applyData['shopPrecision'] = (string)0;
+        $applyData['lat'] = isset($applyData['lat']) ? $applyData['lat'] : (string)0;
+        $applyData['long'] = isset($applyData['long']) ? $applyData['long'] : (string)0;
+        $applyData['precision'] = (string)0;
         $applyData['wxToken'] = stringUtil::buildWxToken(0);
-        $applyData['shopPhotoList'] = isset($applyData['shopPhotoList']) ? $applyData['shopPhotoList'] : '';
+        $applyData['photoList'] = isset($applyData['photoList']) ? $applyData['photoList'] : '';
         $applyData['merchantName'] = isset($applyData['merchantName']) ? $applyData['merchantName'] : '';
-        $applyData['shopProvince'] = isset($applyData['province']) ? $applyData['province'] : '';
-        $applyData['shopCity'] = isset($applyData['city']) ? $applyData['city'] : '';
-        $applyData['shopDist'] = isset($applyData['dist']) ? $applyData['dist'] : '';
-        $applyData['shopAddress'] = isset($applyData['address']) ? $applyData['address'] : '';
+        $applyData['province'] = isset($applyData['province']) ? $applyData['province'] : '';
+        $applyData['city'] = isset($applyData['city']) ? $applyData['city'] : '';
+        $applyData['dist'] = isset($applyData['dist']) ? $applyData['dist'] : '';
+        $applyData['address'] = isset($applyData['address']) ? $applyData['address'] : '';
         $applyData['alipayAccount'] = isset($applyData['alipayAccount']) ? $applyData['alipayAccount'] : '';
         $applyData['alipayAccountName'] = isset($applyData['alipayAccountName']) ? $applyData['alipayAccountName'] : '';
         $applyData['agentLevel'] = 1;

+ 17 - 19
common/config/params.php

@@ -67,27 +67,25 @@ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
 }
 
 if (getenv('YII_ENV') == 'local') {
-    $config['hdHost'] = $prefixHttp . 'api.shop.hhb.com';
-    $config['hdDomain'] = $prefixHttp . 'shop.hhb.com';
-    $config['hdPtHost'] = $prefixHttp . 'api.pt.hhb.com';
-    $config['hdShortHost'] = 'hhb.com';
-    $config['hdImgHost'] = $prefixHttp . 'img.hhb.com/';
-
-    $config['ghsHost'] = $prefixHttp . 'api.shop.xhb.com';
-    $config['ghsDomain'] = $prefixHttp . 'shop.xhb.com';
-    $config['ghsPtHost'] = $prefixHttp . 'api.pt.xhb.com';
-    $config['ghsShortHost'] = 'xhb.com';
-    $config['ghsImgHost'] = $prefixHttp . 'img.xhb.com/';
-
-    $config['mallHost'] = $prefixHttp . 'api.shop.the.cn';
-    $config['mallDomain'] = $prefixHttp . 'shop.the.cn';
-    $config['mallPtHost'] = $prefixHttp . 'api.pt.the.cn';
-    $config['mallShortHost'] = 'the.cn';
-    $config['mallImgHost'] = $prefixHttp . 'img.the.cn/';
+    $config['hdHost'] = $prefixHttp . 'api.shop.huaml.com';
+    $config['hdDomain'] = $prefixHttp . 'shop.huaml.com';
+    $config['hdPtHost'] = $prefixHttp . 'api.pt.huaml.com';
+    $config['hdShortHost'] = 'huaml.com';
+    $config['hdImgHost'] = $prefixHttp . 'img.huaml.com/';
 
-    $config['ossBucket'] = 'pic-hhb-cs';
+    $config['ghsHost'] = $prefixHttp . 'api.shop.hzghd.com';
+    $config['ghsDomain'] = $prefixHttp . 'shop.hzghd.com';
+    $config['ghsPtHost'] = $prefixHttp . 'api.pt.hzghd.com';
+    $config['ghsShortHost'] = 'hzghd.com';
+    $config['ghsImgHost'] = $prefixHttp . 'img.hzghd.com/';
 
-    //Dada
+    $config['mallHost'] = $prefixHttp . 'api.shop.theflorist.cn';
+    $config['mallDomain'] = $prefixHttp . 'shop.theflorist.cn';
+    $config['mallPtHost'] = $prefixHttp . 'api.pt.theflorist.cn';
+    $config['mallShortHost'] = 'theflorist.cn';
+    $config['mallImgHost'] = $prefixHttp . 'img.theflorist.cn/';
+
+    $config['ossBucket'] = 'pic-hhb-cs';
     $config['dadaOnline']= false; //正式环境改为true
 }
 if (getenv('YII_ENV') == 'test') {

+ 30 - 40
common/services/xhShopService.php

@@ -126,11 +126,8 @@ class xhShopService {
         self::getByPoiId($poiId);
     }
 
-    /**
-     * 微信门店拉取并保存
-     * @param $merchant
-     * @return bool $array:有拉取到门店(总共数、成功数、审批中的数、失败数)  false:无门店
-     */
+
+    //微信门店拉取并保存
     public function saveShopList($merchant)
     {
         $faileApply = 0;
@@ -164,12 +161,12 @@ class xhShopService {
             $data['branchName']		= $shop['branch_name'];
             $data['merchantId']		= $merchantId;
             $data['poiId']			= $poiId;//poiId适用于门店
-            $data['shopLat']		= (string)$shop['latitude'];
-            $data['shopLong']		= (string)$shop['longitude'];
-            $data['shopProvince']	= $shop['province'];
-            $data['shopCity']		= $shop['city'];
-            $data['shopDist']		= $shop['district'];
-            $data['shopAddress']	= $shop['address'];
+            $data['lat']		= (string)$shop['latitude'];
+            $data['long']		= (string)$shop['longitude'];
+            $data['province']	= $shop['province'];
+            $data['city']		= $shop['city'];
+            $data['dist']		= $shop['district'];
+            $data['address']	= $shop['address'];
             $data['telephone']		= $shop['telephone'];
             $data['introduction']	= $shop['introduction'];
             $data['addTime']		= $now;
@@ -209,11 +206,7 @@ class xhShopService {
         return false;
     }
 
-    /**
-     * 运营平台后台中调用的,用于自动生成门店数据
-     * @param $mcInfo
-     * @param string $branchName
-     */
+    //运营平台后台中调用的,用于自动生成门店数据
     public function platformInitStore($mcInfo, $merchant, $branchName = ''){
         $wxUtil = new wxUtil($merchant);
         $xhShopService = new xhShopService();
@@ -232,12 +225,12 @@ class xhShopService {
         $data['merchantId']		= $mcInfo['id'];
         $data['poiId']			= '';
         $data['shopId']         = '';
-        $data['shopLat']		= (string)$mcInfo['shopLat'];
-        $data['shopLong']		= (string)$mcInfo['shopLong'];
-        $data['shopProvince']	= $mcInfo['shopProvince'];
-        $data['shopCity']		= $mcInfo['shopCity'];
-        $data['shopDist']		= $mcInfo['shopDist'];
-        $data['shopAddress']	= $mcInfo['shopAddress'];
+        $data['lat']		= (string)$mcInfo['lat'];
+        $data['long']		= (string)$mcInfo['long'];
+        $data['province']	= $mcInfo['province'];
+        $data['city']		= $mcInfo['city'];
+        $data['dist']		= $mcInfo['dist'];
+        $data['address']	= $mcInfo['address'];
         $data['telephone']		= '';
         $data['introduction']	= '';
         $data['addTime']		= $now;
@@ -251,11 +244,8 @@ class xhShopService {
         return 'shopData save error';
     }
 
-    /**
-     * 从 xhShop 取数据
-     * 给微信接口传门店信息 (门店信息格式化)
-     * @param $shopId  门店表id
-     */
+
+    //从 xhShop 取数据 给微信接口传门店信息 (门店信息格式化)
     public function getShopData($shopId){
         $shop = xhShopService::getById($shopId);
         $info = ["business" =>[
@@ -263,15 +253,15 @@ class xhShopService {
                 //"sid" => '123456',//非必须参数
                 "business_name" => $shop['businessName'],//门店名称
                 "branch_name" => $shop['branchName'],
-                "province" => $shop['shopProvince'], //"不超过10个字",
-                "city" => $shop['shopCity'],//"不超过30个字",
-                "district" => $shop['shopDist'],//"不超过10个字",
-                "address" => $shop['shopAddress'],//"门店所在的详细街道地址(不要填写省市信息):不超过80个字",
+                "province" => $shop['province'], //"不超过10个字",
+                "city" => $shop['city'],//"不超过30个字",
+                "district" => $shop['dist'],//"不超过10个字",
+                "address" => $shop['address'],//"门店所在的详细街道地址(不要填写省市信息):不超过80个字",
                 "telephone" => $shop['telephone'],//"不超53个字符(不可以出现文字)",
                 "categories" => '休闲娱乐,其它娱乐休闲',
                 "offset_type" => 1,//坐标类型
-                "longitude" => $shop['shopLong'],
-                "latitude" => $shop['shopLat'],
+                "longitude" => $shop['long'],
+                "latitude" => $shop['lat'],
                 //"photo_list" => ["photo_url"=>"https:// 不超过20张.com", "photo_url"=>"https://XXX.com"],
                 //"recommend" => "不超过200字。麦辣鸡腿堡套餐,麦乐鸡,全家桶",
                 //"special" => "不超过200字。免费wifi,外卖服务",
@@ -301,7 +291,7 @@ class xhShopService {
         if(empty($mcInfo)){
             $mcInfo = $merchantInfo = xhMerchantService::getById($merchantId);
         }
-        if(empty($mcInfo['shopDist'])){
+        if(empty($mcInfo['dist'])){
             throw new \Exception("区(县)未设定");
         }
 
@@ -310,15 +300,15 @@ class xhShopService {
                 //"sid" => '123456',//非必须参数
                 "business_name" => $mcInfo['merchantName'],//门店名称
                 "branch_name" => $branchName,
-                "province" => $mcInfo['shopProvince'], //"不超过10个字",
-                "city" => $mcInfo['shopCity'],//"不超过30个字",
-                "district" => empty($mcInfo['shopDist']) ? '' : $mcInfo['shopDist'],//"不超过10个字",
-                "address" => $mcInfo['shopAddress'],//"门店所在的详细街道地址(不要填写省市信息):不超过80个字",
+                "province" => $mcInfo['province'], //"不超过10个字",
+                "city" => $mcInfo['city'],//"不超过30个字",
+                "district" => empty($mcInfo['dist']) ? '' : $mcInfo['dist'],//"不超过10个字",
+                "address" => $mcInfo['address'],//"门店所在的详细街道地址(不要填写省市信息):不超过80个字",
                 "telephone" => '18259179840',//"不超53个字符(不可以出现文字)",
                 "categories" => '休闲娱乐,其它娱乐休闲',
                 "offset_type" => 1,
-                "longitude" => $mcInfo['shopLong'],
-                "latitude" => $mcInfo['shopLat'],
+                "longitude" => $mcInfo['long'],
+                "latitude" => $mcInfo['lat'],
                 //"photo_list" => ["photo_url"=>"https:// 不超过20张.com", "photo_url"=>"https://XXX.com"],
                 //"recommend" => "不超过200字。麦辣鸡腿堡套餐,麦乐鸡,全家桶",
                 //"special" => "不超过200字。免费wifi,外卖服务",

+ 10 - 1
sql.sql

@@ -1876,4 +1876,13 @@ CREATE TABLE IF NOT EXISTS `xhGhs` (
   `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
   `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
   PRIMARY KEY (`id`)
-) ENGINE=INNODB AUTO_INCREMENT=125861 COMMENT='供应商关系';
+) ENGINE=INNODB AUTO_INCREMENT=125861 COMMENT='供应商关系';
+ALTER TABLE `xhSj` DROP COLUMN `shopName`;
+ALTER TABLE `xhSj` CHANGE `shopProvince` `province` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '省';
+ALTER TABLE `xhSj` CHANGE `shopCity` `city` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '市';
+ALTER TABLE `xhSj` CHANGE  `shopDist` `dist` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '区县';
+ALTER TABLE `xhSj` CHANGE  `shopAddress` `address` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '详细街道地址';
+ALTER TABLE `xhSj` CHANGE  `shopLat` `lat` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '商店的纬度';
+ALTER TABLE `xhSj` CHANGE  `shopLong` `long` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '商店的经度';
+ALTER TABLE `xhSj` CHANGE  `shopPrecision` `precision` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '商店的精度';
+ALTER TABLE `xhSj` CHANGE  `shopPhotoList` `photoList` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '店面门牌照片 json';