作者 李宇航

合并分支 'lyh-server' 到 'master'

gx数据



查看合并请求 !1502
@@ -10,7 +10,6 @@ use App\Models\Product\Category; @@ -10,7 +10,6 @@ use App\Models\Product\Category;
10 use App\Models\Template\BTemplate; 10 use App\Models\Template\BTemplate;
11 use App\Rules\Ids; 11 use App\Rules\Ids;
12 use Illuminate\Http\Request; 12 use Illuminate\Http\Request;
13 -use Illuminate\Support\Facades\Cache;  
14 13
15 /** 14 /**
16 * Class CategoryController 15 * Class CategoryController
@@ -78,25 +77,15 @@ class CategoryController extends BaseController @@ -78,25 +77,15 @@ class CategoryController extends BaseController
78 * @time :2025/3/19 14:38 77 * @time :2025/3/19 14:38
79 */ 78 */
80 public function get3283Lists(&$category,$filed){ 79 public function get3283Lists(&$category,$filed){
81 - $list = Cache::get('category_list_'.$this->user['project_id']);  
82 - if(!empty($list)){  
83 - if(!isset($this->map['title'])){  
84 - $list = $this->getListSon($list);  
85 - }  
86 - }else{  
87 - $list = $category->list($this->map,['sort','id'],$filed);  
88 -// $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST);//获取模版id  
89 -// foreach ($list as $k =>$v){  
90 -// $v['url'] = $this->user['domain'] . $v['route'].'/';  
91 -// $v['product_num'] = $category->getProductNum($list,$v['id']);  
92 -// $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);  
93 -// $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']);  
94 -// $list[$k] = $v;  
95 -// }  
96 -// if(!isset($this->map['title'])){  
97 -// $list = $this->getListSon($list);  
98 -// }  
99 - Cache::put('category_list_'.$this->user['project_id'],$list,3600); 80 + $this->map['pid'] = ($this->map['pid'] ?? 0);
  81 + $list = $category->list($this->map,['sort','id'],$filed);
  82 + $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST);//获取模版id
  83 + foreach ($list as $k =>$v){
  84 + $v['url'] = $this->user['domain'] . $v['route'].'/';
  85 + $v['product_num'] = $category->getProductNum($list,$v['id']);
  86 + $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
  87 + $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']);
  88 + $list[$k] = $v;
100 } 89 }
101 return $this->success($list); 90 return $this->success($list);
102 } 91 }