|
|
@@ -19,14 +19,15 @@ class ProductController extends Controller
|
|
|
$command = Yii::$app->db->createCommand($sql);
|
|
|
$data = $command->queryAll();
|
|
|
if (empty($data)) {
|
|
|
- foreach ($data as $item) {
|
|
|
- $id = $item['id'] ?? 0;
|
|
|
- $ptItemId = $item['itemId'] ?? 0;
|
|
|
- $ptItem = PtItemClass::getById($ptItemId, true);
|
|
|
- $cover = $ptItem->cover ?? '';
|
|
|
- ProductClass::updateById($id, ['cover' => $cover]);
|
|
|
- echo "productId:" . $id . " 恢复图片:" . $cover . "\n";
|
|
|
- }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ foreach ($data as $item) {
|
|
|
+ $id = $item['id'] ?? 0;
|
|
|
+ $ptItemId = $item['itemId'] ?? 0;
|
|
|
+ $ptItem = PtItemClass::getById($ptItemId, true);
|
|
|
+ $cover = $ptItem->cover ?? '';
|
|
|
+ ProductClass::updateById($id, ['cover' => $cover]);
|
|
|
+ echo "productId:" . $id . " 恢复图片:" . $cover . "\n";
|
|
|
}
|
|
|
}
|
|
|
|