|
...
|
...
|
@@ -50,6 +50,7 @@ class ShareUser extends Command |
|
|
|
$release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]);
|
|
|
|
//有推文时,直接跳出循环
|
|
|
|
if($release_info !== false){
|
|
|
|
$this->error++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
//查看用户是否在一周内有发送博客
|
|
...
|
...
|
@@ -58,25 +59,28 @@ class ShareUser extends Command |
|
|
|
$release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);
|
|
|
|
//有发送博文,则跳出循环
|
|
|
|
if($release_info !== false){
|
|
|
|
$this->error++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
//删除用户第三方配置
|
|
|
|
$ayr_share_helper = new AyrShareHelper();
|
|
|
|
$data_profiles = [
|
|
|
|
'title'=>$v['title'],
|
|
|
|
'profileKey'=>$v['profile_key']
|
|
|
|
];
|
|
|
|
$res = $ayr_share_helper->deleted_profiles($data_profiles);
|
|
|
|
if($res['status'] == 'fail'){
|
|
|
|
$this->error++;
|
|
|
|
continue;
|
|
|
|
if(!empty($v['profile_key'])){
|
|
|
|
$ayr_share_helper = new AyrShareHelper();
|
|
|
|
$data_profiles = [
|
|
|
|
'title'=>$v['title'],
|
|
|
|
'profileKey'=>$v['profile_key']
|
|
|
|
];
|
|
|
|
$res = $ayr_share_helper->deleted_profiles($data_profiles);
|
|
|
|
if($res['status'] == 'fail'){
|
|
|
|
$this->error++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//更新数据库
|
|
|
|
$data = [
|
|
|
|
'title'=>null,
|
|
|
|
'bind_platforms'=>null,
|
|
|
|
'profile_key'=>null,
|
|
|
|
'ref_id'=>null,
|
|
|
|
'title'=>'',
|
|
|
|
'bind_platforms'=>'',
|
|
|
|
'profile_key'=>'',
|
|
|
|
'ref_id'=>'',
|
|
|
|
];
|
|
|
|
$res = $ayr_share_model->edit($data,['id'=>$v['id']]);
|
|
|
|
if($res == false){
|
...
|
...
|
|