|
|
@@ -224,16 +224,17 @@ class CustomController extends Controller
|
|
|
private function copyCustomers()
|
|
|
{
|
|
|
$cachedKey = 'copy_firstShop_customers';
|
|
|
+ $shopIdList = [];
|
|
|
while ($count = Yii::$app->redis->executeCommand('LLEN', [$cachedKey])) {
|
|
|
$shopIdData = Yii::$app->redis->executeCommand('RPOP', [$cachedKey]);
|
|
|
- $shopIdDatas[] = $shopIdData;
|
|
|
+ $shopIdList[] = $shopIdData;
|
|
|
}
|
|
|
|
|
|
- if (!isset($shopIdDatas)) {
|
|
|
+ if (empty($shopIdList)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- foreach ($shopIdDatas as $shopIdData) {
|
|
|
+ foreach ($shopIdList as $shopIdData) {
|
|
|
$shopIdArr = explode('_', $shopIdData);
|
|
|
if (count($shopIdArr) != 2) {
|
|
|
Yii::info('copyCustomers 数据出错:' . json_encode($shopIdArr));
|