mirror of
https://gh.wpcy.net/https://github.com/netcccyun/easypanel.git
synced 2026-04-23 03:52:25 +08:00
39 lines
No EOL
709 B
PHP
39 lines
No EOL
709 B
PHP
<?php
|
|
class VhostproductAPI extends API
|
|
{
|
|
public function add($arr, $migrate = null)
|
|
{
|
|
$name = $arr['product_name'];
|
|
|
|
if ($arr['cdn'] == '1') {
|
|
$arr['subdir_flag'] = 1;
|
|
$arr['templete'] = 'html';
|
|
$arr['subtemplete'] = null;
|
|
$arr['db_quota'] = 0;
|
|
$arr['web_quota'] = 0;
|
|
}
|
|
|
|
if (daocall('product', 'getProductByName', array($name))) {
|
|
setLastError('产品名重复');
|
|
print_r($GLOBALS['last_error']);
|
|
return false;
|
|
}
|
|
|
|
if (!daocall('product', 'addProduct', array($arr))) {
|
|
setLastError('插入失败');
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* da.ctl.php
|
|
* Enter description here ...
|
|
*/
|
|
public function del()
|
|
{
|
|
}
|
|
}
|
|
|
|
?>
|