| | |
| | | |
| | | namespace app\api\controller\product; |
| | | |
| | | use app\api\model\page\Page; |
| | | use app\api\model\product\Product as ProductModel; |
| | | use app\api\model\order\Cart as CartModel; |
| | | use app\api\controller\Controller; |
| | |
| | | 'product_status' => 10, |
| | | 'audit_status' => 10 |
| | | ]); |
| | | $page = (new Page())::getDefault(); |
| | | if (!empty($page)) { |
| | | if ($page['page_id'] == 10079){ |
| | | $param['category_id']=197; |
| | | } |
| | | } |
| | | |
| | | // 获取列表数据 |
| | | $model = new ProductModel; |
| | |
| | | $store = storeModel::detail($store_id); |
| | | } |
| | | } |
| | | $cart=new CartModel(); |
| | | if ($product['spec_type']==20&&!empty($user)){ |
| | | foreach ($product['sku'] as $key => $value) { |
| | | $cartData=$cart |
| | | ->when('spec_sku_id', $value['spec_sku_id']) |
| | | ->when('product_id', $product_id) |
| | | ->when('user_id', $user['user_id']) |
| | | ->find(); |
| | | if($cartData){ |
| | | $product['sku'][$key]['cart'] = $cartData; |
| | | }else{ |
| | | $product['sku'][$key]['cart'] = ['total_num'=>0]; |
| | | } |
| | | |
| | | } |
| | | } |
| | | $page = (new Page())::getDefault(); |
| | | $is_store_open=true; |
| | | if (!empty($page)) { |
| | | if ($page['page_id'] == 10079){ |
| | | $is_store_open=false; |
| | | } |
| | | } |
| | | return $this->renderSuccess('', [ |
| | | // 商品详情 |
| | | 'detail' => $product, |
| | |
| | | 'share' => $this->getShareParams($url, $product['product_name'], $product['product_name'], '/pages/product/detail/detail', $product['image'][0]['file_path']), |
| | | 'couponList' => $couponList, |
| | | //是否显示店铺信息 |
| | | 'store_open' => SettingModel::getStoreOpen(), |
| | | 'store_open' => $is_store_open&&SettingModel::getStoreOpen(), |
| | | //显示店铺的类型 |
| | | 'store' => $store, |
| | | //是否显示下划线价格 |