|
...
|
...
|
@@ -16,6 +16,7 @@ use App\Models\Scoring\RatingQuestion; |
|
|
|
use App\Models\Scoring\ScoringSystem;
|
|
|
|
use App\Models\Sms\SmsLog;
|
|
|
|
use App\Models\User\User;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Mrgoon\AliSms\AliSms;
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -35,13 +36,58 @@ class RatingController extends BaseController |
|
|
|
* @time :2024/1/20 15:03
|
|
|
|
*/
|
|
|
|
public function getHistory(ScoringSystem $scoringSystem){
|
|
|
|
$this->request->validate([
|
|
|
|
'type' => 'required',
|
|
|
|
],[
|
|
|
|
'type.required' => '问题类型不能为空',
|
|
|
|
]);
|
|
|
|
$info = $scoringSystem->read($this->map);
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
$projectInfo = Cache::get('user-'.$this->user['project_id']);
|
|
|
|
if(!$projectInfo){
|
|
|
|
$this->response('success',Code::SUCCESS,['type'=>0]);
|
|
|
|
}
|
|
|
|
//建站中直接返回
|
|
|
|
if($projectInfo['type'] == 1){
|
|
|
|
$this->response('success',Code::SUCCESS,['type'=>0]);
|
|
|
|
}
|
|
|
|
//上线项目判断当前属于第几阶段
|
|
|
|
if(empty($projectInfo['uptime'])){
|
|
|
|
$this->response('success',Code::SUCCESS,['type'=>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');
|
|
|
|
if($date <= $after30Days){
|
|
|
|
$info = $scoringSystem->read(['type'=>1]);//第一阶段是否有值
|
|
|
|
if($info === false){
|
|
|
|
$this->response('success',Code::SUCCESS,['type'=>1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($date >= $afterThreeMonths && $date <= $afterSixMonths){
|
|
|
|
$info = $scoringSystem->read(['type'=>2]);//第一阶段是否有值
|
|
|
|
if($info === false){
|
|
|
|
$this->response('success',Code::SUCCESS,['type'=>2]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($date >= $afterOneYear){
|
|
|
|
$info = $scoringSystem->read(['type'=>3]);//第一阶段是否有值
|
|
|
|
if($info === false){
|
|
|
|
$this->response('success',Code::SUCCESS,['type'=>3]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,['type'=>0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :同步数据
|
|
|
|
* @name :httpSore
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/24 15:04
|
|
|
|
*/
|
|
|
|
public function httpSore($postId,$fType){
|
|
|
|
$token = md5('qqs'.$postId.$fType.date("Y-m-d"));
|
|
|
|
//$ftype 2,3,4
|
|
|
|
$str = "name_1=$request->name_1&name_2=$request->name_2&name_3=$request->name_3&name_4=$request->name_4&name_5=$request->name_5";
|
|
|
|
$url = "http://www.quanqiusou.cn/extend_api/api/service_score.php?postid=$postid&token=$token&ftype=$ftype&$str";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|