|
...
|
...
|
@@ -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,9 +70,18 @@ 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);
|
|
|
|
$res = $this->del_profiles($v);
|
|
|
|
if($res === false){
|
|
|
|
//删除失败-跳过
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//更新数据库
|
|
|
|
$this->save_ayr_share($ayr_share_model,$v);
|
|
...
|
...
|
@@ -90,8 +103,8 @@ class ShareUser extends Command |
|
|
|
];
|
|
|
|
$res = $ayr_share_helper->deleted_profiles($data_profiles);
|
|
|
|
if($res['status'] == 'fail'){
|
|
|
|
echo '第三方删除失败';
|
|
|
|
return true;
|
|
|
|
echo '第三方删除失败'.json_encode($data_profiles,true);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
...
|
...
|
@@ -145,4 +158,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;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|