作者 赵彬吉
... ... @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command
protected $description = '升级项目统计';
public function handle(){
$project_id = 627;
$project_id = 632;
ProjectServer::useProject($project_id);
$this->count($project_id);
DB::disconnect('custom_mysql');
... ...
... ... @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command
protected $description = '升级项目统计';
public function handle(){
$project_id = 627;
$project_id = 632;
$oldModel = new UpdateOldInfo();
$info = $oldModel->read(['project_id'=>$project_id]);
$url = $info['old_domain_online'];
... ...
... ... @@ -55,7 +55,7 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>433]);
$list = $projectModel->list(['id'=>627]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
... ... @@ -116,6 +116,7 @@ class UpdateRoute extends Command
if(!empty($v['route'])){
$tag = "-tag";
if (!(substr($v['route'], -strlen($tag)) === $tag)) {
echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL;
// $route = Translate::tran($v['route'], 'en').$tag;
// 如果不是以 '-tag' 结尾,则拼接上 '-tag'
$route = $v['route'].$tag;
... ...
... ... @@ -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');
}
... ...
... ... @@ -246,7 +246,7 @@ class ProductController extends BaseController
//获取当前用户选择的模版
$v['video'] = json_decode($v['video'] ?? '');
$template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']);
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id'] ?? 0);
$v['url'] = $this->user['domain'].$v['route'];
//获取当前数据扩展字段及值
$v['extend'] = $this->getExtendInfo($v['id']);
... ...
<?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);
}
}
... ...
... ... @@ -49,6 +49,9 @@ class TranslateLogic extends BaseLogic
$new_key = $this->getUrlRead($url);
if($info === false){
$translate_list = Translate::tran($new_key, $languageInfo['short']);
if(empty($translate_list)){
$this->fail('翻译失败,请联系管理员');
}
foreach ($new_key as $k=>$v){
$data[] = [
trim($v)=>$translate_list[$k],
... ...
... ... @@ -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';
... ...
... ... @@ -479,6 +479,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 () {
... ...