'product' => $product,
'url_flag' => 'product_category',
]);
return $this->view->fetch('product/category');
}
public function detail($category,$page_url){
$procate = Procate::where('url',$category)->find();
$product = \app\admin\model\Product::where([
'page_url'=>$page_url,
'procate_id'=>$procate['id'],
])->find();
$relate_pro = \app\admin\model\Product::field('id,name,list_image,page_url,release_time,introduction,attr_one,attr_two,attr_three')
->with([
'procate'=>function($query){
$query->field('procate.id,url');
},
])->where('product.id','in',$product['product_ids'])->order('sort_t desc')->select();
if(!empty($product['attr_one'])){
$product['attr_one_key'] = explode(':',$product['attr_one'])[0] ?? '';