|
|
@@ -438,6 +438,7 @@ class StoreProductServices extends BaseServices
|
|
|
'pic' => $productInfo['image'],
|
|
|
'price' => $productInfo['price'],
|
|
|
'settle_price' => $productInfo['settle_price'] ?? 0,
|
|
|
+ 'award_price' => $productInfo['award_price'] ?? 0,
|
|
|
'cost' => $productInfo['cost'],
|
|
|
'ot_price' => $productInfo['ot_price'],
|
|
|
'stock' => $productInfo['stock'],
|
|
|
@@ -465,7 +466,7 @@ class StoreProductServices extends BaseServices
|
|
|
}
|
|
|
$productInfo['items'] = $result['attr'];
|
|
|
$productInfo['attrs'] = $result['value'];
|
|
|
- $productInfo['attr'] = ['pic' => '', 'vip_price' => 0, 'price' => 0, 'settle_price' => 0, 'cost' => 0, 'ot_price' => 0, 'stock' => 0, 'bar_code' => '', 'weight' => 0, 'volume' => 0, 'brokerage' => 0, 'brokerage_two' => 0, 'code' => ''];
|
|
|
+ $productInfo['attr'] = ['pic' => '', 'vip_price' => 0, 'price' => 0, 'settle_price' => 0, 'award_price' => 0, 'cost' => 0, 'ot_price' => 0, 'stock' => 0, 'bar_code' => '', 'weight' => 0, 'volume' => 0, 'brokerage' => 0, 'brokerage_two' => 0, 'code' => ''];
|
|
|
} else {
|
|
|
/** @var StoreProductVirtualServices $virtualService */
|
|
|
$virtualService = app()->make(StoreProductVirtualServices::class);
|
|
|
@@ -477,6 +478,7 @@ class StoreProductServices extends BaseServices
|
|
|
'vip_price' => isset($result['vip_price']) ? floatval($result['vip_price']) : 0,
|
|
|
'price' => isset($result['price']) ? floatval($result['price']) : 0,
|
|
|
'settle_price' => isset($result['settle_price']) ? floatval($result['settle_price']) : 0,
|
|
|
+ 'award_price' => isset($result['award_price']) ? floatval($result['award_price']) : 0,
|
|
|
'cost' => isset($result['cost']) ? floatval($result['cost']) : 0,
|
|
|
'ot_price' => isset($result['ot_price']) ? floatval($result['ot_price']) : 0,
|
|
|
'stock' => isset($result['stock']) ? floatval($result['stock']) : 0,
|
|
|
@@ -597,11 +599,12 @@ class StoreProductServices extends BaseServices
|
|
|
$suk = implode(',', $detail);
|
|
|
$types = 1;
|
|
|
if ($id) {
|
|
|
- $sukValue = $storeProductAttrValueServices->getSkuArray(['product_id' => $id, 'type' => 0, 'suk' => $suk], 'unique,bar_code,code,cost,price,settle_price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,vip_price,disk_info', 'suk');
|
|
|
+ $sukValue = $storeProductAttrValueServices->getSkuArray(['product_id' => $id, 'type' => 0, 'suk' => $suk], 'unique,bar_code,code,cost,award_price,price,settle_price,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,vip_price,disk_info', 'suk');
|
|
|
if (!$sukValue) {
|
|
|
if ($type == 0) $types = 0; //编辑商品时,将没有规格的数据不生成默认值
|
|
|
$sukValue[$suk]['pic'] = '';
|
|
|
$sukValue[$suk]['price'] = 0;
|
|
|
+ $sukValue[$suk]['award_price'] = 0;
|
|
|
$sukValue[$suk]['settle_price'] = 0;
|
|
|
$sukValue[$suk]['cost'] = 0;
|
|
|
$sukValue[$suk]['ot_price'] = 0;
|
|
|
@@ -632,6 +635,7 @@ class StoreProductServices extends BaseServices
|
|
|
} else {
|
|
|
$sukValue[$suk]['pic'] = '';
|
|
|
$sukValue[$suk]['price'] = 0;
|
|
|
+ $sukValue[$suk]['award_price'] = 0;
|
|
|
$sukValue[$suk]['settle_price'] = 0;
|
|
|
$sukValue[$suk]['cost'] = 0;
|
|
|
$sukValue[$suk]['ot_price'] = 0;
|
|
|
@@ -676,6 +680,7 @@ class StoreProductServices extends BaseServices
|
|
|
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
|
|
|
$valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
|
|
|
$valueNew[$count]['settle_price'] = $sukValue[$suk]['settle_price'] ? floatval($sukValue[$suk]['settle_price']) : 0;
|
|
|
+ $valueNew[$count]['award_price'] = $sukValue[$suk]['award_price'] ? floatval($sukValue[$suk]['award_price']) : 0;
|
|
|
$valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;
|
|
|
$valueNew[$count]['ot_price'] = isset($sukValue[$suk]['ot_price']) ? floatval($sukValue[$suk]['ot_price']) : 0;
|
|
|
$valueNew[$count]['vip_price'] = isset($sukValue[$suk]['vip_price']) ? floatval($sukValue[$suk]['vip_price']) : 0;
|
|
|
@@ -717,6 +722,7 @@ class StoreProductServices extends BaseServices
|
|
|
$header[] = ['title' => '成本价', 'slot' => 'cost', 'align' => 'center', 'minWidth' => 140];
|
|
|
}
|
|
|
|
|
|
+ $header[] = ['title' => '奖金结算', 'slot' => 'award_price', 'align' => 'center', 'minWidth' => 140];
|
|
|
$header[] = ['title' => '原价', 'slot' => 'ot_price', 'align' => 'center', 'minWidth' => 140];
|
|
|
// $header[] = ['title' => '会员价', 'slot' => 'vip_price', 'align' => 'center', 'minWidth' => 140];
|
|
|
$header[] = ['title' => '库存', 'slot' => 'stock', 'align' => 'center', 'minWidth' => 140];
|
|
|
@@ -961,6 +967,7 @@ class StoreProductServices extends BaseServices
|
|
|
$data['activity'] = implode(',', $data['activity']);
|
|
|
$data['recommend_list'] = count($data['recommend_list']) ? implode(',', $data['recommend_list']) : '';
|
|
|
$data['price'] = min(array_column($detail, 'price'));
|
|
|
+ $data['award_price'] = max(array_column($detail, 'award_price'));
|
|
|
$data['ot_price'] = min(array_column($detail, 'ot_price'));
|
|
|
$data['cost'] = min(array_column($detail, 'cost'));
|
|
|
if (!$data['cost']) {
|