|
|
@@ -223,7 +223,7 @@ class CustomController extends Controller
|
|
|
//批发端分店从首店同步客户
|
|
|
private function copyCustomers()
|
|
|
{
|
|
|
- $cachedKey = 'copy_firstShop_customers';
|
|
|
+ $cachedKey = 'copy_other_shop_customers';
|
|
|
$shopIdList = [];
|
|
|
while ($count = Yii::$app->redis->executeCommand('LLEN', [$cachedKey])) {
|
|
|
$shopIdData = Yii::$app->redis->executeCommand('RPOP', [$cachedKey]);
|
|
|
@@ -237,20 +237,20 @@ class CustomController extends Controller
|
|
|
foreach ($shopIdList as $shopIdData) {
|
|
|
$shopIdArr = explode('_', $shopIdData);
|
|
|
if (count($shopIdArr) != 2) {
|
|
|
- Yii::info('copyCustomers 数据出错:' . $shopIdData);
|
|
|
- noticeUtil::push("分店从首店同步客户出错了:" . $shopIdData, '15280215347');
|
|
|
+ Yii::info('copy customer 数据出错:' . $shopIdData);
|
|
|
+ noticeUtil::push("从分店同步客户出错了:" . $shopIdData, '15280215347');
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- $shopId = $shopIdArr[0];
|
|
|
- $defaultShopId = $shopIdArr[1];
|
|
|
+ $toShopId = $shopIdArr[0];
|
|
|
+ $fromShopId = $shopIdArr[1];
|
|
|
Yii::$app->params['ptStyle'] = dict::getDict('ptStyle', 'ghs'); //指定当前环境为批发商
|
|
|
|
|
|
- $customers = CustomClass::getAllByCondition(['ownShopId' => $defaultShopId], null, ['shopId']);
|
|
|
+ $customers = CustomClass::getAllByCondition(['ownShopId' => $fromShopId], null, ['shopId']);
|
|
|
foreach ($customers as $customer) {
|
|
|
- $exist = CustomClass::exists(['ownShopId' => $shopId, 'shopId' => $customer['shopId']]);
|
|
|
+ $exist = CustomClass::exists(['ownShopId' => $toShopId, 'shopId' => $customer['shopId']]);
|
|
|
if (!$exist) {
|
|
|
- CustomClass::build($shopId, $customer['shopId']);
|
|
|
+ CustomClass::build($toShopId, $customer['shopId']);
|
|
|
}
|
|
|
}
|
|
|
}
|