0 and $price < 30) { return 0; } elseif ($price >= 30) { return 1; } } static function wxPayFee() { return 0.006; } /** * @param $postData * @return bool */ static function addOrderPriceStat($postData) { $tt = time(); $postData['created_at'] = $tt; $postData['updated_at'] = $tt; $postData['wx_pay_fee'] = $postData['pay_price'] * self::wxPayFee(); $postData['service_fee'] = self::platformServiceFee($postData['pay_price']); return pdo_insert('cjdc_order_price_stat', $postData); } /** * @param $storeId * @param $orderId * @param $orderType * @param $refundPrice * @return bool */ static function updateOrderPriceStat($storeId, $orderId, $refundPrice, $orderType = '') { $tt = time(); $updateData = ['refund_price' => $refundPrice, 'refund_time' => $tt,'updated_at' => $tt]; $condition = ['store_id' => $storeId, 'order_id' => $orderId, 'refund_price' => 0]; return pdo_update('cjdc_order_price_stat', $updateData, $condition); } }