|
@@ -210,8 +210,8 @@ class TimerSsmPost extends Command
|
|
|
|
|
|
public function ossUpload()
|
|
|
{
|
|
|
- $count = SmmPost::getOssUploadingPostCount();
|
|
|
- if ($count > 0) {
|
|
|
+ $has = SmmPost::hasOssUploadingPost();
|
|
|
+ if ($has == true) {
|
|
|
return false;
|
|
|
}
|
|
|
// 发送社媒帖子
|
|
@@ -219,6 +219,7 @@ class TimerSsmPost extends Command
|
|
|
$disk = $this->disk('oss');
|
|
|
foreach ($ossUploadPost as $post) {
|
|
|
$post->oss_upload = 1;//上传中
|
|
|
+ $post->updated_at = Carbon::now();
|
|
|
$post->save();
|
|
|
//上传图片到oss
|
|
|
$imageVideoUrl = explode(',', $post->image_video_url);
|
|
@@ -229,6 +230,7 @@ class TimerSsmPost extends Command
|
|
|
$disk->putFileAs($dir, $localPath, $filename);
|
|
|
}
|
|
|
$post->oss_upload = 2; //上传完成
|
|
|
+ $post->updated_at = Carbon::now();
|
|
|
$post->save();
|
|
|
}
|
|
|
return true;
|