正在显示
1 个修改的文件
包含
28 行增加
和
0 行删除
| @@ -2,10 +2,14 @@ | @@ -2,10 +2,14 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Console\Commands\AyrShare; | 3 | namespace App\Console\Commands\AyrShare; |
| 4 | use App\Helper\AyrShare as AyrShareHelper; | 4 | use App\Helper\AyrShare as AyrShareHelper; |
| 5 | +use App\Models\Ai\AiVideo; | ||
| 5 | use App\Models\AyrShare\AyrRelease as AyrReleaseModel; | 6 | use App\Models\AyrShare\AyrRelease as AyrReleaseModel; |
| 7 | +use App\Models\Project\AiVideoTask; | ||
| 8 | +use App\Services\ProjectServer; | ||
| 6 | use Carbon\Carbon; | 9 | use Carbon\Carbon; |
| 7 | use App\Models\AyrShare\AyrShare as AyrShareModel; | 10 | use App\Models\AyrShare\AyrShare as AyrShareModel; |
| 8 | use Illuminate\Console\Command; | 11 | use Illuminate\Console\Command; |
| 12 | +use Illuminate\Support\Facades\DB; | ||
| 9 | 13 | ||
| 10 | class ShareUser extends Command | 14 | class ShareUser extends Command |
| 11 | { | 15 | { |
| @@ -66,6 +70,11 @@ class ShareUser extends Command | @@ -66,6 +70,11 @@ class ShareUser extends Command | ||
| 66 | echo '7天内有推文跳过。'.date('Y-m-d H:i:s').PHP_EOL; | 70 | echo '7天内有推文跳过。'.date('Y-m-d H:i:s').PHP_EOL; |
| 67 | continue; | 71 | continue; |
| 68 | } | 72 | } |
| 73 | + $aiVideoInfo = $this->aiVideoInfo($v['project_id'] ?? 0); | ||
| 74 | + if($aiVideoInfo !== false){ | ||
| 75 | + echo '7天内有ai视频推送跳过。'.date('Y-m-d H:i:s').PHP_EOL; | ||
| 76 | + continue; | ||
| 77 | + } | ||
| 69 | //删除用户第三方配置 | 78 | //删除用户第三方配置 |
| 70 | if(!empty($v['profile_key'])){ | 79 | if(!empty($v['profile_key'])){ |
| 71 | $this->del_profiles($v); | 80 | $this->del_profiles($v); |
| @@ -145,4 +154,23 @@ class ShareUser extends Command | @@ -145,4 +154,23 @@ class ShareUser extends Command | ||
| 145 | $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]); | 154 | $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]); |
| 146 | return $release_info; | 155 | return $release_info; |
| 147 | } | 156 | } |
| 157 | + | ||
| 158 | + /** | ||
| 159 | + * @remark :7天内是否推送了ai视频 | ||
| 160 | + * @name :aiVidoe | ||
| 161 | + * @author :lyh | ||
| 162 | + * @method :post | ||
| 163 | + * @time :2025/9/22 17:13 | ||
| 164 | + */ | ||
| 165 | + public function aiVideoInfo($project_id) | ||
| 166 | + { | ||
| 167 | + if($project_id == 0){ | ||
| 168 | + return false; | ||
| 169 | + } | ||
| 170 | + $start_at = Carbon::now()->modify('-7 days')->toDateString(); | ||
| 171 | + $end_at = Carbon::now()->toDateString(); | ||
| 172 | + $aiVideoModel = new AiVideoTask(); | ||
| 173 | + $videoInfo = $aiVideoModel->read(['project_id'=>$project_id,'next_auto_date'=>null,'created_at'=>['between',[$start_at,$end_at]]]); | ||
| 174 | + return $videoInfo; | ||
| 175 | + } | ||
| 148 | } | 176 | } |
-
请 注册 或 登录 后发表评论