Commit 92492e23 by 杨树贤

Merge branch 'dev/ver/1.0.0'

parents 085b623c bbaa3dbf
...@@ -59,3 +59,5 @@ PUBLIC_URL= ...@@ -59,3 +59,5 @@ PUBLIC_URL=
GOODS_INFO_URL=http://192.168.1.237:60014 GOODS_INFO_URL=http://192.168.1.237:60014
#深茂搜索地址 #深茂搜索地址
SO_URL=http://so.semourdev.net SO_URL=http://so.semourdev.net
#基石地址
FOOTSTONE_URL=http://footstone.liexindev.net
...@@ -10,10 +10,9 @@ class BrandService ...@@ -10,10 +10,9 @@ class BrandService
public static function getStandardBrandList($map) public static function getStandardBrandList($map)
{ {
$standardBrandCache = Redis::hgetall('standard_brand'); $standardBrandData = \Http::get(config('website.footstone_url') . '/open/getStandardBrandList')->json();
$standardBrandCache = array_map(function ($value) { if (isset($standardBrandData['code']) && $standardBrandData['code'] == 0) {
return json_decode($value, true); $standardBrandCache = $standardBrandData['data'];
}, $standardBrandCache);
ksort($standardBrandCache); ksort($standardBrandCache);
$standardBrandCache = array_values($standardBrandCache); $standardBrandCache = array_values($standardBrandCache);
$standardBrandCache = array_map(function ($item) { $standardBrandCache = array_map(function ($item) {
...@@ -29,6 +28,8 @@ class BrandService ...@@ -29,6 +28,8 @@ class BrandService
} }
return $standardBrandCache; return $standardBrandCache;
} }
return [];
}
//获取品牌页的数据(标准品牌) //获取品牌页的数据(标准品牌)
...@@ -39,10 +40,9 @@ class BrandService ...@@ -39,10 +40,9 @@ class BrandService
if ($standardBrandList) { if ($standardBrandList) {
return json_decode($standardBrandList, true); return json_decode($standardBrandList, true);
} }
$standardBrandCache = Redis::hgetall('standard_brand'); $standardBrandData = \Http::get(config('website.footstone_url') . '/open/getStandardBrandList')->json();
$standardBrandCache = array_map(function ($value) { if (isset($standardBrandData['code']) && $standardBrandData['code'] == 0) {
return json_decode($value, true); $standardBrandCache = $standardBrandData['data'];
}, $standardBrandCache);
$letters = generate_letters(); $letters = generate_letters();
$standardBrandList = []; $standardBrandList = [];
foreach ($standardBrandCache as $standardBrand) { foreach ($standardBrandCache as $standardBrand) {
...@@ -65,6 +65,8 @@ class BrandService ...@@ -65,6 +65,8 @@ class BrandService
Redis::expire($redisKey, 60); Redis::expire($redisKey, 60);
return $standardBrandList; return $standardBrandList;
} }
return [];
}
public static function getStandardBrandInfo($brandId) public static function getStandardBrandInfo($brandId)
{ {
......
...@@ -10,10 +10,11 @@ class ClassService ...@@ -10,10 +10,11 @@ class ClassService
public static function getClassificationForHome() public static function getClassificationForHome()
{ {
//先获取所有分类 //先获取所有分类
$classCache = Redis::hgetall('pool_class_info'); $classData = \Http::get(config('website.footstone_url') . '/open/getClassification')->json();
$secondClassList = []; $secondClassList = [];
if (isset($classData['code']) && $classData['code'] == 0) {
$classCache = $classData['data'];
foreach ($classCache as $key => &$class) { foreach ($classCache as $key => &$class) {
$class = json_decode($class, true);
if (!$class['parent_id']) { if (!$class['parent_id']) {
if (empty($class['class_name_en'])) { if (empty($class['class_name_en'])) {
continue; continue;
...@@ -31,7 +32,6 @@ class ClassService ...@@ -31,7 +32,6 @@ class ClassService
if (empty($class['class_name_en'])) { if (empty($class['class_name_en'])) {
continue; continue;
} }
$class['sku_number'] = Redis::hget('pool_class_info_count', $class['class_id']) ?: 0;
$secondClass['children'][] = $class; $secondClass['children'][] = $class;
} }
} }
...@@ -58,24 +58,30 @@ class ClassService ...@@ -58,24 +58,30 @@ class ClassService
} }
return array_values($topFields); return array_values($topFields);
} }
return [];
}
public static function getClassificationById($classId,$includeChildren = false) public static function getClassificationById($classId, $includeChildren = false)
{ {
$classification = Redis::hget('pool_class_info', $classId); $classData = \Http::get(config('website.footstone_url') . '/open/getClassification')->json();
$classification = json_decode($classification,true); if (isset($classData['code']) && $classData['code'] == 0) {
$classificationCache = $classData['data'];
$classification = [];
foreach ($classificationCache as $class) {
if ($class['class_id'] == $classId) {
$classification = $class;
}
}
if ($classification['parent_id']) { if ($classification['parent_id']) {
return $classification; return $classification;
} }
//获取子分类 //获取子分类
$classificationCache = Redis::hgetall('pool_class_info');
$totalSkuNumber = 0; $totalSkuNumber = 0;
foreach ($classificationCache as $classCache) { foreach ($classificationCache as $classCache) {
$classCache = json_decode($classCache, true);
if ($classCache['parent_id'] == $classId) { if ($classCache['parent_id'] == $classId) {
if (empty($classCache['class_name_en'])) { if (empty($classCache['class_name_en'])) {
continue; continue;
} }
$classCache['sku_number'] = Redis::hget('pool_class_info_count', $classCache['class_id']) ?: 0;
$totalSkuNumber += $classCache['sku_number']; $totalSkuNumber += $classCache['sku_number'];
$classification['children'][] = $classCache; $classification['children'][] = $classCache;
} }
...@@ -83,5 +89,7 @@ class ClassService ...@@ -83,5 +89,7 @@ class ClassService
$classification['sku_number'] = $totalSkuNumber; $classification['sku_number'] = $totalSkuNumber;
return $classification; return $classification;
} }
return [];
}
} }
...@@ -466,9 +466,9 @@ class OrderService ...@@ -466,9 +466,9 @@ class OrderService
$temp = []; $temp = [];
$return_amount_all = 0; $return_amount_all = 0;
foreach ($returnItems as $k=>$v){ foreach ($returnItems as $k=>$v){
$orderGoodsInfo = \Arr::get($orderItemsArr,$v["rec_id"]); $recId = $v["rec_id"];
$temp[] = [ $orderGoodsInfo = \Arr::get($orderItemsArr,$recId);
"no"=>$k+1, $temp[$recId] = [
"part_no"=>$orderGoodsInfo["goods_name"], // 型号名称 "part_no"=>$orderGoodsInfo["goods_name"], // 型号名称
"manufacturer"=>$orderGoodsInfo["brand_name"], // 品牌名称 "manufacturer"=>$orderGoodsInfo["brand_name"], // 品牌名称
"price_per_unit"=>$orderGoodsInfo["goods_price"], // 单价 "price_per_unit"=>$orderGoodsInfo["goods_price"], // 单价
...@@ -481,6 +481,11 @@ class OrderService ...@@ -481,6 +481,11 @@ class OrderService
]; ];
$return_amount_all += $v["return_amount"]; $return_amount_all += $v["return_amount"];
} }
$temp = array_values($temp);
foreach ($temp as $c=>&$a){
$a["no"] = $c+1;
}
return ["return_amount_all"=>$return_amount_all,"items"=>$temp]; return ["return_amount_all"=>$return_amount_all,"items"=>$temp];
} }
......
<?php
return [
'footstone_url' => env('FOOTSTONE_URL'),
];
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</div> </div>
</div> </div>
<div class="create createcarbtn">Place Order</div> <div class="create createcarbtn">Place Order</div>
@if(empty($_COOKIE['sem_email'])) @if(Auth::check())
<div class="lgtips"> <div class="lgtips">
Already Registered? <a href="/login?referer={{\Illuminate\Support\Facades\URL::current()}}">Log In</a> Already Registered? <a href="/login?referer={{\Illuminate\Support\Facades\URL::current()}}">Log In</a>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment