|
...
|
...
|
@@ -7,6 +7,7 @@ use App\Exceptions\BsideGlobalException; |
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Http\Logic\Bside\BTemplate\BTemplateLogic;
|
|
|
|
use App\Http\Logic\Bside\Product\ProductLogic;
|
|
|
|
use App\Http\Requests\Bside\Product\ProductRequest;
|
|
|
|
use App\Models\Product\Category;
|
|
...
|
...
|
@@ -52,15 +53,13 @@ class ProductController extends BaseController |
|
|
|
$lists = $lists->toArray();
|
|
|
|
$cate_data = $this->getCategoryList();//分类
|
|
|
|
$key_data = $this->getKeywordsList();//关键字
|
|
|
|
//获取当前用户选择的模版
|
|
|
|
$templateSettingModel = new Setting();
|
|
|
|
$info = $templateSettingModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
$template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id
|
|
|
|
$userModel = new User();
|
|
|
|
foreach ($lists['list'] as $k=>$v){
|
|
|
|
$v['category_id_text'] = $this->categoryName($v['category_id'],$cate_data);
|
|
|
|
$v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data);
|
|
|
|
$v['created_uid_text'] = $userModel->getName($v['created_uid']);
|
|
|
|
$v['is_renovation'] = $this->getProductIsRenovation($info,$v['id']);
|
|
|
|
$v['is_renovation'] = $this->getIsRenovation(Bemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']);
|
|
|
|
$v['url'] = $this->user['domain'].$v['route'].'/';
|
|
|
|
$lists['list'][$k] = $v;
|
|
|
|
}
|
|
...
|
...
|
@@ -119,31 +118,6 @@ class ProductController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :查看产品是否已装修
|
|
|
|
* @name :getProductIsRenovation
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/13 14:02
|
|
|
|
*/
|
|
|
|
public function getProductIsRenovation($info,$id){
|
|
|
|
if($info !== false){
|
|
|
|
$webTemplateModel = new BTemplate();
|
|
|
|
$param = [
|
|
|
|
'source'=>2,
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'source_id'=>$id,
|
|
|
|
'template_id'=>$info['template_id'],
|
|
|
|
'is_list'=>0
|
|
|
|
];
|
|
|
|
$templateInfo = $webTemplateModel->read($param);
|
|
|
|
if($templateInfo !== false){
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取所有分类
|
|
|
|
* @name :getCategoryList
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -266,9 +240,8 @@ class ProductController extends BaseController |
|
|
|
}
|
|
|
|
$v['status_text'] = Product::statusMap()[$v['status']] ?? '';
|
|
|
|
//获取当前用户选择的模版
|
|
|
|
$templateSettingModel = new Setting();
|
|
|
|
$templateInfo = $templateSettingModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
$v['is_renovation'] = $this->getProductIsRenovation($templateInfo,$v['id']);
|
|
|
|
$template_id = $this->getTemplateId(Bemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);
|
|
|
|
$v['is_renovation'] = $this->getIsRenovation(Bemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']);
|
|
|
|
$v['url'] = $this->user['domain'].$v['route'];
|
|
|
|
//获取当前数据扩展字段及值
|
|
|
|
$v['extend'] = $this->getExtendInfo($v['id']);
|
...
|
...
|
|