|
...
|
...
|
@@ -10,7 +10,6 @@ use App\Models\Product\Category; |
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Rules\Ids;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class CategoryController
|
|
...
|
...
|
@@ -78,25 +77,15 @@ class CategoryController extends BaseController |
|
|
|
* @time :2025/3/19 14:38
|
|
|
|
*/
|
|
|
|
public function get3283Lists(&$category,$filed){
|
|
|
|
$list = Cache::get('category_list_'.$this->user['project_id']);
|
|
|
|
if(!empty($list)){
|
|
|
|
if(!isset($this->map['title'])){
|
|
|
|
$list = $this->getListSon($list);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$list = $category->list($this->map,['sort','id'],$filed);
|
|
|
|
// $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST);//获取模版id
|
|
|
|
// foreach ($list as $k =>$v){
|
|
|
|
// $v['url'] = $this->user['domain'] . $v['route'].'/';
|
|
|
|
// $v['product_num'] = $category->getProductNum($list,$v['id']);
|
|
|
|
// $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
|
|
|
|
// $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']);
|
|
|
|
// $list[$k] = $v;
|
|
|
|
// }
|
|
|
|
// if(!isset($this->map['title'])){
|
|
|
|
// $list = $this->getListSon($list);
|
|
|
|
// }
|
|
|
|
Cache::put('category_list_'.$this->user['project_id'],$list,3600);
|
|
|
|
$this->map['pid'] = ($this->map['pid'] ?? 0);
|
|
|
|
$list = $category->list($this->map,['sort','id'],$filed);
|
|
|
|
$template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST);//获取模版id
|
|
|
|
foreach ($list as $k =>$v){
|
|
|
|
$v['url'] = $this->user['domain'] . $v['route'].'/';
|
|
|
|
$v['product_num'] = $category->getProductNum($list,$v['id']);
|
|
|
|
$v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']);
|
|
|
|
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_LIST,$template_id,$v['id']);
|
|
|
|
$list[$k] = $v;
|
|
|
|
}
|
|
|
|
return $this->success($list);
|
|
|
|
}
|
...
|
...
|
|