self::STATUS_REJECT, 'sh_time' => date('Y-m-d H:i:s')), array('id' => $id)); return $res; } /** * @param $storeId * @param $status * @return bool */ static function getWithdrawalMoney($uniacid, $storeId, $status) { return pdo_get('cjdc_withdrawal', array('store_id' => $storeId,'uniacid' => $uniacid, 'state '=> $status ), array('sum(tx_cost) as tx_cost')); } /** * 提现中的金额 * @param $storeId * @return bool */ static function getWithdrawalingMoney($uniacid, $storeId) { return self::getWithdrawalMoney($uniacid, $storeId, self::STATUS_WAIT_APPROVE); } /** * @param $storeId * @return bool */ static function getWithdrawaledMoney($uniacid, $storeId) { return self::getWithdrawalMoney($uniacid, $storeId, self::STATUS_APPROVE); } /** * 计算商店商品收入金额,非退款的金额 * @param $uniacid * @param $storeId * @return bool */ static function storeOrdersAmount($uniacid, $storeId) { //cjdc_order_price_stat $where = " where a.uniacid=:uniacid and a.store_id=:store_id and a.pay_type in (1,2) and a.state in (4,5,10)"; $selectSQL = "select sum(ops.pay_price) as 'pay_price',sum(ops.goods_price) as goods_price, sum(ops.service_fee) as service_fee, sum(ops.wx_pay_fee) as wx_pay_fee ". " from ". tablename("cjdc_order") ." as a". " left join ". tablename("cjdc_order_price_stat") ." as ops on ops.order_id = a.id". $where; $params = [':uniacid' => $uniacid, ':store_id' => $storeId]; $totalAmount = pdo_fetch($selectSQL, $params); return $totalAmount; } /** * 未结算的金额 * @param $uniacid * @param $storeId * @return bool */ static function storeOnWayAmount($uniacid, $storeId) { $where = " where a.uniacid=:uniacid and a.store_id=:store_id and a.pay_type in (1,2) and a.state in (2,3,8) "; $selectSQL = "select sum(ops.pay_price) as 'pay_price',sum(ops.goods_price) as goods_price, sum(ops.service_fee) as service_fee, sum(ops.wx_pay_fee) as wx_pay_fee ". " from ". tablename("cjdc_order") ." as a". " left join ". tablename("cjdc_order_price_stat") ." as ops on ops.order_id = a.id". $where; $params = [':uniacid' => $uniacid, ':store_id' => $storeId]; $totalAmount = pdo_fetch($selectSQL, $params); return $totalAmount; } }