|
@@ -3,12 +3,16 @@ |
|
@@ -3,12 +3,16 @@ |
|
3
|
namespace App\Http\Controllers\Bside;
|
3
|
namespace App\Http\Controllers\Bside;
|
|
4
|
|
4
|
|
|
5
|
use App\Enums\Common\Code;
|
5
|
use App\Enums\Common\Code;
|
|
|
|
6
|
+use App\Helper\AyrShare as AyrShareHelper;
|
|
6
|
use App\Helper\Country;
|
7
|
use App\Helper\Country;
|
|
|
|
8
|
+use App\Models\AyrShare\AyrRelease as AyrReleaseModel;
|
|
|
|
9
|
+use App\Models\AyrShare\AyrShare as AyrShareModel;
|
|
7
|
use App\Models\Project\Project;
|
10
|
use App\Models\Project\Project;
|
|
8
|
use App\Models\Project\Project as ProjectModel;
|
11
|
use App\Models\Project\Project as ProjectModel;
|
|
9
|
use App\Models\User\ProjectMenu as ProjectMenuModel;
|
12
|
use App\Models\User\ProjectMenu as ProjectMenuModel;
|
|
10
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
13
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
|
11
|
use App\Models\User\User as UserModel;
|
14
|
use App\Models\User\User as UserModel;
|
|
|
|
15
|
+use Carbon\Carbon;
|
|
12
|
use Illuminate\Http\Request;
|
16
|
use Illuminate\Http\Request;
|
|
13
|
use Illuminate\Support\Facades\Cache;
|
17
|
use Illuminate\Support\Facades\Cache;
|
|
14
|
|
18
|
|
|
@@ -116,8 +120,67 @@ class ComController extends BaseController |
|
@@ -116,8 +120,67 @@ class ComController extends BaseController |
|
116
|
$this->response('success');
|
120
|
$this->response('success');
|
|
117
|
}
|
121
|
}
|
|
118
|
|
122
|
|
|
119
|
- public function get_country(){
|
|
|
|
120
|
- $country = new Country();
|
|
|
|
121
|
- return $country->set_country();
|
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
|
+
|
|
|
|
134
|
+ /**
|
|
|
|
135
|
+ * @name : 检测用户是否无操作记录
|
|
|
|
136
|
+ * @author :lyh
|
|
|
|
137
|
+ * @method :post
|
|
|
|
138
|
+ * @time :2023/5/12 14:55
|
|
|
|
139
|
+ */
|
|
|
|
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;
|
|
122
|
}
|
184
|
}
|
|
|
|
185
|
+
|
|
123
|
} |
186
|
} |