作者 lyh

gx

@@ -38,7 +38,7 @@ class BlogController extends BaseController @@ -38,7 +38,7 @@ class BlogController extends BaseController
38 foreach ($lists['list'] as $k => $v){ 38 foreach ($lists['list'] as $k => $v){
39 $v['category_name'] = $this->categoryName($v['category_id'],$data); 39 $v['category_name'] = $this->categoryName($v['category_id'],$data);
40 $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG,$v['id']); 40 $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG,$v['id']);
41 - $v['image_link'] = getImageUrl($v['image']); 41 + $v['image_link'] = getImageUrl($v['image'],$this->user['project_location'],$this->user['storage_type']);
42 $v['operator_name'] = $user->getName($v['operator_id']); 42 $v['operator_name'] = $user->getName($v['operator_id']);
43 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id,$v['id']); 43 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id,$v['id']);
44 $lists['list'][$k] = $v; 44 $lists['list'][$k] = $v;
@@ -186,10 +186,8 @@ class BlogController extends BaseController @@ -186,10 +186,8 @@ class BlogController extends BaseController
186 'id.required' => 'ID不能为空' 186 'id.required' => 'ID不能为空'
187 ]); 187 ]);
188 $info = $blogLogic->blogInfo(); 188 $info = $blogLogic->blogInfo();
189 -  
190 $template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL); 189 $template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL);
191 $info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id, $info['id']); 190 $info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id, $info['id']);
192 -  
193 $this->response('success',Code::SUCCESS,$info); 191 $this->response('success',Code::SUCCESS,$info);
194 } 192 }
195 193
@@ -41,7 +41,7 @@ class NewsController extends BaseController @@ -41,7 +41,7 @@ class NewsController extends BaseController
41 foreach ($lists['list'] as $k => $v){ 41 foreach ($lists['list'] as $k => $v){
42 $v['category_name'] = $this->categoryName($v['category_id'],$data); 42 $v['category_name'] = $this->categoryName($v['category_id'],$data);
43 $v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS,$v['id']); 43 $v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
44 - $v['image_link'] = getImageUrl($v['image']); 44 + $v['image_link'] = getImageUrl($v['image'],$this->user['project_location'],$this->user['storage_type']);
45 $v['operator_name'] = $user->getName($v['operator_id']); 45 $v['operator_name'] = $user->getName($v['operator_id']);
46 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id,$v['id']); 46 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id,$v['id']);
47 $lists['list'][$k] = $v; 47 $lists['list'][$k] = $v;
@@ -175,10 +175,8 @@ class NewsController extends BaseController @@ -175,10 +175,8 @@ class NewsController extends BaseController
175 'id.required' => 'ID不能为空', 175 'id.required' => 'ID不能为空',
176 ]); 176 ]);
177 $info = $newsLogic->newsInfo(); 177 $info = $newsLogic->newsInfo();
178 -  
179 $template_id = $this->getTemplateId(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL);//获取模版id 178 $template_id = $this->getTemplateId(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL);//获取模版id
180 $info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id, $info['id']); 179 $info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id, $info['id']);
181 -  
182 $this->response('success',Code::SUCCESS,$info); 180 $this->response('success',Code::SUCCESS,$info);
183 } 181 }
184 182
@@ -56,11 +56,12 @@ class ProductController extends BaseController @@ -56,11 +56,12 @@ class ProductController extends BaseController
56 $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id 56 $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id
57 $userModel = new User(); 57 $userModel = new User();
58 foreach ($lists['list'] as $k=>$v){ 58 foreach ($lists['list'] as $k=>$v){
  59 + $v['url'] = $this->user['domain'].$v['route'].'/';
59 $v['category_id_text'] = $this->categoryName($v['category_id'],$cate_data); 60 $v['category_id_text'] = $this->categoryName($v['category_id'],$cate_data);
60 $v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data); 61 $v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data);
61 $v['created_uid_text'] = $userModel->getName($v['created_uid']); 62 $v['created_uid_text'] = $userModel->getName($v['created_uid']);
62 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']); 63 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']);
63 - $v = $this->getHandleFileImage($v,$cate_data,$key_data,$template_id); 64 + $v = $this->getHandleFileImage($v);
64 $lists['list'][$k] = $v; 65 $lists['list'][$k] = $v;
65 } 66 }
66 } 67 }
@@ -75,7 +76,6 @@ class ProductController extends BaseController @@ -75,7 +76,6 @@ class ProductController extends BaseController
75 * @time :2024/1/23 17:43 76 * @time :2024/1/23 17:43
76 */ 77 */
77 public function getHandleFileImage($v){ 78 public function getHandleFileImage($v){
78 - $v['url'] = $this->user['domain'].$v['route'].'/';  
79 //ToDo::处理图片及文件 79 //ToDo::处理图片及文件
80 if(!empty($v['thumb']) && !empty($v['thumb']['url'])){ 80 if(!empty($v['thumb']) && !empty($v['thumb']['url'])){
81 $v['thumb']['url'] = getImageUrl($v['thumb']['url'],$this->user['project_location'],$this->user['storage_type']); 81 $v['thumb']['url'] = getImageUrl($v['thumb']['url'],$this->user['project_location'],$this->user['storage_type']);
@@ -22,7 +22,7 @@ class BTemplateController extends BaseController @@ -22,7 +22,7 @@ class BTemplateController extends BaseController
22 $lists = $BTemplateLogic->publicTemplateLists($this->map,$this->page,$this->row,$this->order); 22 $lists = $BTemplateLogic->publicTemplateLists($this->map,$this->page,$this->row,$this->order);
23 if(!empty($lists) && !empty($lists['list'])){ 23 if(!empty($lists) && !empty($lists['list'])){
24 foreach ($lists['list'] as $k => &$v){ 24 foreach ($lists['list'] as $k => &$v){
25 - $v['image_link'] = getImageUrl($v['image']); 25 + $v['image_link'] = getImageUrl($v['image'],$this->user['project_location'],$this->user['storage_type']);
26 $lists['list'][$k] = $v; 26 $lists['list'][$k] = $v;
27 } 27 }
28 } 28 }
@@ -351,7 +351,7 @@ class FileController @@ -351,7 +351,7 @@ class FileController
351 public function responseData($path, $name){ 351 public function responseData($path, $name){
352 $data = [ 352 $data = [
353 'file'=>$path, 353 'file'=>$path,
354 - 'file_link'=>getFileUrl($path,$this->upload_location), 354 + 'file_link'=>getFileUrl($path,$this->cache['project_location'] ?? 1,$this->cache['storage_type'] ?? 0),
355 'name'=>$name, 355 'name'=>$name,
356 'file_download'=>url('a/download_files?path='.$path) 356 'file_download'=>url('a/download_files?path='.$path)
357 ]; 357 ];
@@ -359,7 +359,7 @@ class ImageController extends Controller @@ -359,7 +359,7 @@ class ImageController extends Controller
359 $lists = $imageModel->lists($this->map,$this->page,$this->row); 359 $lists = $imageModel->lists($this->map,$this->page,$this->row);
360 if(!empty($lists) && !empty($lists['list'])){ 360 if(!empty($lists) && !empty($lists['list'])){
361 foreach ($lists['list'] as $k => $v){ 361 foreach ($lists['list'] as $k => $v){
362 - $v['image_link'] = getImageUrl($v['path']); 362 + $v['image_link'] = getImageUrl($v['path'],$this->cache['project_location'] ?? 1,$this->cache['storage_type'] ?? 0);
363 $lists['list'][$k] = $v; 363 $lists['list'][$k] = $v;
364 } 364 }
365 } 365 }
@@ -101,7 +101,7 @@ class BlogLogic extends BaseLogic @@ -101,7 +101,7 @@ class BlogLogic extends BaseLogic
101 //获取标签名称 101 //获取标签名称
102 $blogLabelLogic = new BlogLabelLogic(); 102 $blogLabelLogic = new BlogLabelLogic();
103 $info['label_name'] = $blogLabelLogic->getLabelName($info['label_id']); 103 $info['label_name'] = $blogLabelLogic->getLabelName($info['label_id']);
104 - $info['image_link'] = getImageUrl($info['image']); 104 + $info['image_link'] = getImageUrl($info['image'],$this->user['project_location'],$this->user['storage_type']);
105 return $this->success($info); 105 return $this->success($info);
106 } 106 }
107 107
@@ -147,7 +147,7 @@ class NewsLogic extends BaseLogic @@ -147,7 +147,7 @@ class NewsLogic extends BaseLogic
147 $this->fail('error'); 147 $this->fail('error');
148 } 148 }
149 $info['category_id'] = explode(',',trim($info['category_id'],',')); 149 $info['category_id'] = explode(',',trim($info['category_id'],','));
150 - $info['image_link'] = getImageUrl($info['image']); 150 + $info['image_link'] = getImageUrl($info['image'],$this->user['project_location'],$this->user['storage_type']);
151 return $this->success($info); 151 return $this->success($info);
152 } 152 }
153 153
@@ -104,7 +104,7 @@ class Product extends Base @@ -104,7 +104,7 @@ class Product extends Base
104 104
105 public function getThumbAttribute($value){ 105 public function getThumbAttribute($value){
106 if(!empty($value)){ 106 if(!empty($value)){
107 - $value = json_decode($value,true); 107 + $value = Arr::s2a($value);
108 } 108 }
109 return $value; 109 return $value;
110 } 110 }