作者 赵彬吉

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -102,7 +102,7 @@ class LoginController extends BaseController
* @method :post
* @time :2023/8/19 9:13
*/
public function sendLoginSms()
public function sendLoginSms($type = SmsLog::TYPE_LOGIN)
{
$this->request->validate([
'mobile'=>['required', 'regex:/^1[3-9]\d{9}$/'],
... ... @@ -115,7 +115,7 @@ class LoginController extends BaseController
if (empty($user)) {
$this->response('请输入正确的手机号码!', Code::SYSTEM_ERROR);
}
$last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_LOGIN);
$last_sms = SmsLog::getLastLog($mobile, $type);
if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) {
$this->response('请不要重复发送短信!', Code::SYSTEM_ERROR);
}
... ... @@ -126,7 +126,7 @@ class LoginController extends BaseController
if (empty($send->Code) && $send->Code != 'OK') {
$this->response('发送失败, 请稍后重试!', Code::SYSTEM_ERROR);
}
SmsLog::createLog($mobile, $code['code']);
SmsLog::createLog($mobile, $code['code'],$type);
$this->response('success');
}
... ...
<?php
/**
* @remark :
* @name :RatingController.php
* @author :lyh
* @method :post
* @time :2024/1/20 14:02
*/
namespace App\Http\Controllers\Bside\Scoring;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Scoring\RatingLogic;
use App\Models\Scoring\RatingQuestion;
use App\Models\Scoring\ScoringSystem;
use App\Models\Sms\SmsLog;
use App\Models\User\User;
use Mrgoon\AliSms\AliSms;
/**
* @remark :评分系统问题管理
* @name :RatingController
* @author :lyh
* @method :post
* @time :2024/1/20 14:02
*/
class RatingController extends BaseController
{
/**
* @remark :获取问卷调查记录(阶段记录)
* @name :getHistory
* @author :lyh
* @method :post
* @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);
}
/**
* @remark :问卷调查详情
* @name :getProjectRead
* @author :lyh
* @method :post
* @time :2024/1/20 14:11
*/
public function getProjectRead(RatingLogic $ratingLogic){
$this->request->validate([
'type' => 'required',
],[
'type.required' => '问题类型不能为空',
]);
$info = $ratingLogic->getRatingRead();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :提交评分
* @name :save
* @author :lyh
* @method :post
* @time :2024/1/20 14:43
*/
public function save(RatingLogic $ratingLogic){
$this->request->validate([
'data' => 'required',
'mobile' => 'required',
],[
'data.required' => '请填写完整',
'mobile.required' => '手机号码不能为空',
]);
$ratingLogic->ratingSave();
$this->response('success');
}
}
... ...
<?php
/**
* @remark :
* @name :RatingLogic.php
* @author :lyh
* @method :post
* @time :2024/1/20 14:15
*/
namespace App\Http\Logic\Bside\Scoring;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Scoring\RatingQuestion;
use App\Models\Scoring\ScoringSystem;
class RatingLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new RatingQuestion();
$this->scoringModel = new ScoringSystem();
$this->param = $this->requestAll;
}
/**
* @remark :获取详情
* @name :getRatingRead
* @author :lyh
* @method :post
* @time :2024/1/20 14:27
*/
public function getRatingRead(){
$data = [
'company'=>$this->project['company'],
'mobile'=>$this->project['mobile'],
'uptime'=>$this->project['uptime'],
'domain'=>$this->user['domain'],
'question'=>$this->model->list(['type'=>$this->param['type']]),
];
return $this->success($data);
}
/**
* @remark :提交统计
* @name :ratingSave
* @author :lyh
* @method :post
* @time :2024/1/20 14:46
*/
public function ratingSave(){
$param = [
'data'=>json_encode($this->param['data']),
'mobile'=>$this->param['mobile'],
'project_id'=>$this->user['project_id'],
];
return $this->scoringModel->add($param);
}
}
... ...
... ... @@ -170,6 +170,7 @@ class UserLoginLogic
$info['upload_config'] = $project['upload_config'];
$info['main_lang_id'] = $project['main_lang_id'];
$info['image_max'] = $project['image_max'];
$info['uptime'] = $project['uptime'];
$info['is_update_language'] = $project['is_update_language'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['project_type'] = $project['type'];
... ... @@ -208,6 +209,7 @@ class UserLoginLogic
$info['upload_config'] = $project['upload_config'];
$info['main_lang_id'] = $project['main_lang_id'];
$info['image_max'] = $project['image_max'];
$info['uptime'] = $project['uptime'];
$info['is_update_language'] = $project['is_update_language'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['project_type'] = $project['type'];
... ...
<?php
/**
* @remark :
* @name :RatingQuestion.php
* @author :lyh
* @method :post
* @time :2024/1/20 11:14
*/
namespace App\Models\Scoring;
use App\Models\Base;
/**
* @remark :问题
* @name :RatingQuestion
* @author :lyh
* @method :post
* @time :2024/1/20 11:15
*/
class RatingQuestion extends Base
{
protected $table = 'gl_rating_questions';
}
... ...
<?php
/**
* @remark :
* @name :ScoringSystem.php
* @author :lyh
* @method :post
* @time :2024/1/20 11:17
*/
namespace App\Models\Scoring;
use App\Models\Base;
class ScoringSystem extends Base
{
protected $table = 'gl_scoring_system';
}
... ...
... ... @@ -16,6 +16,7 @@ class SmsLog extends Base
const TYPE_REGISTER = 'register';
const TYPE_LOGIN = 'login';
const TYPE_CORING = 'coring';//评分系统
const TYPE_MANAGER_LOGIN = 'manager_login';//管理员登录
const TYPE_NOTICE = 'notice';
... ...
... ... @@ -478,6 +478,12 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/extendContent', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'extendContent'])->name('custom_extend_extendContent');
});
});
//评分系统
Route::prefix('rating')->group(function () {
Route::any('/read', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getProjectRead'])->name('rating_getProjectRead');
Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save');
Route::any('/getHistory', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getHistory'])->name('rating_getHistory');
});
});
//无需登录验证的路由组
Route::group([], function () {
... ...