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

35 lines
1.1 KiB

6 months ago
# 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)
6 months ago
def getDomainByPid(pid):
6 months ago
# .debug(True)
return mw.M('domain').field(__FIELD).where("pid=?", (pid,)).select()
6 months ago
6 months ago
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()