本文整理汇总了Python中po.Po.raw_sql方法的典型用法代码示例。如果您正苦于以下问题:Python Po.raw_sql方法的具体用法?Python Po.raw_sql怎么用?Python Po.raw_sql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类po.Po
的用法示例。
在下文中一共展示了Po.raw_sql方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: event_feedback_id_get
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import raw_sql [as 别名]
def event_feedback_id_get(user_id, event_id):
c = Po.raw_sql(
'select id from po where rid=%s and cid=%s and user_id=%s and state>%s', event_id, CID_EVENT_FEEDBACK, user_id, STATE_RM
)
r = c.fetchone()
if r:
return r[0]
return 0
示例2: po_review_id_get
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import raw_sql [as 别名]
def po_review_id_get(zsite_id, user_id):
c = Po.raw_sql(
'select id from po where zsite_id=%s and user_id=%s and cid=%s',
zsite_id, user_id, CID_REVIEW
)
r = c.fetchone()
if r:
return r[0]
return 0
示例3: po_recommend_id_by_rid_user_id
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import raw_sql [as 别名]
def po_recommend_id_by_rid_user_id(rid, user_id):
c = Po.raw_sql(
'select id from po where rid=%s and user_id=%s and cid=%s and state = %s',
rid, user_id, CID_REC, STATE_ACTIVE
)
r = c.fetchone()
if r:
return r[0]
return 0
示例4: log_num_po_zsite
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import raw_sql [as 别名]
def log_num_po_zsite():
num = Po.raw_sql('select count(1) from po where zsite_id != user_id').fetchone()[0]
log_history_new(Po, LOG_HISTORY_CID_PO_ZSITE, num )
示例5: log_num_po
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import raw_sql [as 别名]
def log_num_po():
num = Po.raw_sql('select count(1) from po where zsite_id = 0').fetchone()[0]
log_history_new(Po, LOG_HISTORY_CID_PO, num)