作者 赵彬吉
@@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command
33 protected $description = '升级项目统计'; 33 protected $description = '升级项目统计';
34 34
35 public function handle(){ 35 public function handle(){
36 - $project_id = 627; 36 + $project_id = 632;
37 ProjectServer::useProject($project_id); 37 ProjectServer::useProject($project_id);
38 $this->count($project_id); 38 $this->count($project_id);
39 DB::disconnect('custom_mysql'); 39 DB::disconnect('custom_mysql');
@@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command
36 protected $description = '升级项目统计'; 36 protected $description = '升级项目统计';
37 37
38 public function handle(){ 38 public function handle(){
39 - $project_id = 627; 39 + $project_id = 632;
40 $oldModel = new UpdateOldInfo(); 40 $oldModel = new UpdateOldInfo();
41 $info = $oldModel->read(['project_id'=>$project_id]); 41 $info = $oldModel->read(['project_id'=>$project_id]);
42 $url = $info['old_domain_online']; 42 $url = $info['old_domain_online'];
@@ -55,7 +55,7 @@ class UpdateRoute extends Command @@ -55,7 +55,7 @@ class UpdateRoute extends Command
55 */ 55 */
56 public function handle(){ 56 public function handle(){
57 $projectModel = new Project(); 57 $projectModel = new Project();
58 - $list = $projectModel->list(['id'=>433]); 58 + $list = $projectModel->list(['id'=>627]);
59 $data = []; 59 $data = [];
60 foreach ($list as $v){ 60 foreach ($list as $v){
61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
@@ -116,6 +116,7 @@ class UpdateRoute extends Command @@ -116,6 +116,7 @@ class UpdateRoute extends Command
116 if(!empty($v['route'])){ 116 if(!empty($v['route'])){
117 $tag = "-tag"; 117 $tag = "-tag";
118 if (!(substr($v['route'], -strlen($tag)) === $tag)) { 118 if (!(substr($v['route'], -strlen($tag)) === $tag)) {
  119 + echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL;
119 // $route = Translate::tran($v['route'], 'en').$tag; 120 // $route = Translate::tran($v['route'], 'en').$tag;
120 // 如果不是以 '-tag' 结尾,则拼接上 '-tag' 121 // 如果不是以 '-tag' 结尾,则拼接上 '-tag'
121 $route = $v['route'].$tag; 122 $route = $v['route'].$tag;
@@ -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
@@ -246,7 +246,7 @@ class ProductController extends BaseController @@ -246,7 +246,7 @@ class ProductController extends BaseController
246 //获取当前用户选择的模版 246 //获取当前用户选择的模版
247 $v['video'] = json_decode($v['video'] ?? ''); 247 $v['video'] = json_decode($v['video'] ?? '');
248 $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL); 248 $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);
249 - $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']); 249 + $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id'] ?? 0);
250 $v['url'] = $this->user['domain'].$v['route']; 250 $v['url'] = $this->user['domain'].$v['route'];
251 //获取当前数据扩展字段及值 251 //获取当前数据扩展字段及值
252 $v['extend'] = $this->getExtendInfo($v['id']); 252 $v['extend'] = $this->getExtendInfo($v['id']);
  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 +}
  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 +}
@@ -49,6 +49,9 @@ class TranslateLogic extends BaseLogic @@ -49,6 +49,9 @@ class TranslateLogic extends BaseLogic
49 $new_key = $this->getUrlRead($url); 49 $new_key = $this->getUrlRead($url);
50 if($info === false){ 50 if($info === false){
51 $translate_list = Translate::tran($new_key, $languageInfo['short']); 51 $translate_list = Translate::tran($new_key, $languageInfo['short']);
  52 + if(empty($translate_list)){
  53 + $this->fail('翻译失败,请联系管理员');
  54 + }
52 foreach ($new_key as $k=>$v){ 55 foreach ($new_key as $k=>$v){
53 $data[] = [ 56 $data[] = [
54 trim($v)=>$translate_list[$k], 57 trim($v)=>$translate_list[$k],
@@ -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'];
  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 +}
  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
@@ -479,6 +479,12 @@ Route::middleware(['bloginauth'])->group(function () { @@ -479,6 +479,12 @@ Route::middleware(['bloginauth'])->group(function () {
479 Route::any('/extendContent', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'extendContent'])->name('custom_extend_extendContent'); 479 Route::any('/extendContent', [\App\Http\Controllers\Bside\CustomModule\CustomModuleExtentController::class, 'extendContent'])->name('custom_extend_extendContent');
480 }); 480 });
481 }); 481 });
  482 + //评分系统
  483 + Route::prefix('rating')->group(function () {
  484 + Route::any('/read', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getProjectRead'])->name('rating_getProjectRead');
  485 + Route::any('/save', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'save'])->name('rating_save');
  486 + Route::any('/getHistory', [\App\Http\Controllers\Bside\Scoring\RatingController::class, 'getHistory'])->name('rating_getHistory');
  487 + });
482 }); 488 });
483 //无需登录验证的路由组 489 //无需登录验证的路由组
484 Route::group([], function () { 490 Route::group([], function () {