shish 5 лет назад
Родитель
Сommit
3ccd114a51
2 измененных файлов с 9 добавлено и 6 удалено
  1. 2 2
      app/ghs/controllers/CustomController.php
  2. 7 4
      biz/saas/services/ApplyService.php

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

@@ -65,8 +65,8 @@ class CustomController extends BaseController
     //添加新客户 shish 2021.1.8
     public function actionAdd()
     {
-        $get = Yii::$app->request->get();
-        ApplyService::addCustom($get,$this->ghsId);
+        $post = Yii::$app->request->post();
+        ApplyService::addCustom($post,$this->ghsId);
         util::complete('已提交审核');
     }
 

+ 7 - 4
biz/saas/services/ApplyService.php

@@ -90,7 +90,7 @@ class ApplyService extends BaseService
 		noticeUtil::push('客户 ' . $mobile . ' 已提交开店资料,请及时跟进', '15280215347');
 		return ApplyClass::addApply($data);
 	}
-
+	
 	//供货商新增客户 shish 2021.1.10
 	public static function addCustom($data, $ghsId)
 	{
@@ -102,10 +102,13 @@ class ApplyService extends BaseService
 		if (!empty($apply)) {
 			util::fail('手机号已被使用');
 		}
-		$prefix = $data['province'] == $data['city'] ? $data['province'] : $data['province'] . $data['city'];
+		$currentAddress = $data['address'] ?? '';
+		if (isset($data['province']) && isset($data['city'])) {
+			$prefix = $data['province'] == $data['city'] ? $data['province'] : $data['province'] . $data['city'];
+		}
 		$dist = isset($data['dist']) ? $data['dist'] : '';
 		$floor = isset($data['floor']) ? $data['floor'] : '';
-		$data['fullAddress'] = $prefix . $dist . $data['address'] . $floor;
+		$data['fullAddress'] = $prefix . $dist . $currentAddress . $floor;
 		$data['introMerchantId'] = $ghsId;
 		$data['introStyle'] = MerchantClass::STYLE_SUPPLIER;
 		$mobile = $data['mobile'];
@@ -113,5 +116,5 @@ class ApplyService extends BaseService
 
 		return ApplyClass::addApply($data);
 	}
-
+	
 }