|
@@ -120,67 +120,60 @@ class ComController extends BaseController |
|
@@ -120,67 +120,60 @@ class ComController extends BaseController |
|
120
|
$this->response('success');
|
120
|
$this->response('success');
|
|
121
|
}
|
121
|
}
|
|
122
|
|
122
|
|
|
123
|
-// /**
|
|
|
|
124
|
-// * @name :(测试接口)ceShi
|
|
|
|
125
|
-// * @author :lyh
|
|
|
|
126
|
-// * @method :post
|
|
|
|
127
|
-// * @time :2023/5/19 10:03
|
|
|
|
128
|
-// */
|
|
|
|
129
|
-// public function ceShi(){
|
|
|
|
130
|
-// $country = new Country();
|
|
|
|
131
|
-// return $country->set_country();
|
|
|
|
132
|
-// }
|
|
|
|
133
|
|
123
|
|
|
134
|
/**
|
124
|
/**
|
|
135
|
- * @name : 检测用户是否无操作记录
|
125
|
+ * @name : (测试定时任务)检测用户是否无操作记录
|
|
136
|
* @author :lyh
|
126
|
* @author :lyh
|
|
137
|
* @method :post
|
127
|
* @method :post
|
|
138
|
* @time :2023/5/12 14:55
|
128
|
* @time :2023/5/12 14:55
|
|
139
|
*/
|
129
|
*/
|
|
140
|
- protected function ceShi(){
|
|
|
|
141
|
- //获取所有ayr_share用户
|
|
|
|
142
|
- $ayr_share_model = new AyrShareModel();
|
|
|
|
143
|
- $ayr_share_list = $ayr_share_model->list();
|
|
|
|
144
|
- foreach ($ayr_share_list as $k => $v){
|
|
|
|
145
|
- //查询当前用户是否有未推送的博文
|
|
|
|
146
|
- $ayr_release = new AyrReleaseModel();
|
|
|
|
147
|
- $release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]);
|
|
|
|
148
|
- //有推文时,直接跳出循环
|
|
|
|
149
|
- if($release_info !== false){
|
|
|
|
150
|
- continue;
|
|
|
|
151
|
- }
|
|
|
|
152
|
- //查看用户是否在一周内有发送博客
|
|
|
|
153
|
- $start_at = Carbon::now()->modify('-7 days')->toDateString();
|
|
|
|
154
|
- $end_at = Carbon::now()->toDateString();
|
|
|
|
155
|
- $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);
|
|
|
|
156
|
- //有发送博文,则跳出循环
|
|
|
|
157
|
- if($release_info == false){
|
|
|
|
158
|
- continue;
|
|
|
|
159
|
- }
|
|
|
|
160
|
- //删除用户第三方配置
|
|
|
|
161
|
- $ayr_share_helper = new AyrShareHelper();
|
|
|
|
162
|
- $data_profiles = [
|
|
|
|
163
|
- 'title'=>$v['title'],
|
|
|
|
164
|
- 'profileKey'=>$v['profile_key']
|
|
|
|
165
|
- ];
|
|
|
|
166
|
- $res = $ayr_share_helper->deleted_profiles($data_profiles);
|
|
|
|
167
|
- if($res['status'] == 'fail'){
|
|
|
|
168
|
- $this->error++;
|
|
|
|
169
|
- continue;
|
|
|
|
170
|
- }
|
|
|
|
171
|
- //更新数据库
|
|
|
|
172
|
- $data = [
|
|
|
|
173
|
- 'title'=>null,
|
|
|
|
174
|
- 'bind_plat_from'=>null,
|
|
|
|
175
|
- 'profile_key'=>null,
|
|
|
|
176
|
- 'ref_id'=>null,
|
|
|
|
177
|
- ];
|
|
|
|
178
|
- $res = $ayr_share_model->edit($data,['id'=>$v['id']]);
|
|
|
|
179
|
- if($res == false){
|
|
|
|
180
|
- $this->error++;
|
|
|
|
181
|
- }
|
|
|
|
182
|
- }
|
|
|
|
183
|
- return $this->error;
|
|
|
|
184
|
- }
|
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
|
+// }
|
|
185
|
|
178
|
|
|
186
|
} |
179
|
} |