作者 lyh

变更数据

... ... @@ -2,10 +2,14 @@
namespace App\Console\Commands\AyrShare;
use App\Helper\AyrShare as AyrShareHelper;
use App\Models\Ai\AiVideo;
use App\Models\AyrShare\AyrRelease as AyrReleaseModel;
use App\Models\Project\AiVideoTask;
use App\Services\ProjectServer;
use Carbon\Carbon;
use App\Models\AyrShare\AyrShare as AyrShareModel;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class ShareUser extends Command
{
... ... @@ -66,6 +70,11 @@ class ShareUser extends Command
echo '7天内有推文跳过。'.date('Y-m-d H:i:s').PHP_EOL;
continue;
}
$aiVideoInfo = $this->aiVideoInfo($v['project_id'] ?? 0);
if($aiVideoInfo !== false){
echo '7天内有ai视频推送跳过。'.date('Y-m-d H:i:s').PHP_EOL;
continue;
}
//删除用户第三方配置
if(!empty($v['profile_key'])){
$this->del_profiles($v);
... ... @@ -145,4 +154,23 @@ class ShareUser extends Command
$release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);
return $release_info;
}
/**
* @remark :7天内是否推送了ai视频
* @name :aiVidoe
* @author :lyh
* @method :post
* @time :2025/9/22 17:13
*/
public function aiVideoInfo($project_id)
{
if($project_id == 0){
return false;
}
$start_at = Carbon::now()->modify('-7 days')->toDateString();
$end_at = Carbon::now()->toDateString();
$aiVideoModel = new AiVideoTask();
$videoInfo = $aiVideoModel->read(['project_id'=>$project_id,'next_auto_date'=>null,'created_at'=>['between',[$start_at,$end_at]]]);
return $videoInfo;
}
}
... ...