|
@@ -100,14 +100,33 @@ class Index extends BaseController
|
|
|
if($storeInfo['price'] == 0){
|
|
if($storeInfo['price'] == 0){
|
|
|
$storeInfo['price'] = round($storeInfo['ot_price'] * 1.15, 2);
|
|
$storeInfo['price'] = round($storeInfo['ot_price'] * 1.15, 2);
|
|
|
}
|
|
}
|
|
|
|
|
+ $storeInfo['market_price'] = round($storeInfo['price'] * 1.3, 2);
|
|
|
|
|
+ $score = Db::name("product_score")->where('product_id', $id)->find();
|
|
|
|
|
+ if($score) {
|
|
|
|
|
+ $attr = json_decode($score['attribute'], true);
|
|
|
|
|
+ $max = $attr[2]['taobao'];
|
|
|
|
|
+ if($attr[2]['t1688'] > $max)
|
|
|
|
|
+ $max = $attr[2]['t1688'];
|
|
|
|
|
+ if($attr[2]['pdd'] > $max)
|
|
|
|
|
+ $max = $attr[2]['pdd'];
|
|
|
|
|
+ if($attr[2]['dy'] > $max)
|
|
|
|
|
+ $max = $attr[2]['dy'];
|
|
|
|
|
+ if($attr[2]['ks'] > $max)
|
|
|
|
|
+ $max = $attr[2]['ks'];
|
|
|
|
|
+ if($attr[2]['other'] > $max)
|
|
|
|
|
+ $max = $attr[2]['other'];
|
|
|
|
|
+ if($max)
|
|
|
|
|
+ $storeInfo['market_price'] = $max;
|
|
|
|
|
+ }
|
|
|
$data['storeInfo'] = $storeInfo;
|
|
$data['storeInfo'] = $storeInfo;
|
|
|
- list($productAttr, $productValue) = ProductAttr::getProductAttrDetail($id, 0, 0);
|
|
|
|
|
|
|
+ list($productAttr, $productValue, $sku) = ProductAttr::getProductAttrDetail($id, 0, 0);
|
|
|
$data['productAttr'] = $productAttr;
|
|
$data['productAttr'] = $productAttr;
|
|
|
$prices = array_column($productValue, 'price');
|
|
$prices = array_column($productValue, 'price');
|
|
|
array_multisort($prices, SORT_ASC, SORT_NUMERIC, $productValue);
|
|
array_multisort($prices, SORT_ASC, SORT_NUMERIC, $productValue);
|
|
|
$keys = array_keys($productValue);
|
|
$keys = array_keys($productValue);
|
|
|
$productValue = array_combine($keys, $productValue);
|
|
$productValue = array_combine($keys, $productValue);
|
|
|
$data['productValue'] = $productValue;
|
|
$data['productValue'] = $productValue;
|
|
|
|
|
+ $data['sku'] = $sku;
|
|
|
$data['priceName'] = 0;
|
|
$data['priceName'] = 0;
|
|
|
$data['good_list'] = Product::getGoodList(18, 'image,store_name,price,id,ot_price,stock,IFNULL(sales,0) + IFNULL(ficti,0) as fsales,unit_name');
|
|
$data['good_list'] = Product::getGoodList(18, 'image,store_name,price,id,ot_price,stock,IFNULL(sales,0) + IFNULL(ficti,0) as fsales,unit_name');
|
|
|
return app('json')->successful($data);
|
|
return app('json')->successful($data);
|