作者 lyh

gx

@@ -78,25 +78,25 @@ class ProductController extends BaseController @@ -78,25 +78,25 @@ class ProductController extends BaseController
78 public function getHandleFileImage($v){ 78 public function getHandleFileImage($v){
79 //ToDo::处理图片及文件 79 //ToDo::处理图片及文件
80 if(!empty($v['thumb']) && !empty($v['thumb']['url'])){ 80 if(!empty($v['thumb']) && !empty($v['thumb']['url'])){
81 - $v['thumb']['url'] = getImageUrl($v['thumb']['url'],$this->user['project_location'],$this->user['storage_type']); 81 + $v['thumb']['url'] = getImageUrl($v['thumb']['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
82 } 82 }
83 if(!empty($v['gallery'])){ 83 if(!empty($v['gallery'])){
84 foreach ($v['gallery'] as $gallery_k => $gallery_v){ 84 foreach ($v['gallery'] as $gallery_k => $gallery_v){
85 - $gallery_v['url'] = getImageUrl($gallery_v['url'],$this->user['project_location'],$this->user['storage_type']); 85 + $gallery_v['url'] = getImageUrl($gallery_v['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
86 $v['gallery'][$gallery_k] = $gallery_v; 86 $v['gallery'][$gallery_k] = $gallery_v;
87 } 87 }
88 } 88 }
89 if(!empty($v['icon'])){ 89 if(!empty($v['icon'])){
90 foreach ($v['icon'] as $icon_k => $icon_v){ 90 foreach ($v['icon'] as $icon_k => $icon_v){
91 - $icon_v = getImageUrl($icon_v,$this->user['project_location'],$this->user['storage_type']); 91 + $icon_v = getImageUrl($icon_v,$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
92 $v['icon'][$icon_k] = $icon_v; 92 $v['icon'][$icon_k] = $icon_v;
93 } 93 }
94 } 94 }
95 if(!empty($v['video']) && !empty($v['video']['url'])){ 95 if(!empty($v['video']) && !empty($v['video']['url'])){
96 - $v['video']['url'] = getImageUrl($v['video']['url'],$this->user['project_location'],$this->user['storage_type']); 96 + $v['video']['url'] = getImageUrl($v['video']['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
97 } 97 }
98 if(!empty($v['files']) && !empty($v['files']['url'])){ 98 if(!empty($v['files']) && !empty($v['files']['url'])){
99 - $v['files']['url'] = getImageUrl($v['files']['url'],$this->user['project_location'],$this->user['storage_type']); 99 + $v['files']['url'] = getImageUrl($v['files']['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
100 } 100 }
101 return $this->success($v); 101 return $this->success($v);
102 } 102 }
@@ -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 /**