xialei 1 год назад
Родитель
Сommit
d3b9cb6896
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      app/controller/api/douhuomall/Take.php

+ 5 - 2
app/controller/api/douhuomall/Take.php

@@ -94,8 +94,9 @@ class Take
94 94
             $this->remove($goodsIds);
95 95
             return 'sussess';
96 96
         } catch (Exception $e) {
97
-            Log::error('同步数据失败:' . $e->getMessage());
97
+            Log::error('供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】');
98 98
             echo '供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】';
99
+            Db::name('log')->insert(['data' => '供应链拉取数据:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】']);
99 100
             return 'error';
100 101
         }
101 102
     }
@@ -124,9 +125,11 @@ class Take
124 125
         if (!is_dir($targetDir)) {
125 126
             mkdir($targetDir, 0777, true); // 第二个参数是权限,第三个参数是递归创建
126 127
         }
128
+
129
+        ini_set("max_execution_time", 2);
127 130
         
128 131
         // 获取远程图片内容
129
-        $imageContent = file_get_contents($remoteImageUrl);
132
+        $imageContent = @file_get_contents($remoteImageUrl);
130 133
         
131 134
         // 检查是否成功获取内容
132 135
         if ($imageContent !== false) {