|
|
@@ -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,外卖服务",
|