正在显示
6 个修改的文件
包含
156 行增加
和
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\Sms\SmsLog; | ||
| 17 | +use App\Models\User\User; | ||
| 18 | +use Mrgoon\AliSms\AliSms; | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * @remark :评分系统问题管理 | ||
| 22 | + * @name :RatingController | ||
| 23 | + * @author :lyh | ||
| 24 | + * @method :post | ||
| 25 | + * @time :2024/1/20 14:02 | ||
| 26 | + */ | ||
| 27 | +class RatingController extends BaseController | ||
| 28 | +{ | ||
| 29 | + /** | ||
| 30 | + * @remark :问卷调查详情 | ||
| 31 | + * @name :getProjectRead | ||
| 32 | + * @author :lyh | ||
| 33 | + * @method :post | ||
| 34 | + * @time :2024/1/20 14:11 | ||
| 35 | + */ | ||
| 36 | + public function getProjectRead(RatingLogic $ratingLogic){ | ||
| 37 | + $info = $ratingLogic->getRatingRead(); | ||
| 38 | + $this->response('success',Code::SUCCESS,$info); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * @remark :提交评分 | ||
| 43 | + * @name :save | ||
| 44 | + * @author :lyh | ||
| 45 | + * @method :post | ||
| 46 | + * @time :2024/1/20 14:43 | ||
| 47 | + */ | ||
| 48 | + public function save(RatingLogic $ratingLogic){ | ||
| 49 | + $ratingLogic->ratingSave(); | ||
| 50 | + $this->response('success'); | ||
| 51 | + } | ||
| 52 | +} |
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(), | ||
| 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'=>$this->param['data'], | ||
| 54 | + 'mobile'=>$this->param['mobile'], | ||
| 55 | + 'project_id'=>$this->user['project_id'], | ||
| 56 | + ]; | ||
| 57 | + return $this->scoringModel->add($param); | ||
| 58 | + } | ||
| 59 | +} |
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 |
-
请 注册 或 登录 后发表评论