|
|
@@ -23,7 +23,7 @@ class MarketLogic
|
|
|
$minPrice = ProductTransfer::getTransferMinPrice($productId);
|
|
|
if($price < $minPrice) $minPrice = $price;
|
|
|
|
|
|
- $isUpdate = false;
|
|
|
+
|
|
|
//添加市场
|
|
|
$rows = ProductMarket::where('product_id', $productId)->find();
|
|
|
if(empty($rows)){
|
|
|
@@ -31,20 +31,21 @@ class MarketLogic
|
|
|
'product_id' => $productId,
|
|
|
'type_id' => ProductLists::getProductTypeById($productId),
|
|
|
'price' => $minPrice,'status' => ProductMarket::Normal]);
|
|
|
- }
|
|
|
-
|
|
|
- //更新市场状态
|
|
|
- if($rows->status != ProductMarket::Normal ){
|
|
|
- $rows->status = ProductMarket::Normal;
|
|
|
- $isUpdate = true;
|
|
|
- }
|
|
|
- //更新最低价
|
|
|
- if($rows->price != $minPrice){
|
|
|
- $rows->price = $minPrice;
|
|
|
- $isUpdate = true;
|
|
|
- }
|
|
|
- if($isUpdate) $rows->save();
|
|
|
+ }else{
|
|
|
|
|
|
+ $isUpdate = false;
|
|
|
+ //更新市场状态
|
|
|
+ if($rows->status != ProductMarket::Normal ){
|
|
|
+ $rows->status = ProductMarket::Normal;
|
|
|
+ $isUpdate = true;
|
|
|
+ }
|
|
|
+ //更新最低价
|
|
|
+ if($rows->price != $minPrice){
|
|
|
+ $rows->price = $minPrice;
|
|
|
+ $isUpdate = true;
|
|
|
+ }
|
|
|
+ if($isUpdate) $rows->save();
|
|
|
+ }
|
|
|
//添加寄售订单
|
|
|
$fee = getConfig('transfer_fee');
|
|
|
$feeAmount = bcmul($price, $fee, 2) ;
|