Commit c2235007 by dhn

Merge branch 'developer' of http://47.99.244.21:9999/root/joshine into Branchs_developer

parents a1a8fea8 12cc178f
...@@ -40,7 +40,6 @@ class InstagramFeedPull extends Command ...@@ -40,7 +40,6 @@ class InstagramFeedPull extends Command
const IMAGE_PATH = '/joshine/instagram/'; const IMAGE_PATH = '/joshine/instagram/';
const IMAGE_TMP_PATH = '/joshine/instagram/tmp/'; const IMAGE_TMP_PATH = '/joshine/instagram/tmp/';
const BASE_PATH = "/www/wwwroot/www.joshine.vip/pub/";
/** /**
* @var Csv * @var Csv
*/ */
...@@ -239,6 +238,9 @@ class InstagramFeedPull extends Command ...@@ -239,6 +238,9 @@ class InstagramFeedPull extends Command
OutputInterface $output OutputInterface $output
) )
{ {
$base_path = str_replace( '\\' , '/' , realpath(dirname(__FILE__).'/../../../../../../'));
$base_path .= "/pub/";
$this->id = $this->getId(); $this->id = $this->getId();
$storeId = $input->getOption('store_id'); $storeId = $input->getOption('store_id');
if (!$storeId) { if (!$storeId) {
...@@ -251,12 +253,14 @@ class InstagramFeedPull extends Command ...@@ -251,12 +253,14 @@ class InstagramFeedPull extends Command
return; return;
} }
$media = $raw['data']; $media = $raw['data'];
foreach ($media as $index => $row) { foreach ($media as $index => $row) {
$url = $row["thumbnail_url"] ?? $row["media_url"]; $url = $row["thumbnail_url"] ?? $row["media_url"];
$key = isset($row['thumbnail_url']) ? 'thumbnail_url' : 'media_url'; $key = isset($row['thumbnail_url']) ? 'thumbnail_url' : 'media_url';
$res = $this->downloadImage($url); $res = $this->downloadImage($url);
$path = $this->resize($res); $path = $this->resize($res);
$res = str_replace(self::BASE_PATH,"", $path);
$res = str_replace($base_path,"", $path);
$media[$index][$key] = $res; $media[$index][$key] = $res;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment