|
...
|
...
|
@@ -71,7 +71,39 @@ class ProductController extends BaseController |
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :列表
|
|
|
|
* @name :index
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/28 16:30
|
|
|
|
*/
|
|
|
|
public function downloadProduct(Product $product)
|
|
|
|
{
|
|
|
|
$filed = ['id', 'project_id', 'title', 'sort' ,'thumb' ,'product_type' , 'route' ,'intro','content',
|
|
|
|
'category_id', 'keyword_id', 'status', 'created_uid', 'is_upgrade' ,'created_at', 'updated_at','six_read'];
|
|
|
|
$this->order = 'sort';
|
|
|
|
$query = $product->orderBy($this->order ,'desc')->orderBy('id','desc');
|
|
|
|
$query = $this->searchParam($query);
|
|
|
|
$lists = $query->select($filed)->paginate($this->row, ['*'], 'page', $this->page);
|
|
|
|
if(!empty($lists)){
|
|
|
|
$lists = $lists->toArray();
|
|
|
|
$cate_data = $this->getCategoryList();//分类
|
|
|
|
$key_data = $this->keywordNameLists($lists['list']);//关键字
|
|
|
|
$template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id
|
|
|
|
$userModel = new User();
|
|
|
|
foreach ($lists['list'] as $k=>$v){
|
|
|
|
$v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);
|
|
|
|
$v['category_id_text'] = $this->categoryName($v['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->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']);
|
|
|
|
$v = $this->getHandleFileImage($v);
|
|
|
|
$lists['list'][$k] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :获取当前页的所有关键字名称
|
|
|
|
* @name :keywordNameLists
|
...
|
...
|
|