|
...
|
...
|
@@ -44,34 +44,34 @@ class ProductController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/28 16:30
|
|
|
|
*/
|
|
|
|
// public function index(Product $product)
|
|
|
|
// {
|
|
|
|
// $filed = ['id', 'project_id', 'title', 'sort' ,'thumb' ,'product_type' , 'route' ,
|
|
|
|
// '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) && !empty($lists['list'])){
|
|
|
|
// $lists = $lists->toArray();
|
|
|
|
// $cate_data = $this->getCategoryList();//分类
|
|
|
|
// $key_data = $this->keywordNameLists($lists['list']);//关键字
|
|
|
|
// @file_put_contents(storage_path('logs/lyh_error.log'), var_export(111111111111111, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
// @file_put_contents(storage_path('logs/lyh_error.log'), var_export($key_data, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
// $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['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->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);
|
|
|
|
// }
|
|
|
|
public function index(Product $product)
|
|
|
|
{
|
|
|
|
$filed = ['id', 'project_id', 'title', 'sort' ,'thumb' ,'product_type' , 'route' ,
|
|
|
|
'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) && !empty($lists['list'])){
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(111111111111111, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$lists = $lists->toArray();
|
|
|
|
$cate_data = $this->getCategoryList();//分类
|
|
|
|
$key_data = $this->keywordNameLists($lists['list']);//关键字
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($key_data, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$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['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->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 :获取当前页的所有关键字名称
|
...
|
...
|
|