本文整理汇总了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;
}