|
@@ -107,19 +107,25 @@ class CalcMerchantMixedPrice implements ICalc
|
|
|
|
|
|
class ZeroMerchantPrice implements ICalc
|
|
|
{
|
|
|
- public function __construct($mchid,$amount,$card_type,$quality)
|
|
|
- {
|
|
|
+ private $mMchAmount;
|
|
|
+ private $mQuantity;
|
|
|
|
|
|
+ public function __construct(order $order)
|
|
|
+ {
|
|
|
+ $this->mMchAmount = $order->mch_amount();
|
|
|
+ $quantity = $order->quantity();
|
|
|
+ $quantity = intval($quantity);
|
|
|
+ $this->mQuantity = $quantity <= 0 ? 1 : $quantity;
|
|
|
}
|
|
|
|
|
|
public function calc_vgoods_price($goods_info)
|
|
|
{
|
|
|
- return round(0,4);
|
|
|
+ return round($this->mMchAmount / $this->mQuantity,4);
|
|
|
}
|
|
|
|
|
|
public function calc_vorder_amount($order_info)
|
|
|
{
|
|
|
- return round(0,4);
|
|
|
+ return round($this->mMchAmount,4);
|
|
|
}
|
|
|
|
|
|
public function calc_tips()
|