12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace refill\fetch_zanzan;
- require_once(BASE_HELPER_RAPI_PATH . '/fetch_zanzan/config.php');
- use refill;
- class RefillOil extends refill\IRefillOil
- {
- public function __construct($cfgs)
- {
- parent::__construct($cfgs);
- }
- public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
- {
- refill\util::send_normal($params['order_sn']);
- return [true , '',false];
- }
- public function query($refill_info)
- {
- $order_sn = $refill_info['order_sn'];
- $store_id = $this->store_id();
- $mod_fetch = Model('fetch_order');
- $order = $mod_fetch->order_info(['order_sn' => $order_sn,'store_id' => $store_id],'*',true);
- if(empty($order)) {
- return [true, ORDER_STATE_NOEXIST];
- }
- $fetch_status = intval($order['fetch_status']);
- $fetch_result = $order['fetch_result'];
- $official_sn = $order['official_sn'];
- if ($fetch_status == 0) {
- $order_state = ORDER_STATE_CANCEL;
- } elseif ($fetch_status == 1 || $fetch_status == 2) {
- $order_state = ORDER_STATE_SEND;
- } elseif ($fetch_result == "SUCCESS") {
- $order_state = ORDER_STATE_SUCCESS;
- Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $official_sn]);
- } else {
- $order_state = ORDER_STATE_CANCEL;
- }
- return [true, $order_state];
- }
- public function balance()
- {
- return [false, '暂无余额接口'];
- }
- }
|