|
@@ -16,6 +16,7 @@ use App\Models\Scoring\RatingQuestion; |
|
@@ -16,6 +16,7 @@ use App\Models\Scoring\RatingQuestion; |
|
16
|
use App\Models\Scoring\ScoringSystem;
|
16
|
use App\Models\Scoring\ScoringSystem;
|
|
17
|
use App\Models\Sms\SmsLog;
|
17
|
use App\Models\Sms\SmsLog;
|
|
18
|
use App\Models\User\User;
|
18
|
use App\Models\User\User;
|
|
|
|
19
|
+use Illuminate\Support\Facades\Cache;
|
|
19
|
use Mrgoon\AliSms\AliSms;
|
20
|
use Mrgoon\AliSms\AliSms;
|
|
20
|
|
21
|
|
|
21
|
/**
|
22
|
/**
|
|
@@ -35,13 +36,58 @@ class RatingController extends BaseController |
|
@@ -35,13 +36,58 @@ class RatingController extends BaseController |
|
35
|
* @time :2024/1/20 15:03
|
36
|
* @time :2024/1/20 15:03
|
|
36
|
*/
|
37
|
*/
|
|
37
|
public function getHistory(ScoringSystem $scoringSystem){
|
38
|
public function getHistory(ScoringSystem $scoringSystem){
|
|
38
|
- $this->request->validate([
|
|
|
|
39
|
- 'type' => 'required',
|
|
|
|
40
|
- ],[
|
|
|
|
41
|
- 'type.required' => '问题类型不能为空',
|
|
|
|
42
|
- ]);
|
|
|
|
43
|
- $info = $scoringSystem->read($this->map);
|
|
|
|
44
|
- $this->response('success',Code::SUCCESS,$info);
|
39
|
+ $projectInfo = Cache::get('user-'.$this->user['project_id']);
|
|
|
|
40
|
+ if(!$projectInfo){
|
|
|
|
41
|
+ $this->response('success',Code::SUCCESS,['type'=>0]);
|
|
|
|
42
|
+ }
|
|
|
|
43
|
+ //建站中直接返回
|
|
|
|
44
|
+ if($projectInfo['type'] == 1){
|
|
|
|
45
|
+ $this->response('success',Code::SUCCESS,['type'=>0]);
|
|
|
|
46
|
+ }
|
|
|
|
47
|
+ //上线项目判断当前属于第几阶段
|
|
|
|
48
|
+ if(empty($projectInfo['uptime'])){
|
|
|
|
49
|
+ $this->response('success',Code::SUCCESS,['type'=>0]);
|
|
|
|
50
|
+ }
|
|
|
|
51
|
+ //获取上线时间30天后
|
|
|
|
52
|
+ $after30Days = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +30 days'));
|
|
|
|
53
|
+ $afterThreeMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +3 months'));
|
|
|
|
54
|
+ $afterSixMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +6 months'));
|
|
|
|
55
|
+ $afterOneYear = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +1 year'));
|
|
|
|
56
|
+ //获取当前时间
|
|
|
|
57
|
+ $date = date('Y-m-d H:i:s');
|
|
|
|
58
|
+ if($date <= $after30Days){
|
|
|
|
59
|
+ $info = $scoringSystem->read(['type'=>1]);//第一阶段是否有值
|
|
|
|
60
|
+ if($info === false){
|
|
|
|
61
|
+ $this->response('success',Code::SUCCESS,['type'=>1]);
|
|
|
|
62
|
+ }
|
|
|
|
63
|
+ }
|
|
|
|
64
|
+ if($date >= $afterThreeMonths && $date <= $afterSixMonths){
|
|
|
|
65
|
+ $info = $scoringSystem->read(['type'=>2]);//第一阶段是否有值
|
|
|
|
66
|
+ if($info === false){
|
|
|
|
67
|
+ $this->response('success',Code::SUCCESS,['type'=>2]);
|
|
|
|
68
|
+ }
|
|
|
|
69
|
+ }
|
|
|
|
70
|
+ if($date >= $afterOneYear){
|
|
|
|
71
|
+ $info = $scoringSystem->read(['type'=>3]);//第一阶段是否有值
|
|
|
|
72
|
+ if($info === false){
|
|
|
|
73
|
+ $this->response('success',Code::SUCCESS,['type'=>3]);
|
|
|
|
74
|
+ }
|
|
|
|
75
|
+ }
|
|
|
|
76
|
+ $this->response('success',Code::SUCCESS,['type'=>0]);
|
|
|
|
77
|
+ }
|
|
|
|
78
|
+
|
|
|
|
79
|
+ /**
|
|
|
|
80
|
+ * @remark :同步数据
|
|
|
|
81
|
+ * @name :httpSore
|
|
|
|
82
|
+ * @author :lyh
|
|
|
|
83
|
+ * @method :post
|
|
|
|
84
|
+ * @time :2024/1/24 15:04
|
|
|
|
85
|
+ */
|
|
|
|
86
|
+ public function httpSore($postId,$fType){
|
|
|
|
87
|
+ $token = md5('qqs'.$postId.$fType.date("Y-m-d"));
|
|
|
|
88
|
+ //$ftype 2,3,4
|
|
|
|
89
|
+ $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";
|
|
|
|
90
|
+ $url = "http://www.quanqiusou.cn/extend_api/api/service_score.php?postid=$postid&token=$token&ftype=$ftype&$str";
|
|
45
|
}
|
91
|
}
|
|
46
|
|
92
|
|
|
47
|
/**
|
93
|
/**
|