Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
mdserver-web/web/thisdb/domain.py

34 lines
1.1 KiB

# coding:utf-8
# ---------------------------------------------------------------------------------
# MW-Linux面板
# ---------------------------------------------------------------------------------
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved.
# ---------------------------------------------------------------------------------
# Author: midoks <midoks@163.com>
# ---------------------------------------------------------------------------------
import core.mw as mw
__FIELD = 'id,pid,name,port,add_time'
def addDomain(pid, name, port):
now_time = mw.getDateFromNow()
insert_data = {
'pid': pid,
'name': name,
'port':port,
'add_time': now_time,
}
return mw.M('domain').insert(insert_data)
def getDomainByPid(pid):
# .debug(True)
return mw.M('domain').field(__FIELD).where("pid=?", (pid,)).select()
def deleteDomainId(domain_id):
return mw.M('domain').where("id=?", (domain_id,)).delete()
def deleteDomainBySiteId(site_id):
return mw.M('domain').where("pid=?", (site_id,)).delete()