當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sbr_meta::connect方法代碼示例

本文整理匯總了PHP中sbr_meta::connect方法的典型用法代碼示例。如果您正苦於以下問題:PHP sbr_meta::connect方法的具體用法?PHP sbr_meta::connect怎麽用?PHP sbr_meta::connect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sbr_meta的用法示例。


在下文中一共展示了sbr_meta::connect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: DBConnect

 /**
  * Возвращает события СБР, связанные с заданной транзакцией для отправки уведомлений.
  * Группируется по ид. транзакции и по pmail-функции.
  * @see pmail::SbrNewEvents(()
  *
  * @param integer $xids   идентификаторы транзакций.
  * @param resource $connect   коннект к БД (см. pgq -- mail_cons.php)
  * @return array   куча инфы по событию, включая изменения, произошедшие в нем.
  */
 static function getEventsInfo4Sending($xids, $connect = NULL)
 {
     self::$connect = $connect ? $connect : DBConnect();
     $xids = implode(',', $xids);
     if (!$xids) {
         return NULL;
     }
     $sql = "\n          SELECT se.id, ec.level, se.sbr_id, ec.abbr, se.version, se.ev_code, se.xact_id, se.foronly_role, sx.xtime as ev_time, sx.xtype, ec.name as ev_name, ec.own_rel, ec.own_role, ec.pmail_fn,\n                 s.name as sbr_name, ss.name as stage_name, se.own_id, st.rel, st.col, sv.old_val, sv.new_val, sv.note,\n                 ss.frl_feedback_id, ss.emp_feedback_id, ss.id as stage_id,\n                 e.uid as e_uid, e.login as e_login, e.uname as e_uname, e.usurname as e_usurname, e.email as e_email,\n                 f.uid as f_uid, f.login as f_login, f.uname as f_uname, f.usurname as f_usurname, f.email as f_email,\n                 s.reserved_id, s.scheme_type, s.posted\n            FROM sbr_xacts sx\n          INNER JOIN\n            sbr_events se\n              ON se.xact_id = sx.id\n             AND COALESCE(se.foronly_role, -100) <> 0\n          INNER JOIN\n            sbr_ev_codes ec\n              ON ec.id = se.ev_code\n             AND ec.pmail_fn IS NOT NULL\n          INNER JOIN sbr s\n              ON s.id = se.sbr_id\n             AND (s.status NOT IN (" . sbr::STATUS_REFUSED . "," . sbr::STATUS_CANCELED . ") OR ec.id IN (sbr_evc('sbr.REFUSE'), sbr_evc('sbr.CANCEL')))\n          INNER JOIN\n            employer e\n              ON e.uid = s.emp_id\n          INNER JOIN\n            freelancer f\n              ON f.uid = s.frl_id\n          LEFT JOIN\n            sbr_stages ss\n              --ON ss.id = se.own_id\n             --AND ec.own_rel = 'sbr_stages'\n             -- если событие не связано с этапом, а со всей сделкой, то подключается первый этап\n              ON ( ss.id = se.own_id AND ec.own_rel = 'sbr_stages' ) OR (ss.sbr_id = se.own_id AND ec.own_rel = 'sbr' AND ss.num = 0 )\n          LEFT JOIN\n            sbr_versions sv\n          INNER JOIN\n            sbr_types st\n              ON st.id = sv.src_type_id\n              ON sv.event_id = se.id\n           WHERE sx.id IN ({$xids})\n           ORDER BY se.xact_id, se.sbr_id, ec.level, se.id\n        ";
     if ($res = pg_query(self::connect(), $sql)) {
         $ret = array();
         while ($row = pg_fetch_assoc($res)) {
             if ($row['pmail_fn']) {
                 $ret[$row['xact_id']][$row['pmail_fn']][] = $row;
             }
         }
     }
     return $ret;
 }
開發者ID:Nikitian,項目名稱:fl-ru-damp,代碼行數:27,代碼來源:sbr_meta.php


注:本文中的sbr_meta::connect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。