}
$data = $this->_product->getOneByName(['id' => $id]);
// var_dump($data);die;
$type = $this->_Producttype->getOne($data['type_id']);
$type['uname'] = str_replace(" ", "-", $type['name']);
$this->assign('type', $type);
$this->_product->up(['id' => $data['id']], ['view_num' => ($data['view_num'] + 1)]);
//产品图片
$data['img'] = json_decode($data['img'], true);
$data['cover'] = json_decode($data['cover'], true);
$data['video_img'] = json_decode($data['video_img'], true);
//产品参数
$data['params_mm'] = json_decode($data['params_mm'], true);
$data['params_inch'] = json_decode($data['params_inch'], true);
//部件列表
$data['parts'] = json_decode($data['parts'], true);
$pid = implode(',', $data['parts']);
$parts = $this->_Parts->getListSelect(['id' => ['in', $pid]], true);
foreach ($parts as $v) {