* Fix bug #17264.
This commit is contained in:
+12
-3
@@ -196,20 +196,29 @@ class docModel extends model
|
||||
/**
|
||||
* creat a api doc library.
|
||||
*
|
||||
* @param stdClass $data form data.
|
||||
* @return int
|
||||
* @author thanatos thanatos915@163.com
|
||||
*/
|
||||
public function createApiLib($data)
|
||||
public function createApiLib()
|
||||
{
|
||||
/* replace doc library name */
|
||||
$this->lang->doclib->name = '接口库名称';
|
||||
$this->lang->doclib->name = $this->lang->doclib->apiLibName;
|
||||
|
||||
$data = fixer::input('post')
|
||||
->trim('name')
|
||||
->join('groups', ',')
|
||||
->join('users', ',')
|
||||
->get();
|
||||
|
||||
if($data->acl == 'private') $data->users = $this->app->user->account;
|
||||
if($data->acl == 'custom' && strpos($data->users, $this->app->user->account) === false) $data->users .= ',' . $this->app->user->account;
|
||||
|
||||
$data->type = static::DOC_TYPE_API;
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($data)->autoCheck()
|
||||
->batchCheck($this->config->api->createlib->requiredFields, 'notempty')
|
||||
->check('name', 'unique', "`type` = '" . static::DOC_TYPE_API . "'")
|
||||
->exec();
|
||||
|
||||
return $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user