|
@@ -8,6 +8,7 @@ use App\Exceptions\BsideGlobalException; |
|
@@ -8,6 +8,7 @@ use App\Exceptions\BsideGlobalException; |
|
8
|
use App\Helper\Common;
|
8
|
use App\Helper\Common;
|
|
9
|
use App\Models\Domain\DomainInfo;
|
9
|
use App\Models\Domain\DomainInfo;
|
|
10
|
use App\Models\Project\Project;
|
10
|
use App\Models\Project\Project;
|
|
|
|
11
|
+use App\Models\Scoring\ScoringSystem;
|
|
11
|
use App\Models\Sms\SmsLog;
|
12
|
use App\Models\Sms\SmsLog;
|
|
12
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
13
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
|
13
|
use App\Models\User\User;
|
14
|
use App\Models\User\User;
|
|
@@ -170,7 +171,7 @@ class UserLoginLogic |
|
@@ -170,7 +171,7 @@ class UserLoginLogic |
|
170
|
$info['upload_config'] = $project['upload_config'];
|
171
|
$info['upload_config'] = $project['upload_config'];
|
|
171
|
$info['main_lang_id'] = $project['main_lang_id'];
|
172
|
$info['main_lang_id'] = $project['main_lang_id'];
|
|
172
|
$info['image_max'] = $project['image_max'];
|
173
|
$info['image_max'] = $project['image_max'];
|
|
173
|
- $info['uptime'] = $project['uptime'];
|
174
|
+ $info['uptime_type'] = $this->getHistory($project);
|
|
174
|
$info['storage_type'] = $project['storage_type'];
|
175
|
$info['storage_type'] = $project['storage_type'];
|
|
175
|
$info['project_location'] = $project['project_location'];
|
176
|
$info['project_location'] = $project['project_location'];
|
|
176
|
$info['is_update_language'] = $project['is_update_language'];
|
177
|
$info['is_update_language'] = $project['is_update_language'];
|
|
@@ -180,10 +181,57 @@ class UserLoginLogic |
|
@@ -180,10 +181,57 @@ class UserLoginLogic |
|
180
|
$info['is_visualization'] = json_decode($project['is_visualization']);
|
181
|
$info['is_visualization'] = json_decode($project['is_visualization']);
|
|
181
|
}
|
182
|
}
|
|
182
|
//保存项目缓存
|
183
|
//保存项目缓存
|
|
183
|
- Cache::put('user-'.$info['project_id'],$project,$minutes = null);
|
184
|
+ Cache::put('user-'.$info['project_id'],$project,12 * 3600);
|
|
184
|
return $this->success($info);
|
185
|
return $this->success($info);
|
|
185
|
}
|
186
|
}
|
|
186
|
|
187
|
|
|
|
|
188
|
+ /**
|
|
|
|
189
|
+ * @remark :获取问卷调查记录(阶段记录)
|
|
|
|
190
|
+ * @name :getHistory
|
|
|
|
191
|
+ * @author :lyh
|
|
|
|
192
|
+ * @method :post
|
|
|
|
193
|
+ * @time :2024/1/20 15:03
|
|
|
|
194
|
+ */
|
|
|
|
195
|
+ public function getHistory($projectInfo){
|
|
|
|
196
|
+ if(!$projectInfo){
|
|
|
|
197
|
+ return $this->success(0);
|
|
|
|
198
|
+ }
|
|
|
|
199
|
+ //建站中直接返回
|
|
|
|
200
|
+ if($projectInfo['type'] == 1){
|
|
|
|
201
|
+ return $this->success(0);
|
|
|
|
202
|
+ }
|
|
|
|
203
|
+ //上线项目判断当前属于第几阶段
|
|
|
|
204
|
+ if(empty($projectInfo['uptime'])){
|
|
|
|
205
|
+ return $this->success(0);
|
|
|
|
206
|
+ }
|
|
|
|
207
|
+ //获取上线时间30天后
|
|
|
|
208
|
+ $after30Days = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +30 days'));
|
|
|
|
209
|
+ $afterThreeMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +3 months'));
|
|
|
|
210
|
+ $afterSixMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +6 months'));
|
|
|
|
211
|
+ $afterOneYear = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +1 year'));
|
|
|
|
212
|
+ //获取当前时间
|
|
|
|
213
|
+ $date = date('Y-m-d H:i:s');
|
|
|
|
214
|
+ $scoringSystem = new ScoringSystem();
|
|
|
|
215
|
+ if($date <= $after30Days){
|
|
|
|
216
|
+ $info = $scoringSystem->read(['type'=>1]);//第一阶段是否有值
|
|
|
|
217
|
+ if($info === false){
|
|
|
|
218
|
+ return $this->success(1);
|
|
|
|
219
|
+ }
|
|
|
|
220
|
+ }
|
|
|
|
221
|
+ if($date >= $afterThreeMonths && $date <= $afterSixMonths){
|
|
|
|
222
|
+ $info = $scoringSystem->read(['type'=>2]);//第一阶段是否有值
|
|
|
|
223
|
+ if($info === false){
|
|
|
|
224
|
+ return $this->success(2);
|
|
|
|
225
|
+ }
|
|
|
|
226
|
+ }
|
|
|
|
227
|
+ if($date >= $afterOneYear){
|
|
|
|
228
|
+ $info = $scoringSystem->read(['type'=>3]);//第一阶段是否有值
|
|
|
|
229
|
+ if($info === false){
|
|
|
|
230
|
+ return $this->success(3);
|
|
|
|
231
|
+ }
|
|
|
|
232
|
+ }
|
|
|
|
233
|
+ return $this->success(0);
|
|
|
|
234
|
+ }
|
|
187
|
|
235
|
|
|
188
|
/**
|
236
|
/**
|
|
189
|
* @remark :组装返回数据
|
237
|
* @remark :组装返回数据
|
|
@@ -212,7 +260,7 @@ class UserLoginLogic |
|
@@ -212,7 +260,7 @@ class UserLoginLogic |
|
212
|
$info['upload_config'] = $project['upload_config'];
|
260
|
$info['upload_config'] = $project['upload_config'];
|
|
213
|
$info['main_lang_id'] = $project['main_lang_id'];
|
261
|
$info['main_lang_id'] = $project['main_lang_id'];
|
|
214
|
$info['image_max'] = $project['image_max'];
|
262
|
$info['image_max'] = $project['image_max'];
|
|
215
|
- $info['uptime'] = $project['uptime'];
|
263
|
+ $info['uptime_type'] = $this->getHistory($project);
|
|
216
|
$info['is_update_language'] = $project['is_update_language'];
|
264
|
$info['is_update_language'] = $project['is_update_language'];
|
|
217
|
$info['configuration'] = $project['deploy_build']['configuration'];
|
265
|
$info['configuration'] = $project['deploy_build']['configuration'];
|
|
218
|
$info['project_type'] = $project['type'];
|
266
|
$info['project_type'] = $project['type'];
|
|
@@ -222,7 +270,7 @@ class UserLoginLogic |
|
@@ -222,7 +270,7 @@ class UserLoginLogic |
|
222
|
$info['is_visualization'] = json_decode($project['is_visualization']);
|
270
|
$info['is_visualization'] = json_decode($project['is_visualization']);
|
|
223
|
}
|
271
|
}
|
|
224
|
//保存项目缓存
|
272
|
//保存项目缓存
|
|
225
|
- Cache::put('user-'.$info['project_id'],$project,$minutes = null);
|
273
|
+ Cache::put('user-'.$info['project_id'],$project,12 * 3600);
|
|
226
|
return $this->success($info);
|
274
|
return $this->success($info);
|
|
227
|
}
|
275
|
}
|
|
228
|
|
276
|
|