Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
10 个修改的文件
包含
94 行增加
和
30 行删除
| @@ -477,7 +477,9 @@ if (!function_exists('getImageUrl')) { | @@ -477,7 +477,9 @@ if (!function_exists('getImageUrl')) { | ||
| 477 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; | 477 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; |
| 478 | $url = $cosCdn.$path; | 478 | $url = $cosCdn.$path; |
| 479 | }else{ | 479 | }else{ |
| 480 | - $url = url($path); | 480 | + $s3 = config('filesystems.disks.s3'); |
| 481 | + $cdn = $s3['cdn']; | ||
| 482 | + $url = $cdn.$path; | ||
| 481 | } | 483 | } |
| 482 | } | 484 | } |
| 483 | return $url; | 485 | return $url; |
| @@ -513,7 +515,9 @@ if (!function_exists('getFileUrl')) { | @@ -513,7 +515,9 @@ if (!function_exists('getFileUrl')) { | ||
| 513 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; | 515 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; |
| 514 | $url = $cosCdn.$path; | 516 | $url = $cosCdn.$path; |
| 515 | }else{ | 517 | }else{ |
| 516 | - $url = url($path); | 518 | + $s3 = config('filesystems.disks.s3'); |
| 519 | + $cdn = $s3['cdn']; | ||
| 520 | + $url = $cdn.$path; | ||
| 517 | } | 521 | } |
| 518 | } | 522 | } |
| 519 | return $url; | 523 | return $url; |
| @@ -102,8 +102,9 @@ class LoginController extends BaseController | @@ -102,8 +102,9 @@ class LoginController extends BaseController | ||
| 102 | * @method :post | 102 | * @method :post |
| 103 | * @time :2023/8/19 9:13 | 103 | * @time :2023/8/19 9:13 |
| 104 | */ | 104 | */ |
| 105 | - public function sendLoginSms($type = SmsLog::TYPE_LOGIN) | 105 | + public function sendLoginSms() |
| 106 | { | 106 | { |
| 107 | + $type = $this->request->post('type',SmsLog::TYPE_LOGIN); | ||
| 107 | $this->request->validate([ | 108 | $this->request->validate([ |
| 108 | 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], | 109 | 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], |
| 109 | ],[ | 110 | ],[ |
| @@ -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 | /** |
| @@ -27,22 +28,6 @@ use Mrgoon\AliSms\AliSms; | @@ -27,22 +28,6 @@ use Mrgoon\AliSms\AliSms; | ||
| 27 | */ | 28 | */ |
| 28 | class RatingController extends BaseController | 29 | class RatingController extends BaseController |
| 29 | { | 30 | { |
| 30 | - /** | ||
| 31 | - * @remark :获取问卷调查记录(阶段记录) | ||
| 32 | - * @name :getHistory | ||
| 33 | - * @author :lyh | ||
| 34 | - * @method :post | ||
| 35 | - * @time :2024/1/20 15:03 | ||
| 36 | - */ | ||
| 37 | - 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); | ||
| 45 | - } | ||
| 46 | 31 | ||
| 47 | /** | 32 | /** |
| 48 | * @remark :问卷调查详情 | 33 | * @remark :问卷调查详情 |
| @@ -72,9 +57,11 @@ class RatingController extends BaseController | @@ -72,9 +57,11 @@ class RatingController extends BaseController | ||
| 72 | $this->request->validate([ | 57 | $this->request->validate([ |
| 73 | 'data' => 'required', | 58 | 'data' => 'required', |
| 74 | 'mobile' => 'required', | 59 | 'mobile' => 'required', |
| 60 | + 'type'=> 'required' | ||
| 75 | ],[ | 61 | ],[ |
| 76 | 'data.required' => '请填写完整', | 62 | 'data.required' => '请填写完整', |
| 77 | 'mobile.required' => '手机号码不能为空', | 63 | 'mobile.required' => '手机号码不能为空', |
| 64 | + 'type.required' => '阶段不能为空', | ||
| 78 | ]); | 65 | ]); |
| 79 | $ratingLogic->ratingSave(); | 66 | $ratingLogic->ratingSave(); |
| 80 | $this->response('success'); | 67 | $this->response('success'); |
| @@ -66,7 +66,7 @@ class KeywordLogic extends BaseLogic | @@ -66,7 +66,7 @@ class KeywordLogic extends BaseLogic | ||
| 66 | }else{ | 66 | }else{ |
| 67 | $info = $this->model->read(['title'=>$this->param['title']]); | 67 | $info = $this->model->read(['title'=>$this->param['title']]); |
| 68 | if($info !== false){ | 68 | if($info !== false){ |
| 69 | - $this->fail('当前title已存在'); | 69 | + return $this->success(['id'=>$info['id']]); |
| 70 | } | 70 | } |
| 71 | $this->param = $this->addHandleParam($this->param); | 71 | $this->param = $this->addHandleParam($this->param); |
| 72 | $id = $this->model->insertGetId($this->param); | 72 | $id = $this->model->insertGetId($this->param); |
| @@ -54,7 +54,29 @@ class RatingLogic extends BaseLogic | @@ -54,7 +54,29 @@ class RatingLogic extends BaseLogic | ||
| 54 | 'data'=>json_encode($this->param['data']), | 54 | 'data'=>json_encode($this->param['data']), |
| 55 | 'mobile'=>$this->param['mobile'], | 55 | 'mobile'=>$this->param['mobile'], |
| 56 | 'project_id'=>$this->user['project_id'], | 56 | 'project_id'=>$this->user['project_id'], |
| 57 | + 'type'=>$this->param['type'] | ||
| 57 | ]; | 58 | ]; |
| 58 | - return $this->scoringModel->add($param); | 59 | + $this->scoringModel->add($param); |
| 60 | + return $this->httpSore($this->param['data'],$this->project['post_id'],$this->param['type']); | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + /** | ||
| 64 | + * @remark :同步数据 | ||
| 65 | + * @name :httpSore | ||
| 66 | + * @author :lyh | ||
| 67 | + * @method :post | ||
| 68 | + * @time :2024/1/24 15:04 | ||
| 69 | + */ | ||
| 70 | + public function httpSore($data,$postId,$fType){ | ||
| 71 | + $fType = (int)($fType + 1); | ||
| 72 | + $token = md5('qqs'.$postId.$fType.date("Y-m-d")); | ||
| 73 | + //$ftype 2,3,4 | ||
| 74 | + $str = ''; | ||
| 75 | + foreach ($data as $k => $v){ | ||
| 76 | + $str .= 'name_'.(int)($k+1).'='.($v['level'] ?? 5).'&'; | ||
| 77 | + } | ||
| 78 | + $str = trim($str,'&'); | ||
| 79 | + $url = "http://www.quanqiusou.cn/extend_api/api/service_score.php?postid=$postId&token=$token&ftype=$fType&$str"; | ||
| 80 | + return http_get($url,['charset=utf-8']); | ||
| 59 | } | 81 | } |
| 60 | } | 82 | } |
| @@ -8,6 +8,7 @@ use App\Exceptions\BsideGlobalException; | @@ -8,6 +8,7 @@ use App\Exceptions\BsideGlobalException; | ||
| 8 | use App\Helper\Common; | 8 | use App\Helper\Common; |
| 9 | use App\Models\Domain\DomainInfo; | 9 | use App\Models\Domain\DomainInfo; |
| 10 | use App\Models\Project\Project; | 10 | use App\Models\Project\Project; |
| 11 | +use App\Models\Scoring\ScoringSystem; | ||
| 11 | use App\Models\Sms\SmsLog; | 12 | use App\Models\Sms\SmsLog; |
| 12 | use App\Models\User\ProjectRole as ProjectRoleModel; | 13 | use App\Models\User\ProjectRole as ProjectRoleModel; |
| 13 | use App\Models\User\User; | 14 | use App\Models\User\User; |
| @@ -170,6 +171,7 @@ class UserLoginLogic | @@ -170,6 +171,7 @@ class UserLoginLogic | ||
| 170 | $info['upload_config'] = $project['upload_config']; | 171 | $info['upload_config'] = $project['upload_config']; |
| 171 | $info['main_lang_id'] = $project['main_lang_id']; | 172 | $info['main_lang_id'] = $project['main_lang_id']; |
| 172 | $info['image_max'] = $project['image_max']; | 173 | $info['image_max'] = $project['image_max']; |
| 174 | + $info['uptime_type'] = $this->getHistory($project); | ||
| 173 | $info['uptime'] = $project['uptime']; | 175 | $info['uptime'] = $project['uptime']; |
| 174 | $info['storage_type'] = $project['storage_type']; | 176 | $info['storage_type'] = $project['storage_type']; |
| 175 | $info['project_location'] = $project['project_location']; | 177 | $info['project_location'] = $project['project_location']; |
| @@ -180,10 +182,57 @@ class UserLoginLogic | @@ -180,10 +182,57 @@ class UserLoginLogic | ||
| 180 | $info['is_visualization'] = json_decode($project['is_visualization']); | 182 | $info['is_visualization'] = json_decode($project['is_visualization']); |
| 181 | } | 183 | } |
| 182 | //保存项目缓存 | 184 | //保存项目缓存 |
| 183 | - Cache::put('user-'.$info['project_id'],$project,$minutes = null); | 185 | + Cache::put('user-'.$info['project_id'],$project,12 * 3600); |
| 184 | return $this->success($info); | 186 | return $this->success($info); |
| 185 | } | 187 | } |
| 186 | 188 | ||
| 189 | + /** | ||
| 190 | + * @remark :获取问卷调查记录(阶段记录) | ||
| 191 | + * @name :getHistory | ||
| 192 | + * @author :lyh | ||
| 193 | + * @method :post | ||
| 194 | + * @time :2024/1/20 15:03 | ||
| 195 | + */ | ||
| 196 | + public function getHistory($projectInfo){ | ||
| 197 | + if(!$projectInfo){ | ||
| 198 | + return $this->success(0); | ||
| 199 | + } | ||
| 200 | + //建站中直接返回 | ||
| 201 | + if($projectInfo['type'] == 1){ | ||
| 202 | + return $this->success(0); | ||
| 203 | + } | ||
| 204 | + //上线项目判断当前属于第几阶段 | ||
| 205 | + if(empty($projectInfo['uptime'])){ | ||
| 206 | + return $this->success(0); | ||
| 207 | + } | ||
| 208 | + //获取上线时间30天后 | ||
| 209 | + $after30Days = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +30 days')); | ||
| 210 | + $afterThreeMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +3 months')); | ||
| 211 | + $afterSixMonths = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +6 months')); | ||
| 212 | + $afterOneYear = date('Y-m-d H:i:s', strtotime($projectInfo['uptime'] . ' +1 year')); | ||
| 213 | + //获取当前时间 | ||
| 214 | + $date = date('Y-m-d H:i:s'); | ||
| 215 | + $scoringSystem = new ScoringSystem(); | ||
| 216 | + if($date <= $after30Days){ | ||
| 217 | + $info = $scoringSystem->read(['type'=>1]);//第一阶段是否有值 | ||
| 218 | + if($info === false){ | ||
| 219 | + return $this->success(1); | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + if($date >= $afterThreeMonths && $date <= $afterSixMonths){ | ||
| 223 | + $info = $scoringSystem->read(['type'=>2]);//第一阶段是否有值 | ||
| 224 | + if($info === false){ | ||
| 225 | + return $this->success(2); | ||
| 226 | + } | ||
| 227 | + } | ||
| 228 | + if($date >= $afterOneYear){ | ||
| 229 | + $info = $scoringSystem->read(['type'=>3]);//第一阶段是否有值 | ||
| 230 | + if($info === false){ | ||
| 231 | + return $this->success(3); | ||
| 232 | + } | ||
| 233 | + } | ||
| 234 | + return $this->success(0); | ||
| 235 | + } | ||
| 187 | 236 | ||
| 188 | /** | 237 | /** |
| 189 | * @remark :组装返回数据 | 238 | * @remark :组装返回数据 |
| @@ -212,6 +261,7 @@ class UserLoginLogic | @@ -212,6 +261,7 @@ class UserLoginLogic | ||
| 212 | $info['upload_config'] = $project['upload_config']; | 261 | $info['upload_config'] = $project['upload_config']; |
| 213 | $info['main_lang_id'] = $project['main_lang_id']; | 262 | $info['main_lang_id'] = $project['main_lang_id']; |
| 214 | $info['image_max'] = $project['image_max']; | 263 | $info['image_max'] = $project['image_max']; |
| 264 | + $info['uptime_type'] = $this->getHistory($project); | ||
| 215 | $info['uptime'] = $project['uptime']; | 265 | $info['uptime'] = $project['uptime']; |
| 216 | $info['is_update_language'] = $project['is_update_language']; | 266 | $info['is_update_language'] = $project['is_update_language']; |
| 217 | $info['configuration'] = $project['deploy_build']['configuration']; | 267 | $info['configuration'] = $project['deploy_build']['configuration']; |
| @@ -222,7 +272,7 @@ class UserLoginLogic | @@ -222,7 +272,7 @@ class UserLoginLogic | ||
| 222 | $info['is_visualization'] = json_decode($project['is_visualization']); | 272 | $info['is_visualization'] = json_decode($project['is_visualization']); |
| 223 | } | 273 | } |
| 224 | //保存项目缓存 | 274 | //保存项目缓存 |
| 225 | - Cache::put('user-'.$info['project_id'],$project,$minutes = null); | 275 | + Cache::put('user-'.$info['project_id'],$project,12 * 3600); |
| 226 | return $this->success($info); | 276 | return $this->success($info); |
| 227 | } | 277 | } |
| 228 | 278 |
| @@ -17,7 +17,7 @@ class AmazonS3Service | @@ -17,7 +17,7 @@ class AmazonS3Service | ||
| 17 | protected $s3; | 17 | protected $s3; |
| 18 | protected $accessKeyId = 'AKIAU6YKND7SAWIKBXCZ';//key | 18 | protected $accessKeyId = 'AKIAU6YKND7SAWIKBXCZ';//key |
| 19 | protected $secretAccessKey = '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';//密匙 | 19 | protected $secretAccessKey = 'Hwd2abya/2Icu6NMDo4YrdTqCtir1BeTuUj5kEkB';//密匙 |
| 20 | - protected $region = 's3://arn:aws:s3:us-west-2:340934860772:accesspoint/globalso-v6';//地址 | 20 | + protected $region = 'us-west-2';//地址 |
| 21 | protected $bucket = 'arn:aws:s3:::globalso-v6';//桶子 | 21 | protected $bucket = 'arn:aws:s3:::globalso-v6';//桶子 |
| 22 | 22 | ||
| 23 | public function __construct() | 23 | public function __construct() |
| @@ -51,6 +51,7 @@ return [ | @@ -51,6 +51,7 @@ return [ | ||
| 51 | 'url' => env('AWS_URL'), | 51 | 'url' => env('AWS_URL'), |
| 52 | 'endpoint' => env('AWS_ENDPOINT'), | 52 | 'endpoint' => env('AWS_ENDPOINT'), |
| 53 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), | 53 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), |
| 54 | + 'cdn'=>'https://globalso-v6.s3.us-west-2.amazonaws.com/' | ||
| 54 | ], | 55 | ], |
| 55 | 56 | ||
| 56 | 'upload' => [ | 57 | 'upload' => [ |
| @@ -484,7 +484,6 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -484,7 +484,6 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 484 | Route::prefix('rating')->group(function () { | 484 | Route::prefix('rating')->group(function () { |
| 485 | Route::any('/read', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getProjectRead'])->name('rating_getProjectRead'); | 485 | Route::any('/read', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getProjectRead'])->name('rating_getProjectRead'); |
| 486 | Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save'); | 486 | Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save'); |
| 487 | - Route::any('/getHistory', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getHistory'])->name('rating_getHistory'); | ||
| 488 | Route::any('/code', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'verificationCode'])->name('rating_code'); | 487 | Route::any('/code', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'verificationCode'])->name('rating_code'); |
| 489 | }); | 488 | }); |
| 490 | }); | 489 | }); |
-
请 注册 或 登录 后发表评论