作者 lyh

gx

... ... @@ -78,25 +78,25 @@ class ProductController extends BaseController
public function getHandleFileImage($v){
//ToDo::处理图片及文件
if(!empty($v['thumb']) && !empty($v['thumb']['url'])){
$v['thumb']['url'] = getImageUrl($v['thumb']['url'],$this->user['project_location'],$this->user['storage_type']);
$v['thumb']['url'] = getImageUrl($v['thumb']['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
}
if(!empty($v['gallery'])){
foreach ($v['gallery'] as $gallery_k => $gallery_v){
$gallery_v['url'] = getImageUrl($gallery_v['url'],$this->user['project_location'],$this->user['storage_type']);
$gallery_v['url'] = getImageUrl($gallery_v['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
$v['gallery'][$gallery_k] = $gallery_v;
}
}
if(!empty($v['icon'])){
foreach ($v['icon'] as $icon_k => $icon_v){
$icon_v = getImageUrl($icon_v,$this->user['project_location'],$this->user['storage_type']);
$icon_v = getImageUrl($icon_v,$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
$v['icon'][$icon_k] = $icon_v;
}
}
if(!empty($v['video']) && !empty($v['video']['url'])){
$v['video']['url'] = getImageUrl($v['video']['url'],$this->user['project_location'],$this->user['storage_type']);
$v['video']['url'] = getImageUrl($v['video']['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
}
if(!empty($v['files']) && !empty($v['files']['url'])){
$v['files']['url'] = getImageUrl($v['files']['url'],$this->user['project_location'],$this->user['storage_type']);
$v['files']['url'] = getImageUrl($v['files']['url'],$this->user['project_location'] ?? 0,$this->user['storage_type'] ?? 0);
}
return $this->success($v);
}
... ...
... ... @@ -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";
}
/**
... ...