Beispiel #1
0
 public function getTransActionsByRequestID($reqId = FALSE)
 {
     foreach ($reqId as $row => $val) {
         $request_ids[$row] = $reqId[$row]['request_id'];
     }
     $tbl = new Application_Model_DbTable_Transactions(Np_Db::slave());
     $select = $tbl->select();
     $select->where('request_id IN (?)', $request_ids)->order('id DESC');
     $result = $select->query()->fetchAll();
     //take the last one
     if ($result) {
         return $result;
     }
     return null;
 }
Beispiel #2
0
 public function checkifgoodpublish($reqId)
 {
     $tbl = new Application_Model_DbTable_Transactions(Np_Db::slave());
     $select = $tbl->select();
     $select->where('request_id=?', $reqId)->where('message_type = "Publish_response" ')->where("reject_reason_code is NULL OR reject_reason_code = '' ");
     $result = $select->query();
     $rows = $result->fetchAll();
     foreach ($rows as $row) {
         $publish_update_result = Application_Model_Cron::updateGoodPublish($row['request_id'], substr($row['trx_no'], 0, 2));
     }
     return;
 }
Beispiel #3
0
 /**
  * search transaction by request id and stage ()
  * @param string $request_id the id of the request
  * @param string $stage check, request, execute, etc
  * @param string $reject_reason_code
  */
 public static function getTransactions($request_id, $stage = null, $reject_reason_code = null)
 {
     $tbl = new Application_Model_DbTable_Transactions(Np_Db::slave());
     $select = $tbl->select();
     $select->where("request_id = ? ", (string) $request_id);
     if ($stage) {
         $select->where("message_type = ?", (string) $stage);
     }
     if ($reject_reason_code === 'null') {
         $select->where("reject_reason_code IS NULL OR reject_reason_code =''");
     } else {
         if (!empty($reject_reason_code)) {
             $select->where("reject_reason_code = ?", (string) $reject_reason_code);
         }
     }
     $results = $select->order('id DESC')->limit(1000)->query()->fetchAll();
     return $results;
 }