作者 lyh

Merge branch 'dev' into develop

@@ -127,53 +127,53 @@ class ComController extends BaseController @@ -127,53 +127,53 @@ class ComController extends BaseController
127 * @method :post 127 * @method :post
128 * @time :2023/5/12 14:55 128 * @time :2023/5/12 14:55
129 */ 129 */
130 -// protected function ceShi(){  
131 -// $this->error = 0;  
132 -// //获取所有ayr_share用户  
133 -// $ayr_share_model = new AyrShareModel();  
134 -// $ayr_share_list = $ayr_share_model->list($this->map);  
135 -// if(!empty($ayr_share_list)){  
136 -// foreach ($ayr_share_list as $k => $v){  
137 -// //查询当前用户是否有未推送的博文  
138 -// $ayr_release = new AyrReleaseModel();  
139 -// $release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]);  
140 -// //有推文时,直接跳出循环  
141 -// if($release_info !== false){  
142 -// continue;  
143 -// }  
144 -// //查看用户是否在一周内有发送博客  
145 -// $start_at = Carbon::now()->modify('-7 days')->toDateString();  
146 -// $end_at = Carbon::now()->toDateString();  
147 -// $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);  
148 -// //有发送博文,则跳出循环  
149 -// if($release_info == false){  
150 -// continue;  
151 -// }  
152 -// //删除用户第三方配置  
153 -// $ayr_share_helper = new AyrShareHelper();  
154 -// $data_profiles = [  
155 -// 'title'=>$v['title'],  
156 -// 'profileKey'=>$v['profile_key']  
157 -// ];  
158 -// $res = $ayr_share_helper->deleted_profiles($data_profiles);  
159 -// if($res['status'] == 'fail'){  
160 -// $this->error++;  
161 -// continue;  
162 -// }  
163 -// //更新数据库  
164 -// $data = [  
165 -// 'title'=>null,  
166 -// 'bind_plat_from'=>null,  
167 -// 'profile_key'=>null,  
168 -// 'ref_id'=>null,  
169 -// ];  
170 -// $res = $ayr_share_model->edit($data,['id'=>$v['id']]);  
171 -// if($res == false){  
172 -// $this->error++;  
173 -// }  
174 -// }  
175 -// }  
176 -// return $this->error;  
177 -// } 130 + protected function ceShi(){
  131 + $this->error = 0;
  132 + //获取所有ayr_share用户
  133 + $ayr_share_model = new AyrShareModel();
  134 + $ayr_share_list = $ayr_share_model->list($this->map);
  135 + if(!empty($ayr_share_list)){
  136 + foreach ($ayr_share_list as $k => $v){
  137 + //查询当前用户是否有未推送的博文
  138 + $ayr_release = new AyrReleaseModel();
  139 + $release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]);
  140 + //有推文时,直接跳出循环
  141 + if($release_info !== false){
  142 + continue;
  143 + }
  144 + //查看用户是否在一周内有发送博客
  145 + $start_at = Carbon::now()->modify('-7 days')->toDateString();
  146 + $end_at = Carbon::now()->toDateString();
  147 + $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);
  148 + //有发送博文,则跳出循环
  149 + if($release_info == false){
  150 + continue;
  151 + }
  152 + //删除用户第三方配置
  153 + $ayr_share_helper = new AyrShareHelper();
  154 + $data_profiles = [
  155 + 'title'=>$v['title'],
  156 + 'profileKey'=>$v['profile_key']
  157 + ];
  158 + $res = $ayr_share_helper->deleted_profiles($data_profiles);
  159 + if($res['status'] == 'fail'){
  160 + $this->error++;
  161 + continue;
  162 + }
  163 + //更新数据库
  164 + $data = [
  165 + 'title'=>null,
  166 + 'bind_plat_from'=>null,
  167 + 'profile_key'=>null,
  168 + 'ref_id'=>null,
  169 + ];
  170 + $res = $ayr_share_model->edit($data,['id'=>$v['id']]);
  171 + if($res == false){
  172 + $this->error++;
  173 + }
  174 + }
  175 + }
  176 + return $this->error;
  177 + }
178 178
179 } 179 }
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 use Illuminate\Support\Facades\Route; 6 use Illuminate\Support\Facades\Route;
7 7
8 //必须登录验证的路由组 8 //必须登录验证的路由组
9 -Route::middleware(['bloginauth'])->group(function () { 9 +Route::middleware(['bloginauth','accesstoken'])->group(function () {
10 //登录用户编辑个人资料 10 //登录用户编辑个人资料
11 Route::any('/edit_info', [\App\Http\Controllers\Bside\ComController::class, 'edit_info'])->name('edit_info'); 11 Route::any('/edit_info', [\App\Http\Controllers\Bside\ComController::class, 'edit_info'])->name('edit_info');
12 Route::any('/logout', [\App\Http\Controllers\Bside\ComController::class, 'logout'])->name('logout'); 12 Route::any('/logout', [\App\Http\Controllers\Bside\ComController::class, 'logout'])->name('logout');