合并分支 'master-server' 到 'master'
Master server 查看合并请求 !897
正在显示
6 个修改的文件
包含
112 行增加
和
8 行删除
| @@ -43,13 +43,13 @@ class TemplateLog extends Command | @@ -43,13 +43,13 @@ class TemplateLog extends Command | ||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | public function handle(){ | 45 | public function handle(){ |
| 46 | + $this->deleteUserLog(); | ||
| 46 | $projectModel = new Project(); | 47 | $projectModel = new Project(); |
| 47 | $list = $projectModel->list(['delete_status'=>0]); | 48 | $list = $projectModel->list(['delete_status'=>0]); |
| 48 | foreach ($list as $v){ | 49 | foreach ($list as $v){ |
| 49 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 50 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 50 | ProjectServer::useProject($v['id']); | 51 | ProjectServer::useProject($v['id']); |
| 51 | $this->deleteTemplate(); | 52 | $this->deleteTemplate(); |
| 52 | - $this->deleteUserLog(); | ||
| 53 | DB::disconnect('custom_mysql'); | 53 | DB::disconnect('custom_mysql'); |
| 54 | } | 54 | } |
| 55 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 55 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| @@ -138,10 +138,11 @@ class RecommendedSuppliers extends Command | @@ -138,10 +138,11 @@ class RecommendedSuppliers extends Command | ||
| 138 | $v['email'] = json_encode($v['email'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | 138 | $v['email'] = json_encode($v['email'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
| 139 | $v['mobile'] = json_encode($v['mobile'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | 139 | $v['mobile'] = json_encode($v['mobile'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
| 140 | $v['social_media'] = json_encode($v['social_media'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); | 140 | $v['social_media'] = json_encode($v['social_media'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
| 141 | + $v['image'] = str_replace('admin.hagro.cn','fob.ai.cc',$v['image']); | ||
| 141 | // $v['created_at'] = date('Y-m-d H:i:s'); | 142 | // $v['created_at'] = date('Y-m-d H:i:s'); |
| 142 | // $v['updated_at'] = $v['created_at']; | 143 | // $v['updated_at'] = $v['created_at']; |
| 143 | $param = $v; | 144 | $param = $v; |
| 144 | - $info = $purchaserInfoModel->read(['keyword'=>$keyword,'buyer'=>$v['buyer'],'project_id'=>$project_id],['id']); | 145 | + $info = $purchaserInfoModel->read(['keyword'=>$keyword,'buyer_id'=>$v['buyer_id'],'project_id'=>$project_id],['id']); |
| 145 | if($info === false){ | 146 | if($info === false){ |
| 146 | $purchaserInfoModel->add($param); | 147 | $purchaserInfoModel->add($param); |
| 147 | } | 148 | } |
| @@ -20,6 +20,7 @@ use App\Models\Project\Project; | @@ -20,6 +20,7 @@ use App\Models\Project\Project; | ||
| 20 | use App\Models\RouteMap\RouteMap; | 20 | use App\Models\RouteMap\RouteMap; |
| 21 | use App\Models\WebSetting\SettingNum; | 21 | use App\Models\WebSetting\SettingNum; |
| 22 | use App\Models\WebSetting\Translate; | 22 | use App\Models\WebSetting\Translate; |
| 23 | +use App\Models\WebSetting\TranslateKey; | ||
| 23 | 24 | ||
| 24 | class TranslateController extends BaseController | 25 | class TranslateController extends BaseController |
| 25 | { | 26 | { |
| @@ -57,15 +58,92 @@ class TranslateController extends BaseController | @@ -57,15 +58,92 @@ class TranslateController extends BaseController | ||
| 57 | ],[ | 58 | ],[ |
| 58 | 'language_id.required' => 'language_id不能为空', | 59 | 'language_id.required' => 'language_id不能为空', |
| 59 | ]); | 60 | ]); |
| 61 | + //上线后放开 | ||
| 62 | +// $is_trans_proof = $this->project['deploy_build']['is_trans_proof'] ?? 0; | ||
| 63 | +// if($is_trans_proof == 0){ | ||
| 64 | +// $this->response('未开启导出功能。请联系管理员开启。',Code::SYSTEM_ERROR); | ||
| 65 | +// } | ||
| 66 | + $res_data = []; | ||
| 67 | + $res_data['language_id'] = $this->param['language_id']; | ||
| 60 | $this->map['type'] = 1; | 68 | $this->map['type'] = 1; |
| 61 | $data = $translate->formatQuery($this->map)->with('translate_data')->get()->toArray(); | 69 | $data = $translate->formatQuery($this->map)->with('translate_data')->get()->toArray(); |
| 62 | - foreach ($data as $k=>$v){ | ||
| 63 | - $v['data'] = json_decode($v['translate_data']['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | ||
| 64 | - $data[$k] = $v; | 70 | + if(empty($data)){ |
| 71 | + $keyModel = new TranslateKey(); | ||
| 72 | + $keyList = $keyModel->list([],'id',['*'],'asc'); | ||
| 73 | + if(empty($keyList)){ | ||
| 74 | + $this->response('导出数据为空',Code::SYSTEM_ERROR); | ||
| 75 | + } | ||
| 76 | + $res_data = $this->resEmptyData($keyList); | ||
| 77 | + $this->response('success',Code::SUCCESS,$res_data); | ||
| 65 | } | 78 | } |
| 66 | - $this->response('success',Code::SUCCESS,$data); | 79 | + $res_data = $this->resData($data); |
| 80 | + $this->response('success',Code::SUCCESS,$res_data); | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * @remark :都不为处理数据 | ||
| 85 | + * @name :resData | ||
| 86 | + * @author :lyh | ||
| 87 | + * @method :post | ||
| 88 | + * @time :2024/11/22 17:50 | ||
| 89 | + */ | ||
| 90 | + public function resData($data){ | ||
| 91 | + $result_id_data = []; | ||
| 92 | + $keyModel = new TranslateKey(); | ||
| 93 | + foreach ($data as $values){ | ||
| 94 | + $resData['route'] = $values['url']; | ||
| 95 | + $resData['page'] = $values['page']; | ||
| 96 | + $resData['data'] = []; | ||
| 97 | + $keyInfo = $keyModel->read(['route'=>$values['route'],'page'=>$values['page']],['id','proof_key']); | ||
| 98 | + if($keyInfo !== false){ | ||
| 99 | + $result_id_data[] = $keyInfo['id']; | ||
| 100 | + $translate_data = json_decode($values['translate_data']['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | ||
| 101 | + $translate_data_keys = array_keys($translate_data); | ||
| 102 | + $proof_key_data = json_decode($keyInfo['proof_key'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | ||
| 103 | + foreach ($proof_key_data as $value){ | ||
| 104 | + if(!in_array($value,$translate_data_keys)){ | ||
| 105 | + $translate_data[$value] = ''; | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + $resData['data'] = $translate_data; | ||
| 110 | + $res_data[] = $resData; | ||
| 111 | + } | ||
| 112 | + $keyList = $keyModel->list(['id'=>['not in',$result_id_data]],'id',['id','proof_key','url','page']); | ||
| 113 | + if(!empty($keyList)){ | ||
| 114 | + foreach ($keyList as $val){ | ||
| 115 | + $resData['route'] = $val['url']; | ||
| 116 | + $resData['page'] = $val['page']; | ||
| 117 | + $proof_key_data = json_decode($val['proof_key'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | ||
| 118 | + foreach ($proof_key_data as $value){ | ||
| 119 | + $resData[$value] = ''; | ||
| 120 | + } | ||
| 121 | + $res_data[] = $resData; | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + return $res_data; | ||
| 67 | } | 125 | } |
| 68 | 126 | ||
| 127 | + /** | ||
| 128 | + * @remark :data值为空 按原key返回 | ||
| 129 | + * @name :resEmptyKeyList | ||
| 130 | + * @author :lyh | ||
| 131 | + * @method :post | ||
| 132 | + * @time :2024/11/22 17:45 | ||
| 133 | + */ | ||
| 134 | + public function resEmptyData($keyList){ | ||
| 135 | + $res_data = []; | ||
| 136 | + foreach ($keyList as $values){ | ||
| 137 | + $key_data = json_decode($values['proof_key'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | ||
| 138 | + $resData['route'] = $values['url']; | ||
| 139 | + $resData['page'] = $values['page']; | ||
| 140 | + foreach ($key_data as $key_val){ | ||
| 141 | + $resData['data'][] = [$key_val => '']; | ||
| 142 | + } | ||
| 143 | + $res_data[] = $resData; | ||
| 144 | + } | ||
| 145 | + return $res_data; | ||
| 146 | + } | ||
| 69 | 147 | ||
| 70 | /** | 148 | /** |
| 71 | * @remark :图片列表 | 149 | * @remark :图片列表 |
| @@ -46,6 +46,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -46,6 +46,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 46 | */ | 46 | */ |
| 47 | public function customTemplateInfo(){ | 47 | public function customTemplateInfo(){ |
| 48 | $info = $this->model->read(['id'=>$this->param['id']]); | 48 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 49 | + $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']); | ||
| 49 | if($info === false){ | 50 | if($info === false){ |
| 50 | $this->fail('当前数据不存在'); | 51 | $this->fail('当前数据不存在'); |
| 51 | } | 52 | } |
| @@ -163,7 +164,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -163,7 +164,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 163 | $six_read = $this->param['six_read'] ?? 0;//5.0数据时,是否按6.0显示 | 164 | $six_read = $this->param['six_read'] ?? 0;//5.0数据时,是否按6.0显示 |
| 164 | if($is_upgrade == 0 || $six_read == 0) { | 165 | if($is_upgrade == 0 || $six_read == 0) { |
| 165 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); | 166 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); |
| 166 | - if($this->param['url'] == 'news' || $this->param['url'] == 'product' || $this->param['url'] == 'blog'){ | 167 | + if(($this->param['url'] == 'news') || ($this->param['url'] == 'product') || ($this->param['url'] == 'blog')){ |
| 167 | $this->fail('不允许创建路由为:'.$this->param['url']); | 168 | $this->fail('不允许创建路由为:'.$this->param['url']); |
| 168 | } | 169 | } |
| 169 | } | 170 | } |
| @@ -185,7 +186,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -185,7 +186,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 185 | $this->param['html_style'] = "<style id='globalsojs-styles'></style>"; | 186 | $this->param['html_style'] = "<style id='globalsojs-styles'></style>"; |
| 186 | } | 187 | } |
| 187 | } | 188 | } |
| 188 | - if($this->param['url'] == 'news' || $this->param['url'] == 'product' || $this->param['url'] == 'blog'){ | 189 | + if(($this->param['url'] == 'news') || ($this->param['url'] == 'product') || ($this->param['url'] == 'blog')){ |
| 189 | $this->fail('不允许修改路由为:'.$this->param['url']); | 190 | $this->fail('不允许修改路由为:'.$this->param['url']); |
| 190 | } | 191 | } |
| 191 | $this->param['project_id'] = $this->user['project_id']; | 192 | $this->param['project_id'] = $this->user['project_id']; |
| @@ -205,6 +206,9 @@ class CustomTemplateLogic extends BaseLogic | @@ -205,6 +206,9 @@ class CustomTemplateLogic extends BaseLogic | ||
| 205 | * @time :2024/8/6 16:52 | 206 | * @time :2024/8/6 16:52 |
| 206 | */ | 207 | */ |
| 207 | public function handleSaveParam(){ | 208 | public function handleSaveParam(){ |
| 209 | + if(isset($param['image'])){ | ||
| 210 | + $this->param['image'] = str_replace_url($this->param['image'] ?? ''); | ||
| 211 | + } | ||
| 208 | $this->param['url'] = str_replace_url($this->param['url']); | 212 | $this->param['url'] = str_replace_url($this->param['url']); |
| 209 | $this->param['operator_id'] = $this->user['id']; | 213 | $this->param['operator_id'] = $this->user['id']; |
| 210 | if(empty($this->project)){ | 214 | if(empty($this->project)){ |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Models\Template; | 3 | namespace App\Models\Template; |
| 4 | 4 | ||
| 5 | +use App\Helper\Arr; | ||
| 5 | use App\Models\Base; | 6 | use App\Models\Base; |
| 6 | 7 | ||
| 7 | class BCustomTemplate extends Base | 8 | class BCustomTemplate extends Base |
| @@ -14,4 +15,5 @@ class BCustomTemplate extends Base | @@ -14,4 +15,5 @@ class BCustomTemplate extends Base | ||
| 14 | 15 | ||
| 15 | const STATUS_ACTIVE = 1; | 16 | const STATUS_ACTIVE = 1; |
| 16 | const STATUS_DRAFT = 0; | 17 | const STATUS_DRAFT = 0; |
| 18 | + | ||
| 17 | } | 19 | } |
app/Models/WebSetting/TranslateKey.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :TranslateKey.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/11/22 11:11 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\WebSetting; | ||
| 11 | + | ||
| 12 | +use App\Models\Base; | ||
| 13 | + | ||
| 14 | +class TranslateKey extends Base | ||
| 15 | +{ | ||
| 16 | + protected $table = 'gl_translate_key'; | ||
| 17 | + | ||
| 18 | + protected $connection = 'custom_mysql'; | ||
| 19 | +} |
-
请 注册 或 登录 后发表评论