作者 lyh

gx

@@ -52,11 +52,10 @@ class ProductController extends BaseController @@ -52,11 +52,10 @@ class ProductController extends BaseController
52 $query = $product->orderBy($this->order ,'desc')->orderBy('id','desc'); 52 $query = $product->orderBy($this->order ,'desc')->orderBy('id','desc');
53 $query = $this->searchParam($query); 53 $query = $this->searchParam($query);
54 $lists = $query->select($filed)->paginate($this->row, ['*'], 'page', $this->page); 54 $lists = $query->select($filed)->paginate($this->row, ['*'], 'page', $this->page);
55 - if(!empty($lists)){ 55 + if(!empty($lists) && !empty($lists['list'])){
56 $lists = $lists->toArray(); 56 $lists = $lists->toArray();
57 $cate_data = $this->getCategoryList();//分类 57 $cate_data = $this->getCategoryList();//分类
58 $key_data = $this->keywordNameLists($lists['list']);//关键字 58 $key_data = $this->keywordNameLists($lists['list']);//关键字
59 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($key_data, true) . PHP_EOL, FILE_APPEND);  
60 $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id 59 $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL);//获取模版id
61 $userModel = new User(); 60 $userModel = new User();
62 foreach ($lists['list'] as $k=>$v){ 61 foreach ($lists['list'] as $k=>$v){