|
|
@@ -26,21 +26,11 @@ class GhsClass extends BaseClass
|
|
|
//补充供货商 ssh 20211028
|
|
|
public static function bcGhs($hdShopId)
|
|
|
{
|
|
|
- //不再主动推荐供应商
|
|
|
return false;
|
|
|
- if (getenv('YII_ENV') == 'production') {
|
|
|
- //莱漫花行、长安花行、宣言花行、纯彩花艺
|
|
|
- $ids = [214, 203, 418, 10];
|
|
|
- } else {
|
|
|
- $ids = [36225, 36295];
|
|
|
- }
|
|
|
- foreach ($ids as $ghsShopId) {
|
|
|
- CustomClass::build($ghsShopId, $hdShopId);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
//新增客户和供应商关系 ssh 2021.4.13
|
|
|
- public static function build($ghsShopId, $hdShopId, $type = 1)
|
|
|
+ public static function build($ghsShopId, $hdShopId, $type = 1, $changeName = '')
|
|
|
{
|
|
|
if ($type == 1) {
|
|
|
$ghs = self::getByCondition(['ownShopId' => $hdShopId, 'shopId' => $ghsShopId]);
|
|
|
@@ -87,9 +77,13 @@ class GhsClass extends BaseClass
|
|
|
$shop = ShopClass::getShopInfo($hdShopId);
|
|
|
$default = $shop['default'] ?? 0;
|
|
|
$name = $default == 1 ? $shop['merchantName'] : $shop['merchantName'] . ' ' . $shop['shopName'];
|
|
|
- $py = stringUtil::py($name);
|
|
|
- $mobile = $shop['mobile'] ?? '';
|
|
|
|
|
|
+ //从分店同步客户,客户被修改的名称也要同步过来
|
|
|
+ $firstName = empty($changeName) ? $name : $changeName;
|
|
|
+ $py = stringUtil::py($firstName);
|
|
|
+ $secondName = $name;
|
|
|
+
|
|
|
+ $mobile = $shop['mobile'] ?? '';
|
|
|
$uniGhsId = $shop['uniGhsId'] ?? 0;
|
|
|
$hasManyGhs = $shop['hasManyGhs'] ?? 0;
|
|
|
if ($uniGhsId == 0 && $hasManyGhs == 0) {
|
|
|
@@ -108,8 +102,8 @@ class GhsClass extends BaseClass
|
|
|
'ownSjId' => $ghsSjId,
|
|
|
'ownShopId' => $ghsShopId,
|
|
|
'ownMainId' => $ghsMainId,
|
|
|
- 'name' => $name,
|
|
|
- 'originName' => $name,
|
|
|
+ 'name' => $firstName,
|
|
|
+ 'originName' => $secondName,
|
|
|
'py' => $py,
|
|
|
'mobile' => $mobile,
|
|
|
'province' => $shop['province'] ?? '',
|