Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
8 个修改的文件
包含
194 行增加
和
3 行删除
| @@ -102,7 +102,7 @@ class LoginController extends BaseController | @@ -102,7 +102,7 @@ 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() | 105 | + public function sendLoginSms($type = SmsLog::TYPE_LOGIN) |
| 106 | { | 106 | { |
| 107 | $this->request->validate([ | 107 | $this->request->validate([ |
| 108 | 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], | 108 | 'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'], |
| @@ -115,7 +115,7 @@ class LoginController extends BaseController | @@ -115,7 +115,7 @@ class LoginController extends BaseController | ||
| 115 | if (empty($user)) { | 115 | if (empty($user)) { |
| 116 | $this->response('请输入正确的手机号码!', Code::SYSTEM_ERROR); | 116 | $this->response('请输入正确的手机号码!', Code::SYSTEM_ERROR); |
| 117 | } | 117 | } |
| 118 | - $last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_LOGIN); | 118 | + $last_sms = SmsLog::getLastLog($mobile, $type); |
| 119 | if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) { | 119 | if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) { |
| 120 | $this->response('请不要重复发送短信!', Code::SYSTEM_ERROR); | 120 | $this->response('请不要重复发送短信!', Code::SYSTEM_ERROR); |
| 121 | } | 121 | } |
| @@ -126,7 +126,7 @@ class LoginController extends BaseController | @@ -126,7 +126,7 @@ class LoginController extends BaseController | ||
| 126 | if (empty($send->Code) && $send->Code != 'OK') { | 126 | if (empty($send->Code) && $send->Code != 'OK') { |
| 127 | $this->response('发送失败, 请稍后重试!', Code::SYSTEM_ERROR); | 127 | $this->response('发送失败, 请稍后重试!', Code::SYSTEM_ERROR); |
| 128 | } | 128 | } |
| 129 | - SmsLog::createLog($mobile, $code['code']); | 129 | + SmsLog::createLog($mobile, $code['code'],$type); |
| 130 | $this->response('success'); | 130 | $this->response('success'); |
| 131 | } | 131 | } |
| 132 | 132 |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :RatingController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/1/20 14:02 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Bside\Scoring; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Bside\BaseController; | ||
| 14 | +use App\Http\Logic\Bside\Scoring\RatingLogic; | ||
| 15 | +use App\Models\Scoring\RatingQuestion; | ||
| 16 | +use App\Models\Scoring\ScoringSystem; | ||
| 17 | +use App\Models\Sms\SmsLog; | ||
| 18 | +use App\Models\User\User; | ||
| 19 | +use Mrgoon\AliSms\AliSms; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * @remark :评分系统问题管理 | ||
| 23 | + * @name :RatingController | ||
| 24 | + * @author :lyh | ||
| 25 | + * @method :post | ||
| 26 | + * @time :2024/1/20 14:02 | ||
| 27 | + */ | ||
| 28 | +class RatingController extends BaseController | ||
| 29 | +{ | ||
| 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 | + | ||
| 47 | + /** | ||
| 48 | + * @remark :问卷调查详情 | ||
| 49 | + * @name :getProjectRead | ||
| 50 | + * @author :lyh | ||
| 51 | + * @method :post | ||
| 52 | + * @time :2024/1/20 14:11 | ||
| 53 | + */ | ||
| 54 | + public function getProjectRead(RatingLogic $ratingLogic){ | ||
| 55 | + $this->request->validate([ | ||
| 56 | + 'type' => 'required', | ||
| 57 | + ],[ | ||
| 58 | + 'type.required' => '问题类型不能为空', | ||
| 59 | + ]); | ||
| 60 | + $info = $ratingLogic->getRatingRead(); | ||
| 61 | + $this->response('success',Code::SUCCESS,$info); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * @remark :提交评分 | ||
| 66 | + * @name :save | ||
| 67 | + * @author :lyh | ||
| 68 | + * @method :post | ||
| 69 | + * @time :2024/1/20 14:43 | ||
| 70 | + */ | ||
| 71 | + public function save(RatingLogic $ratingLogic){ | ||
| 72 | + $this->request->validate([ | ||
| 73 | + 'data' => 'required', | ||
| 74 | + 'mobile' => 'required', | ||
| 75 | + ],[ | ||
| 76 | + 'data.required' => '请填写完整', | ||
| 77 | + 'mobile.required' => '手机号码不能为空', | ||
| 78 | + ]); | ||
| 79 | + $ratingLogic->ratingSave(); | ||
| 80 | + $this->response('success'); | ||
| 81 | + } | ||
| 82 | +} |
app/Http/Logic/Bside/Scoring/RatingLogic.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :RatingLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/1/20 14:15 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Bside\Scoring; | ||
| 11 | + | ||
| 12 | +use App\Http\Logic\Bside\BaseLogic; | ||
| 13 | +use App\Models\Scoring\RatingQuestion; | ||
| 14 | +use App\Models\Scoring\ScoringSystem; | ||
| 15 | + | ||
| 16 | +class RatingLogic extends BaseLogic | ||
| 17 | +{ | ||
| 18 | + public function __construct() | ||
| 19 | + { | ||
| 20 | + parent::__construct(); | ||
| 21 | + $this->model = new RatingQuestion(); | ||
| 22 | + $this->scoringModel = new ScoringSystem(); | ||
| 23 | + $this->param = $this->requestAll; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * @remark :获取详情 | ||
| 28 | + * @name :getRatingRead | ||
| 29 | + * @author :lyh | ||
| 30 | + * @method :post | ||
| 31 | + * @time :2024/1/20 14:27 | ||
| 32 | + */ | ||
| 33 | + public function getRatingRead(){ | ||
| 34 | + $data = [ | ||
| 35 | + 'company'=>$this->project['company'], | ||
| 36 | + 'mobile'=>$this->project['mobile'], | ||
| 37 | + 'uptime'=>$this->project['uptime'], | ||
| 38 | + 'domain'=>$this->user['domain'], | ||
| 39 | + 'question'=>$this->model->list(['type'=>$this->param['type']]), | ||
| 40 | + ]; | ||
| 41 | + return $this->success($data); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * @remark :提交统计 | ||
| 46 | + * @name :ratingSave | ||
| 47 | + * @author :lyh | ||
| 48 | + * @method :post | ||
| 49 | + * @time :2024/1/20 14:46 | ||
| 50 | + */ | ||
| 51 | + public function ratingSave(){ | ||
| 52 | + $param = [ | ||
| 53 | + 'data'=>json_encode($this->param['data']), | ||
| 54 | + 'mobile'=>$this->param['mobile'], | ||
| 55 | + 'project_id'=>$this->user['project_id'], | ||
| 56 | + ]; | ||
| 57 | + return $this->scoringModel->add($param); | ||
| 58 | + } | ||
| 59 | +} |
| @@ -170,6 +170,7 @@ class UserLoginLogic | @@ -170,6 +170,7 @@ class UserLoginLogic | ||
| 170 | $info['upload_config'] = $project['upload_config']; | 170 | $info['upload_config'] = $project['upload_config']; |
| 171 | $info['main_lang_id'] = $project['main_lang_id']; | 171 | $info['main_lang_id'] = $project['main_lang_id']; |
| 172 | $info['image_max'] = $project['image_max']; | 172 | $info['image_max'] = $project['image_max']; |
| 173 | + $info['uptime'] = $project['uptime']; | ||
| 173 | $info['is_update_language'] = $project['is_update_language']; | 174 | $info['is_update_language'] = $project['is_update_language']; |
| 174 | $info['configuration'] = $project['deploy_build']['configuration']; | 175 | $info['configuration'] = $project['deploy_build']['configuration']; |
| 175 | $info['project_type'] = $project['type']; | 176 | $info['project_type'] = $project['type']; |
| @@ -208,6 +209,7 @@ class UserLoginLogic | @@ -208,6 +209,7 @@ class UserLoginLogic | ||
| 208 | $info['upload_config'] = $project['upload_config']; | 209 | $info['upload_config'] = $project['upload_config']; |
| 209 | $info['main_lang_id'] = $project['main_lang_id']; | 210 | $info['main_lang_id'] = $project['main_lang_id']; |
| 210 | $info['image_max'] = $project['image_max']; | 211 | $info['image_max'] = $project['image_max']; |
| 212 | + $info['uptime'] = $project['uptime']; | ||
| 211 | $info['is_update_language'] = $project['is_update_language']; | 213 | $info['is_update_language'] = $project['is_update_language']; |
| 212 | $info['configuration'] = $project['deploy_build']['configuration']; | 214 | $info['configuration'] = $project['deploy_build']['configuration']; |
| 213 | $info['project_type'] = $project['type']; | 215 | $info['project_type'] = $project['type']; |
app/Models/Scoring/RatingQuestion.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :RatingQuestion.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/1/20 11:14 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\Scoring; | ||
| 11 | + | ||
| 12 | +use App\Models\Base; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @remark :问题 | ||
| 16 | + * @name :RatingQuestion | ||
| 17 | + * @author :lyh | ||
| 18 | + * @method :post | ||
| 19 | + * @time :2024/1/20 11:15 | ||
| 20 | + */ | ||
| 21 | +class RatingQuestion extends Base | ||
| 22 | +{ | ||
| 23 | + protected $table = 'gl_rating_questions'; | ||
| 24 | +} |
app/Models/Scoring/ScoringSystem.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :ScoringSystem.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/1/20 11:17 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\Scoring; | ||
| 11 | + | ||
| 12 | +use App\Models\Base; | ||
| 13 | + | ||
| 14 | +class ScoringSystem extends Base | ||
| 15 | +{ | ||
| 16 | + protected $table = 'gl_scoring_system'; | ||
| 17 | +} |
| @@ -16,6 +16,7 @@ class SmsLog extends Base | @@ -16,6 +16,7 @@ class SmsLog extends Base | ||
| 16 | const TYPE_REGISTER = 'register'; | 16 | const TYPE_REGISTER = 'register'; |
| 17 | const TYPE_LOGIN = 'login'; | 17 | const TYPE_LOGIN = 'login'; |
| 18 | 18 | ||
| 19 | + const TYPE_CORING = 'coring';//评分系统 | ||
| 19 | const TYPE_MANAGER_LOGIN = 'manager_login';//管理员登录 | 20 | const TYPE_MANAGER_LOGIN = 'manager_login';//管理员登录 |
| 20 | const TYPE_NOTICE = 'notice'; | 21 | const TYPE_NOTICE = 'notice'; |
| 21 | 22 |
| @@ -478,6 +478,12 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -478,6 +478,12 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 478 | Route::any('/extendContent', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'extendContent'])->name('custom_extend_extendContent'); | 478 | Route::any('/extendContent', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'extendContent'])->name('custom_extend_extendContent'); |
| 479 | }); | 479 | }); |
| 480 | }); | 480 | }); |
| 481 | + //评分系统 | ||
| 482 | + Route::prefix('rating')->group(function () { | ||
| 483 | + Route::any('/read', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getProjectRead'])->name('rating_getProjectRead'); | ||
| 484 | + Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save'); | ||
| 485 | + Route::any('/getHistory', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getHistory'])->name('rating_getHistory'); | ||
| 486 | + }); | ||
| 481 | }); | 487 | }); |
| 482 | //无需登录验证的路由组 | 488 | //无需登录验证的路由组 |
| 483 | Route::group([], function () { | 489 | Route::group([], function () { |
-
请 注册 或 登录 后发表评论