|
...
|
...
|
@@ -8,6 +8,7 @@ use App\Exceptions\BsideGlobalException; |
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Scoring\ScoringSystem;
|
|
|
|
use App\Models\Sms\SmsLog;
|
|
|
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
|
|
|
use App\Models\User\User;
|
|
...
|
...
|
@@ -170,6 +171,7 @@ class UserLoginLogic |
|
|
|
$info['upload_config'] = $project['upload_config'];
|
|
|
|
$info['main_lang_id'] = $project['main_lang_id'];
|
|
|
|
$info['image_max'] = $project['image_max'];
|
|
|
|
$info['uptime_type'] = $this->getHistory($project);
|
|
|
|
$info['uptime'] = $project['uptime'];
|
|
|
|
$info['storage_type'] = $project['storage_type'];
|
|
|
|
$info['project_location'] = $project['project_location'];
|
|
...
|
...
|
@@ -180,10 +182,57 @@ class UserLoginLogic |
|
|
|
$info['is_visualization'] = json_decode($project['is_visualization']);
|
|
|
|
}
|
|
|
|
//保存项目缓存
|
|
|
|
Cache::put('user-'.$info['project_id'],$project,$minutes = null);
|
|
|
|
Cache::put('user-'.$info['project_id'],$project,12 * 3600);
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取问卷调查记录(阶段记录)
|
|
|
|
* @name :getHistory
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/20 15:03
|
|
|
|
*/
|
|
|
|
public function getHistory($projectInfo){
|
|
|
|
if(!$projectInfo){
|
|
|
|
return $this->success(0);
|
|
|
|
}
|
|
|
|
//建站中直接返回
|
|
|
|
if($projectInfo['type'] == 1){
|
|
|
|
return $this->success(0);
|
|
|
|
}
|
|
|
|
//上线项目判断当前属于第几阶段
|
|
|
|
if(empty($projectInfo['uptime'])){
|
|
|
|
return $this->success(0);
|
|
|
|
}
|
|
|
|
//获取上线时间30天后
|
|
|
|
$after30Days = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +30 days'));
|
|
|
|
$afterThreeMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +3 months'));
|
|
|
|
$afterSixMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +6 months'));
|
|
|
|
$afterOneYear = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +1 year'));
|
|
|
|
//获取当前时间
|
|
|
|
$date = date('Y-m-d H:i:s');
|
|
|
|
$scoringSystem = new ScoringSystem();
|
|
|
|
if($date <= $after30Days){
|
|
|
|
$info = $scoringSystem->read(['type'=>1]);//第一阶段是否有值
|
|
|
|
if($info === false){
|
|
|
|
return $this->success(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($date >= $afterThreeMonths && $date <= $afterSixMonths){
|
|
|
|
$info = $scoringSystem->read(['type'=>2]);//第一阶段是否有值
|
|
|
|
if($info === false){
|
|
|
|
return $this->success(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($date >= $afterOneYear){
|
|
|
|
$info = $scoringSystem->read(['type'=>3]);//第一阶段是否有值
|
|
|
|
if($info === false){
|
|
|
|
return $this->success(3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :组装返回数据
|
|
...
|
...
|
@@ -212,6 +261,7 @@ class UserLoginLogic |
|
|
|
$info['upload_config'] = $project['upload_config'];
|
|
|
|
$info['main_lang_id'] = $project['main_lang_id'];
|
|
|
|
$info['image_max'] = $project['image_max'];
|
|
|
|
$info['uptime_type'] = $this->getHistory($project);
|
|
|
|
$info['uptime'] = $project['uptime'];
|
|
|
|
$info['is_update_language'] = $project['is_update_language'];
|
|
|
|
$info['configuration'] = $project['deploy_build']['configuration'];
|
|
...
|
...
|
@@ -222,7 +272,7 @@ class UserLoginLogic |
|
|
|
$info['is_visualization'] = json_decode($project['is_visualization']);
|
|
|
|
}
|
|
|
|
//保存项目缓存
|
|
|
|
Cache::put('user-'.$info['project_id'],$project,$minutes = null);
|
|
|
|
Cache::put('user-'.$info['project_id'],$project,12 * 3600);
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|